From 8f5934278d1d86590244c2791b28f77d67466007 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Mon, 19 May 2008 19:53:01 -0700 Subject: Replace BKL with superblock lock in fat/msdos/vfat This replaces the use of the BKL in the FAT family of filesystems with the existing superblock lock instead. The code already appears to do mostly proper locking with its own private spinlocks (and mutexes), but while the BKL could possibly have been dropped entirely, converting it to use the superblock lock (which is just a regular mutex) is the conservative thing to do. As a per-filesystem mutex, it not only won't have any of the possible latency issues related to the BKL, but the lock is obviously private to the particular filesystem instance and will thus not cause problems for entirely unrelated users like the BKL can. Signed-off-by: Linus Torvalds Cc: OGAWA Hirofumi Signed-off-by: Jonathan Corbet --- fs/fat/dir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fs/fat/dir.c') diff --git a/fs/fat/dir.c b/fs/fat/dir.c index 486725ee99a..34541d06e62 100644 --- a/fs/fat/dir.c +++ b/fs/fat/dir.c @@ -472,7 +472,7 @@ static int __fat_readdir(struct inode *inode, struct file *filp, void *dirent, loff_t cpos; int ret = 0; - lock_kernel(); + lock_super(sb); cpos = filp->f_pos; /* Fake . and .. for the root directory. */ @@ -654,7 +654,7 @@ FillFailed: if (unicode) __putname(unicode); out: - unlock_kernel(); + unlock_super(sb); return ret; } -- cgit v1.2.3