]> git.baikalelectronics.ru Git - kernel.git/commit
fs/: do not fallback to default_llseek() when readdir() uses BKL
authorjan Blunck <jblunck@suse.de>
Wed, 26 May 2010 21:44:53 +0000 (14:44 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 27 May 2010 16:12:56 +0000 (09:12 -0700)
commitcb583829499a0499b5204db748ce36ee350a4d29
tree10486033a428e9389e32cbc78c0da34c644640a1
parent5da46b0198f73272ac2c1ba69940c9972b6ca95c
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>
fs/autofs/root.c
fs/freevxfs/vxfs_lookup.c
fs/isofs/dir.c
fs/ncpfs/dir.c
fs/qnx4/dir.c
fs/reiserfs/dir.c
fs/smbfs/dir.c
fs/udf/dir.c