diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-09-17 10:56:51 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-09-17 10:56:51 -0400 |
commit | 2b484297e48c3fbb1846fc6ea10036d9465273e7 (patch) | |
tree | bfd8f5cfba73b597d5277ba48e02fd2c13ece9b3 /fs | |
parent | c0204fd2b8fe047b18b67e07e1bf2a03691240cd (diff) |
NFS: Add an 'open_context' element to struct nfs_rpc_ops
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/dir.c | 7 | ||||
-rw-r--r-- | fs/nfs/nfs4_fs.h | 1 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 3 |
3 files changed, 6 insertions, 5 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index e37ffddd79c2..1e9e18813ad7 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -34,7 +34,6 @@ | |||
34 | #include <linux/mount.h> | 34 | #include <linux/mount.h> |
35 | #include <linux/sched.h> | 35 | #include <linux/sched.h> |
36 | 36 | ||
37 | #include "nfs4_fs.h" | ||
38 | #include "delegation.h" | 37 | #include "delegation.h" |
39 | #include "iostat.h" | 38 | #include "iostat.h" |
40 | #include "internal.h" | 39 | #include "internal.h" |
@@ -1127,7 +1126,7 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry | |||
1127 | 1126 | ||
1128 | /* Open the file on the server */ | 1127 | /* Open the file on the server */ |
1129 | nfs_block_sillyrename(dentry->d_parent); | 1128 | nfs_block_sillyrename(dentry->d_parent); |
1130 | inode = nfs4_atomic_open(dir, ctx, open_flags, &attr); | 1129 | inode = NFS_PROTO(dir)->open_context(dir, ctx, open_flags, &attr); |
1131 | if (IS_ERR(inode)) { | 1130 | if (IS_ERR(inode)) { |
1132 | nfs_unblock_sillyrename(dentry->d_parent); | 1131 | nfs_unblock_sillyrename(dentry->d_parent); |
1133 | put_nfs_open_context(ctx); | 1132 | put_nfs_open_context(ctx); |
@@ -1175,8 +1174,10 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd) | |||
1175 | 1174 | ||
1176 | if (!is_atomic_open(nd) || d_mountpoint(dentry)) | 1175 | if (!is_atomic_open(nd) || d_mountpoint(dentry)) |
1177 | goto no_open; | 1176 | goto no_open; |
1177 | |||
1178 | parent = dget_parent(dentry); | 1178 | parent = dget_parent(dentry); |
1179 | dir = parent->d_inode; | 1179 | dir = parent->d_inode; |
1180 | |||
1180 | /* We can't create new files in nfs_open_revalidate(), so we | 1181 | /* We can't create new files in nfs_open_revalidate(), so we |
1181 | * optimize away revalidation of negative dentries. | 1182 | * optimize away revalidation of negative dentries. |
1182 | */ | 1183 | */ |
@@ -1205,7 +1206,7 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd) | |||
1205 | * operations that change the directory. We therefore save the | 1206 | * operations that change the directory. We therefore save the |
1206 | * change attribute *before* we do the RPC call. | 1207 | * change attribute *before* we do the RPC call. |
1207 | */ | 1208 | */ |
1208 | inode = nfs4_atomic_open(dir, ctx, openflags, NULL); | 1209 | inode = NFS_PROTO(dir)->open_context(dir, ctx, openflags, NULL); |
1209 | if (IS_ERR(inode)) { | 1210 | if (IS_ERR(inode)) { |
1210 | ret = PTR_ERR(inode); | 1211 | ret = PTR_ERR(inode); |
1211 | switch (ret) { | 1212 | switch (ret) { |
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h index 6cf12ba9f4e7..d24a8e07b5e2 100644 --- a/fs/nfs/nfs4_fs.h +++ b/fs/nfs/nfs4_fs.h | |||
@@ -242,7 +242,6 @@ extern int nfs4_proc_renew(struct nfs_client *, struct rpc_cred *); | |||
242 | extern int nfs4_init_clientid(struct nfs_client *, struct rpc_cred *); | 242 | extern int nfs4_init_clientid(struct nfs_client *, struct rpc_cred *); |
243 | extern int nfs41_init_clientid(struct nfs_client *, struct rpc_cred *); | 243 | extern int nfs41_init_clientid(struct nfs_client *, struct rpc_cred *); |
244 | extern int nfs4_do_close(struct path *path, struct nfs4_state *state, gfp_t gfp_mask, int wait); | 244 | extern int nfs4_do_close(struct path *path, struct nfs4_state *state, gfp_t gfp_mask, int wait); |
245 | extern struct inode *nfs4_atomic_open(struct inode *, struct nfs_open_context *, int, struct iattr *); | ||
246 | extern int nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle); | 245 | extern int nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle); |
247 | extern int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name, | 246 | extern int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name, |
248 | struct nfs4_fs_locations *fs_locations, struct page *page); | 247 | struct nfs4_fs_locations *fs_locations, struct page *page); |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 617b149ee16d..643abd26f2de 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -1998,7 +1998,7 @@ out: | |||
1998 | return status; | 1998 | return status; |
1999 | } | 1999 | } |
2000 | 2000 | ||
2001 | struct inode * | 2001 | static struct inode * |
2002 | nfs4_atomic_open(struct inode *dir, struct nfs_open_context *ctx, int open_flags, struct iattr *attr) | 2002 | nfs4_atomic_open(struct inode *dir, struct nfs_open_context *ctx, int open_flags, struct iattr *attr) |
2003 | { | 2003 | { |
2004 | struct nfs4_state *state; | 2004 | struct nfs4_state *state; |
@@ -5358,6 +5358,7 @@ const struct nfs_rpc_ops nfs_v4_clientops = { | |||
5358 | .lock = nfs4_proc_lock, | 5358 | .lock = nfs4_proc_lock, |
5359 | .clear_acl_cache = nfs4_zap_acl_attr, | 5359 | .clear_acl_cache = nfs4_zap_acl_attr, |
5360 | .close_context = nfs4_close_context, | 5360 | .close_context = nfs4_close_context, |
5361 | .open_context = nfs4_atomic_open, | ||
5361 | }; | 5362 | }; |
5362 | 5363 | ||
5363 | /* | 5364 | /* |