diff options
author | jan Blunck <jblunck@suse.de> | 2010-05-26 14:44:53 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-27 09:12:56 -0700 |
commit | ca572727dbb945e443564029a495157fd2e72995 (patch) | |
tree | 10486033a428e9389e32cbc78c0da34c644640a1 /fs/reiserfs/dir.c | |
parent | b4d878e23c7f574490ee4d6fd59ebd6819781dd1 (diff) | |
download | op-kernel-dev-ca572727dbb945e443564029a495157fd2e72995.zip op-kernel-dev-ca572727dbb945e443564029a495157fd2e72995.tar.gz |
fs/: do not fallback to default_llseek() when readdir() uses BKL
Do not use the fallback default_llseek() if the readdir operation of the
filesystem still uses the big kernel lock.
Since llseek() modifies
file->f_pos of the directory directly it may need locking to not confuse
readdir which usually uses file->f_pos directly as well
Since the special characteristics of the BKL (unlocked on schedule) are
not necessary in this case, the inode mutex can be used for locking as
provided by generic_file_llseek(). This is only possible since all
filesystems, except reiserfs, either use a directory as a flat file or
with disk address offsets. Reiserfs on the other hand uses a 32bit hash
off the filename as the offset so generic_file_llseek() can get used as
well since the hash is always smaller than sb->s_maxbytes (= (512 << 32) -
blocksize).
Signed-off-by: Jan Blunck <jblunck@suse.de>
Acked-by: Jan Kara <jack@suse.cz>
Acked-by: Anders Larsen <al@alarsen.net>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/reiserfs/dir.c')
-rw-r--r-- | fs/reiserfs/dir.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/reiserfs/dir.c b/fs/reiserfs/dir.c index 0793044..4455fbe 100644 --- a/fs/reiserfs/dir.c +++ b/fs/reiserfs/dir.c @@ -18,6 +18,7 @@ static int reiserfs_dir_fsync(struct file *filp, struct dentry *dentry, int datasync); const struct file_operations reiserfs_dir_operations = { + .llseek = generic_file_llseek, .read = generic_read_dir, .readdir = reiserfs_readdir, .fsync = reiserfs_dir_fsync, |