diff options
author | Christoph Hellwig <hch@infradead.org> | 2007-06-28 02:46:47 -0400 |
---|---|---|
committer | Tim Shimmin <tes@chook.melbourne.sgi.com> | 2007-07-14 01:37:37 -0400 |
commit | fbf3ce8d8ec508f6bd99b36de034d2ae3e1ae7ac (patch) | |
tree | 5b10e8948c422b85f7e19da711d2b4d5c9b5e244 /fs/xfs/linux-2.6 | |
parent | 16a087d8e1af9b974125870dceb9e4a35249ad1d (diff) |
[XFS] XFS should not be looking at filp reference counts
A check for file_count is always a bad idea. Linux has the ->release
method to deal with cleanups on last close and ->flush is only for the
very rare case where we want to perform an operation on every drop of a
reference to a file struct.
This patch gets rid of vop_close and surrounding code in favour of simply
doing the page flushing from ->release.
SGI-PV: 966562
SGI-Modid: xfs-linux-melb:xfs-kern:28952a
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_file.c | 11 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_vnode.h | 5 |
2 files changed, 0 insertions, 16 deletions
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c index 8c43cd2e237a..cbcd40c8c2a0 100644 --- a/fs/xfs/linux-2.6/xfs_file.c +++ b/fs/xfs/linux-2.6/xfs_file.c | |||
@@ -184,15 +184,6 @@ xfs_file_open( | |||
184 | } | 184 | } |
185 | 185 | ||
186 | STATIC int | 186 | STATIC int |
187 | xfs_file_close( | ||
188 | struct file *filp, | ||
189 | fl_owner_t id) | ||
190 | { | ||
191 | return -bhv_vop_close(vn_from_inode(filp->f_path.dentry->d_inode), 0, | ||
192 | file_count(filp) > 1 ? L_FALSE : L_TRUE, NULL); | ||
193 | } | ||
194 | |||
195 | STATIC int | ||
196 | xfs_file_release( | 187 | xfs_file_release( |
197 | struct inode *inode, | 188 | struct inode *inode, |
198 | struct file *filp) | 189 | struct file *filp) |
@@ -436,7 +427,6 @@ const struct file_operations xfs_file_operations = { | |||
436 | #endif | 427 | #endif |
437 | .mmap = xfs_file_mmap, | 428 | .mmap = xfs_file_mmap, |
438 | .open = xfs_file_open, | 429 | .open = xfs_file_open, |
439 | .flush = xfs_file_close, | ||
440 | .release = xfs_file_release, | 430 | .release = xfs_file_release, |
441 | .fsync = xfs_file_fsync, | 431 | .fsync = xfs_file_fsync, |
442 | #ifdef HAVE_FOP_OPEN_EXEC | 432 | #ifdef HAVE_FOP_OPEN_EXEC |
@@ -458,7 +448,6 @@ const struct file_operations xfs_invis_file_operations = { | |||
458 | #endif | 448 | #endif |
459 | .mmap = xfs_file_mmap, | 449 | .mmap = xfs_file_mmap, |
460 | .open = xfs_file_open, | 450 | .open = xfs_file_open, |
461 | .flush = xfs_file_close, | ||
462 | .release = xfs_file_release, | 451 | .release = xfs_file_release, |
463 | .fsync = xfs_file_fsync, | 452 | .fsync = xfs_file_fsync, |
464 | }; | 453 | }; |
diff --git a/fs/xfs/linux-2.6/xfs_vnode.h b/fs/xfs/linux-2.6/xfs_vnode.h index 013048a92643..5742d65f0785 100644 --- a/fs/xfs/linux-2.6/xfs_vnode.h +++ b/fs/xfs/linux-2.6/xfs_vnode.h | |||
@@ -129,10 +129,7 @@ typedef enum bhv_vchange { | |||
129 | VCHANGE_FLAGS_IOEXCL_COUNT = 4 | 129 | VCHANGE_FLAGS_IOEXCL_COUNT = 4 |
130 | } bhv_vchange_t; | 130 | } bhv_vchange_t; |
131 | 131 | ||
132 | typedef enum { L_FALSE, L_TRUE } lastclose_t; | ||
133 | |||
134 | typedef int (*vop_open_t)(bhv_desc_t *, struct cred *); | 132 | typedef int (*vop_open_t)(bhv_desc_t *, struct cred *); |
135 | typedef int (*vop_close_t)(bhv_desc_t *, int, lastclose_t, struct cred *); | ||
136 | typedef ssize_t (*vop_read_t)(bhv_desc_t *, struct kiocb *, | 133 | typedef ssize_t (*vop_read_t)(bhv_desc_t *, struct kiocb *, |
137 | const struct iovec *, unsigned int, | 134 | const struct iovec *, unsigned int, |
138 | loff_t *, int, struct cred *); | 135 | loff_t *, int, struct cred *); |
@@ -200,7 +197,6 @@ typedef int (*vop_iflush_t)(bhv_desc_t *, int); | |||
200 | typedef struct bhv_vnodeops { | 197 | typedef struct bhv_vnodeops { |
201 | bhv_position_t vn_position; /* position within behavior chain */ | 198 | bhv_position_t vn_position; /* position within behavior chain */ |
202 | vop_open_t vop_open; | 199 | vop_open_t vop_open; |
203 | vop_close_t vop_close; | ||
204 | vop_read_t vop_read; | 200 | vop_read_t vop_read; |
205 | vop_write_t vop_write; | 201 | vop_write_t vop_write; |
206 | vop_splice_read_t vop_splice_read; | 202 | vop_splice_read_t vop_splice_read; |
@@ -245,7 +241,6 @@ typedef struct bhv_vnodeops { | |||
245 | #define VNHEAD(vp) ((vp)->v_bh.bh_first) | 241 | #define VNHEAD(vp) ((vp)->v_bh.bh_first) |
246 | #define VOP(op, vp) (*((bhv_vnodeops_t *)VNHEAD(vp)->bd_ops)->op) | 242 | #define VOP(op, vp) (*((bhv_vnodeops_t *)VNHEAD(vp)->bd_ops)->op) |
247 | #define bhv_vop_open(vp, cr) VOP(vop_open, vp)(VNHEAD(vp),cr) | 243 | #define bhv_vop_open(vp, cr) VOP(vop_open, vp)(VNHEAD(vp),cr) |
248 | #define bhv_vop_close(vp, f,last,cr) VOP(vop_close, vp)(VNHEAD(vp),f,last,cr) | ||
249 | #define bhv_vop_read(vp,file,iov,segs,offset,ioflags,cr) \ | 244 | #define bhv_vop_read(vp,file,iov,segs,offset,ioflags,cr) \ |
250 | VOP(vop_read, vp)(VNHEAD(vp),file,iov,segs,offset,ioflags,cr) | 245 | VOP(vop_read, vp)(VNHEAD(vp),file,iov,segs,offset,ioflags,cr) |
251 | #define bhv_vop_write(vp,file,iov,segs,offset,ioflags,cr) \ | 246 | #define bhv_vop_write(vp,file,iov,segs,offset,ioflags,cr) \ |