aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_vnodeops.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2008-11-27 22:23:32 -0500
committerNiv Sardi <xaiki@sgi.com>2008-11-30 19:07:08 -0500
commitf999a5bf3fa6b3d11334c3ba1e9dcfed5ff9f8a6 (patch)
tree6ee512a3e292b13dca507cc1bc1528cded8b5abe /fs/xfs/xfs_vnodeops.c
parentbac8dca9f9b1dfcf9c4ecb4f9ca17185b828cc20 (diff)
[XFS] wire up ->open for directories
Currently there's no ->open method set for directories on XFS. That means we don't perform any check for opening too large directories without O_LARGEFILE, we don't check for shut down filesystems, and we don't actually do the readahead for the first block in the directory. Instead of just setting the directories open routine to xfs_file_open we merge the shutdown check directly into xfs_file_open and create a new xfs_dir_open that first calls xfs_file_open and then performs the readahead for block 0. (First sent on September 29th) Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <david@fromorbit.com> Signed-off-by: Niv Sardi <xaiki@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r--fs/xfs/xfs_vnodeops.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index 0574aadc4d3c..c055bdb11cb7 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -54,28 +54,6 @@
54#include "xfs_vnodeops.h" 54#include "xfs_vnodeops.h"
55 55
56int 56int
57xfs_open(
58 xfs_inode_t *ip)
59{
60 int mode;
61
62 if (XFS_FORCED_SHUTDOWN(ip->i_mount))
63 return XFS_ERROR(EIO);
64
65 /*
66 * If it's a directory with any blocks, read-ahead block 0
67 * as we're almost certain to have the next operation be a read there.
68 */
69 if (S_ISDIR(ip->i_d.di_mode) && ip->i_d.di_nextents > 0) {
70 mode = xfs_ilock_map_shared(ip);
71 if (ip->i_d.di_nextents > 0)
72 (void)xfs_da_reada_buf(NULL, ip, 0, XFS_DATA_FORK);
73 xfs_iunlock(ip, mode);
74 }
75 return 0;
76}
77
78int
79xfs_setattr( 57xfs_setattr(
80 struct xfs_inode *ip, 58 struct xfs_inode *ip,
81 struct iattr *iattr, 59 struct iattr *iattr,