From 2f07a88b30f510c7625d75cdf286903b465350a0 Mon Sep 17 00:00:00 2001 From: John Kacur Date: Wed, 5 May 2010 15:15:39 +0200 Subject: udf: BKL ioctl pushdown Convert udf_ioctl to an unlocked_ioctl and push the BKL down into it. Signed-off-by: John Kacur --- fs/udf/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/udf/dir.c') diff --git a/fs/udf/dir.c b/fs/udf/dir.c index f0f2a436251e..3a84455c2a77 100644 --- a/fs/udf/dir.c +++ b/fs/udf/dir.c @@ -209,6 +209,6 @@ static int udf_readdir(struct file *filp, void *dirent, filldir_t filldir) const struct file_operations udf_dir_operations = { .read = generic_read_dir, .readdir = udf_readdir, - .ioctl = udf_ioctl, + .unlocked_ioctl = udf_ioctl, .fsync = simple_fsync, }; -- cgit v1.2.3 From ca572727dbb945e443564029a495157fd2e72995 Mon Sep 17 00:00:00 2001 From: jan Blunck Date: Wed, 26 May 2010 14:44:53 -0700 Subject: 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 Acked-by: Jan Kara Acked-by: Anders Larsen Cc: Frederic Weisbecker Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/udf/dir.c | 1 + 1 file changed, 1 insertion(+) (limited to 'fs/udf/dir.c') diff --git a/fs/udf/dir.c b/fs/udf/dir.c index 3a84455c2a77..1660c81ffa3d 100644 --- a/fs/udf/dir.c +++ b/fs/udf/dir.c @@ -207,6 +207,7 @@ static int udf_readdir(struct file *filp, void *dirent, filldir_t filldir) /* readdir and lookup functions */ const struct file_operations udf_dir_operations = { + .llseek = generic_file_llseek, .read = generic_read_dir, .readdir = udf_readdir, .unlocked_ioctl = udf_ioctl, -- cgit v1.2.3 From 1b061d9247f71cd15edc4c4c4600191a903642c0 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 26 May 2010 17:53:41 +0200 Subject: rename the generic fsync implementations We don't name our generic fsync implementations very well currently. The no-op implementation for in-memory filesystems currently is called simple_sync_file which doesn't make too much sense to start with, the the generic one for simple filesystems is called simple_fsync which can lead to some confusion. This patch renames the generic file fsync method to generic_file_fsync to match the other generic_file_* routines it is supposed to be used with, and the no-op implementation to noop_fsync to make it obvious what to expect. In addition add some documentation for both methods. Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro --- fs/udf/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/udf/dir.c') diff --git a/fs/udf/dir.c b/fs/udf/dir.c index 1660c81ffa3d..51552bf50225 100644 --- a/fs/udf/dir.c +++ b/fs/udf/dir.c @@ -211,5 +211,5 @@ const struct file_operations udf_dir_operations = { .read = generic_read_dir, .readdir = udf_readdir, .unlocked_ioctl = udf_ioctl, - .fsync = simple_fsync, + .fsync = generic_file_fsync, }; -- cgit v1.2.3