diff options
| author | Andrew Morton <akpm@digeo.com> | 2002-11-04 18:17:53 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-11-04 18:17:53 -0800 |
| commit | 9aefc010ae3f2646d7870fcc244dc96a8c0d3b30 (patch) | |
| tree | 8808b3215d87f61e5de58f7dbf512f623607f677 /kernel | |
| parent | 4ccf7a32642b709056a6d60d87b56f3b72815c42 (diff) | |
[PATCH] `event' removal: ext2
Patch from Manfred Spraul
Use a local counter instead of the global 'event' variable for the
readdir() optimization.
Depends on patch-event-II
Background:
The only user of i_version and f_version in ext2 is
ext2_readdir(). As an optimization, ext2 performs the
validation of the start position for readdir() only if
flip->f_version != inode->i_version.
If there was no llseek and no directory change since the
last readdir() call, then f_pos can be trusted.
f_version is set to 0 in get_empty_flip and during llseek.
Right now, i_version set to ++event during ext2_read_inode
and commit_chunk, i.e. at inode creation and if a directory
is changed.
Initializing i_version to 1, and updating with i_version++
achieves the same effect, without the need of a global variable.
Global uniqueness is not required, there are no other uses
of [if]_version in ext2.
Change relative to the patch you have right now:
i_version is initialized to 1 instead of 0. For ext2 it's doesn't
matter [there is always a valid 'len' value at the beginning of a
directory data block], but it's cleaner.
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions
