diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-06-09 09:34:18 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-06-09 09:34:18 -0400 |
commit | 8b512d9a88875affe584bb3d2a7a235f84343b9e (patch) | |
tree | 80c46a675aeffaedd8d18e2bb6361768f4f4845a | |
parent | 5528f911b4c43a5de5da34bcbd7e3f2a62503617 (diff) |
VFS: Remove dependency of ->umount_begin() call on MNT_FORCE
Allow filesystems to decide to perform pre-umount processing whether or not
MNT_FORCE is set.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | fs/9p/vfs_super.c | 7 | ||||
-rw-r--r-- | fs/cifs/cifsfs.c | 6 | ||||
-rw-r--r-- | fs/fuse/inode.c | 5 | ||||
-rw-r--r-- | fs/namespace.c | 4 | ||||
-rw-r--r-- | fs/nfs/inode.c | 14 | ||||
-rw-r--r-- | include/linux/fs.h | 2 |
6 files changed, 23 insertions, 15 deletions
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c index 61c599b4a1e3..00c1f6baf870 100644 --- a/fs/9p/vfs_super.c +++ b/fs/9p/vfs_super.c | |||
@@ -253,11 +253,12 @@ static int v9fs_show_options(struct seq_file *m, struct vfsmount *mnt) | |||
253 | } | 253 | } |
254 | 254 | ||
255 | static void | 255 | static void |
256 | v9fs_umount_begin(struct super_block *sb) | 256 | v9fs_umount_begin(struct vfsmount *vfsmnt, int flags) |
257 | { | 257 | { |
258 | struct v9fs_session_info *v9ses = sb->s_fs_info; | 258 | struct v9fs_session_info *v9ses = vfsmnt->mnt_sb->s_fs_info; |
259 | 259 | ||
260 | v9fs_session_cancel(v9ses); | 260 | if (flags & MNT_FORCE) |
261 | v9fs_session_cancel(v9ses); | ||
261 | } | 262 | } |
262 | 263 | ||
263 | static struct super_operations v9fs_super_ops = { | 264 | static struct super_operations v9fs_super_ops = { |
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index c262d8874ce9..3fdc2258f447 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -402,12 +402,14 @@ static struct quotactl_ops cifs_quotactl_ops = { | |||
402 | #endif | 402 | #endif |
403 | 403 | ||
404 | #ifdef CONFIG_CIFS_EXPERIMENTAL | 404 | #ifdef CONFIG_CIFS_EXPERIMENTAL |
405 | static void cifs_umount_begin(struct super_block * sblock) | 405 | static void cifs_umount_begin(struct vfsmount * vfsmnt, int flags) |
406 | { | 406 | { |
407 | struct cifs_sb_info *cifs_sb; | 407 | struct cifs_sb_info *cifs_sb; |
408 | struct cifsTconInfo * tcon; | 408 | struct cifsTconInfo * tcon; |
409 | 409 | ||
410 | cifs_sb = CIFS_SB(sblock); | 410 | if (!(flags & MNT_FORCE)) |
411 | return; | ||
412 | cifs_sb = CIFS_SB(vfsmnt->mnt_sb); | ||
411 | if(cifs_sb == NULL) | 413 | if(cifs_sb == NULL) |
412 | return; | 414 | return; |
413 | 415 | ||
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 7627022446b2..13ebe5780c93 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c | |||
@@ -195,9 +195,10 @@ struct inode *fuse_iget(struct super_block *sb, unsigned long nodeid, | |||
195 | return inode; | 195 | return inode; |
196 | } | 196 | } |
197 | 197 | ||
198 | static void fuse_umount_begin(struct super_block *sb) | 198 | static void fuse_umount_begin(struct vfsmount *vfsmnt, int flags) |
199 | { | 199 | { |
200 | fuse_abort_conn(get_fuse_conn_super(sb)); | 200 | if (flags & MNT_FORCE) |
201 | fuse_abort_conn(get_fuse_conn_super(vfsmnt->mnt_sb)); | ||
201 | } | 202 | } |
202 | 203 | ||
203 | static void fuse_put_super(struct super_block *sb) | 204 | static void fuse_put_super(struct super_block *sb) |
diff --git a/fs/namespace.c b/fs/namespace.c index b22e469ab560..6bb0b85293e7 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -576,8 +576,8 @@ static int do_umount(struct vfsmount *mnt, int flags) | |||
576 | */ | 576 | */ |
577 | 577 | ||
578 | lock_kernel(); | 578 | lock_kernel(); |
579 | if ((flags & MNT_FORCE) && sb->s_op->umount_begin) | 579 | if (sb->s_op->umount_begin) |
580 | sb->s_op->umount_begin(sb); | 580 | sb->s_op->umount_begin(mnt, flags); |
581 | unlock_kernel(); | 581 | unlock_kernel(); |
582 | 582 | ||
583 | /* | 583 | /* |
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 9ff039f9a836..fda2b4966179 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -63,7 +63,7 @@ static struct inode *nfs_alloc_inode(struct super_block *sb); | |||
63 | static void nfs_destroy_inode(struct inode *); | 63 | static void nfs_destroy_inode(struct inode *); |
64 | static int nfs_write_inode(struct inode *,int); | 64 | static int nfs_write_inode(struct inode *,int); |
65 | static void nfs_clear_inode(struct inode *); | 65 | static void nfs_clear_inode(struct inode *); |
66 | static void nfs_umount_begin(struct super_block *); | 66 | static void nfs_umount_begin(struct vfsmount *, int); |
67 | static int nfs_statfs(struct super_block *, struct kstatfs *); | 67 | static int nfs_statfs(struct super_block *, struct kstatfs *); |
68 | static int nfs_show_options(struct seq_file *, struct vfsmount *); | 68 | static int nfs_show_options(struct seq_file *, struct vfsmount *); |
69 | static int nfs_show_stats(struct seq_file *, struct vfsmount *); | 69 | static int nfs_show_stats(struct seq_file *, struct vfsmount *); |
@@ -162,15 +162,19 @@ nfs_clear_inode(struct inode *inode) | |||
162 | BUG_ON(atomic_read(&nfsi->data_updates) != 0); | 162 | BUG_ON(atomic_read(&nfsi->data_updates) != 0); |
163 | } | 163 | } |
164 | 164 | ||
165 | void | 165 | static void nfs_umount_begin(struct vfsmount *vfsmnt, int flags) |
166 | nfs_umount_begin(struct super_block *sb) | ||
167 | { | 166 | { |
168 | struct rpc_clnt *rpc = NFS_SB(sb)->client; | 167 | struct nfs_server *server; |
168 | struct rpc_clnt *rpc; | ||
169 | 169 | ||
170 | if (!(flags & MNT_FORCE)) | ||
171 | return; | ||
170 | /* -EIO all pending I/O */ | 172 | /* -EIO all pending I/O */ |
173 | server = NFS_SB(vfsmnt->mnt_sb); | ||
174 | rpc = server->client; | ||
171 | if (!IS_ERR(rpc)) | 175 | if (!IS_ERR(rpc)) |
172 | rpc_killall_tasks(rpc); | 176 | rpc_killall_tasks(rpc); |
173 | rpc = NFS_SB(sb)->client_acl; | 177 | rpc = server->client_acl; |
174 | if (!IS_ERR(rpc)) | 178 | if (!IS_ERR(rpc)) |
175 | rpc_killall_tasks(rpc); | 179 | rpc_killall_tasks(rpc); |
176 | } | 180 | } |
diff --git a/include/linux/fs.h b/include/linux/fs.h index eca70cfe5b85..1d80ba747484 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1101,7 +1101,7 @@ struct super_operations { | |||
1101 | int (*statfs) (struct super_block *, struct kstatfs *); | 1101 | int (*statfs) (struct super_block *, struct kstatfs *); |
1102 | int (*remount_fs) (struct super_block *, int *, char *); | 1102 | int (*remount_fs) (struct super_block *, int *, char *); |
1103 | void (*clear_inode) (struct inode *); | 1103 | void (*clear_inode) (struct inode *); |
1104 | void (*umount_begin) (struct super_block *); | 1104 | void (*umount_begin) (struct vfsmount *, int); |
1105 | 1105 | ||
1106 | int (*show_options)(struct seq_file *, struct vfsmount *); | 1106 | int (*show_options)(struct seq_file *, struct vfsmount *); |
1107 | int (*show_stats)(struct seq_file *, struct vfsmount *); | 1107 | int (*show_stats)(struct seq_file *, struct vfsmount *); |