diff options
author | Guy Harris <guy@alum.mit.edu> | 2012-05-04 16:56:18 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2012-05-04 16:56:18 +0000 |
commit | 33bb54a9452f4be53377a185195a63194016241a (patch) | |
tree | 9308829e2105b6e51e0dc5cc0af2295d8d97a0a3 /wiretap/iseries.c | |
parent | f65cb5f27bab6310e847f88cd763eb08bff1c93b (diff) |
file_seek() used to be a wrapper around fseek() or gzseek(), both of
which could use lseek() and were thus expensive due to system call
overhead. To avoid making a system call for every packet on a
sequential read, we maintained a data_offset field in the wtap structure
for sequential reads.
It's now a routine that just returns information from the FILE_T data
structure, so it's cheap. Use it, rather than maintaining the data_offset
field.
Readers for some file formats need to maintain file offset themselves;
have them do so in their private data structures.
svn path=/trunk/; revision=42423
Diffstat (limited to 'wiretap/iseries.c')
-rw-r--r-- | wiretap/iseries.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/wiretap/iseries.c b/wiretap/iseries.c index 37c2742880..764f2401ae 100644 --- a/wiretap/iseries.c +++ b/wiretap/iseries.c @@ -231,7 +231,6 @@ iseries_open (wtap * wth, int *err, gchar ** err_info) return -1; } - wth->data_offset = 0; wth->file_encap = WTAP_ENCAP_ETHERNET; wth->file_type = WTAP_FILE_ISERIES; wth->snapshot_length = 0; @@ -272,7 +271,6 @@ iseries_open (wtap * wth, int *err, gchar ** err_info) return -1; } - wth->data_offset = 0; wth->file_encap = WTAP_ENCAP_ETHERNET; wth->file_type = WTAP_FILE_ISERIES; wth->snapshot_length = 0; @@ -429,7 +427,6 @@ iseries_read (wtap * wth, int *err, gchar ** err_info, gint64 *data_offset) if (pkt_len == -1) return FALSE; - wth->data_offset = offset; *data_offset = offset; return TRUE; } |