diff options
author | Arnd Bergmann <arnd@arndb.de> | 2010-10-21 09:58:01 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2010-10-21 12:48:09 -0400 |
commit | 6d7bccc2215c37205ede6c9cf84db64e7c4f9443 (patch) | |
tree | 04864624eb5022eac6eec81d264b83e28fad2863 /fs/freevxfs/vxfs_lookup.c | |
parent | 073c21416268658bd1bc573af85eeac2ebb56ed5 (diff) |
BKL: remove BKL from freevxfs
All uses of the BKL in freevxfs were the result of a pushdown into
code that doesn't really need it. As Christoph points out, this
is a read-only file system, which eliminates most of the races in
readdir/lookup.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Christoph Hellwig <hch@infradead.org>
Diffstat (limited to 'fs/freevxfs/vxfs_lookup.c')
-rw-r--r-- | fs/freevxfs/vxfs_lookup.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/fs/freevxfs/vxfs_lookup.c b/fs/freevxfs/vxfs_lookup.c index 0ec7bb2c95c6..6c5131d592f0 100644 --- a/fs/freevxfs/vxfs_lookup.c +++ b/fs/freevxfs/vxfs_lookup.c | |||
@@ -36,7 +36,6 @@ | |||
36 | #include <linux/highmem.h> | 36 | #include <linux/highmem.h> |
37 | #include <linux/kernel.h> | 37 | #include <linux/kernel.h> |
38 | #include <linux/pagemap.h> | 38 | #include <linux/pagemap.h> |
39 | #include <linux/smp_lock.h> | ||
40 | 39 | ||
41 | #include "vxfs.h" | 40 | #include "vxfs.h" |
42 | #include "vxfs_dir.h" | 41 | #include "vxfs_dir.h" |
@@ -212,16 +211,12 @@ vxfs_lookup(struct inode *dip, struct dentry *dp, struct nameidata *nd) | |||
212 | if (dp->d_name.len > VXFS_NAMELEN) | 211 | if (dp->d_name.len > VXFS_NAMELEN) |
213 | return ERR_PTR(-ENAMETOOLONG); | 212 | return ERR_PTR(-ENAMETOOLONG); |
214 | 213 | ||
215 | lock_kernel(); | ||
216 | ino = vxfs_inode_by_name(dip, dp); | 214 | ino = vxfs_inode_by_name(dip, dp); |
217 | if (ino) { | 215 | if (ino) { |
218 | ip = vxfs_iget(dip->i_sb, ino); | 216 | ip = vxfs_iget(dip->i_sb, ino); |
219 | if (IS_ERR(ip)) { | 217 | if (IS_ERR(ip)) |
220 | unlock_kernel(); | ||
221 | return ERR_CAST(ip); | 218 | return ERR_CAST(ip); |
222 | } | ||
223 | } | 219 | } |
224 | unlock_kernel(); | ||
225 | d_add(dp, ip); | 220 | d_add(dp, ip); |
226 | return NULL; | 221 | return NULL; |
227 | } | 222 | } |
@@ -248,8 +243,6 @@ vxfs_readdir(struct file *fp, void *retp, filldir_t filler) | |||
248 | u_long page, npages, block, pblocks, nblocks, offset; | 243 | u_long page, npages, block, pblocks, nblocks, offset; |
249 | loff_t pos; | 244 | loff_t pos; |
250 | 245 | ||
251 | lock_kernel(); | ||
252 | |||
253 | switch ((long)fp->f_pos) { | 246 | switch ((long)fp->f_pos) { |
254 | case 0: | 247 | case 0: |
255 | if (filler(retp, ".", 1, fp->f_pos, ip->i_ino, DT_DIR) < 0) | 248 | if (filler(retp, ".", 1, fp->f_pos, ip->i_ino, DT_DIR) < 0) |
@@ -265,10 +258,8 @@ vxfs_readdir(struct file *fp, void *retp, filldir_t filler) | |||
265 | 258 | ||
266 | pos = fp->f_pos - 2; | 259 | pos = fp->f_pos - 2; |
267 | 260 | ||
268 | if (pos > VXFS_DIRROUND(ip->i_size)) { | 261 | if (pos > VXFS_DIRROUND(ip->i_size)) |
269 | unlock_kernel(); | ||
270 | return 0; | 262 | return 0; |
271 | } | ||
272 | 263 | ||
273 | npages = dir_pages(ip); | 264 | npages = dir_pages(ip); |
274 | nblocks = dir_blocks(ip); | 265 | nblocks = dir_blocks(ip); |
@@ -327,6 +318,5 @@ vxfs_readdir(struct file *fp, void *retp, filldir_t filler) | |||
327 | done: | 318 | done: |
328 | fp->f_pos = ((page << PAGE_CACHE_SHIFT) | offset) + 2; | 319 | fp->f_pos = ((page << PAGE_CACHE_SHIFT) | offset) + 2; |
329 | out: | 320 | out: |
330 | unlock_kernel(); | ||
331 | return 0; | 321 | return 0; |
332 | } | 322 | } |