aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 627f37c44456..98e533f2c94a 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -293,7 +293,7 @@ static void nfs4_setup_readdir(u64 cookie, __be32 *verifier, struct dentry *dent
293 *p++ = xdr_one; /* bitmap length */ 293 *p++ = xdr_one; /* bitmap length */
294 *p++ = htonl(FATTR4_WORD0_FILEID); /* bitmap */ 294 *p++ = htonl(FATTR4_WORD0_FILEID); /* bitmap */
295 *p++ = htonl(8); /* attribute buffer length */ 295 *p++ = htonl(8); /* attribute buffer length */
296 p = xdr_encode_hyper(p, NFS_FILEID(dentry->d_inode)); 296 p = xdr_encode_hyper(p, NFS_FILEID(d_inode(dentry)));
297 } 297 }
298 298
299 *p++ = xdr_one; /* next */ 299 *p++ = xdr_one; /* next */
@@ -305,7 +305,7 @@ static void nfs4_setup_readdir(u64 cookie, __be32 *verifier, struct dentry *dent
305 *p++ = xdr_one; /* bitmap length */ 305 *p++ = xdr_one; /* bitmap length */
306 *p++ = htonl(FATTR4_WORD0_FILEID); /* bitmap */ 306 *p++ = htonl(FATTR4_WORD0_FILEID); /* bitmap */
307 *p++ = htonl(8); /* attribute buffer length */ 307 *p++ = htonl(8); /* attribute buffer length */
308 p = xdr_encode_hyper(p, NFS_FILEID(dentry->d_parent->d_inode)); 308 p = xdr_encode_hyper(p, NFS_FILEID(d_inode(dentry->d_parent)));
309 309
310 readdir->pgbase = (char *)p - (char *)start; 310 readdir->pgbase = (char *)p - (char *)start;
311 readdir->count -= readdir->pgbase; 311 readdir->count -= readdir->pgbase;
@@ -1004,7 +1004,7 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct dentry *dentry,
1004 gfp_t gfp_mask) 1004 gfp_t gfp_mask)
1005{ 1005{
1006 struct dentry *parent = dget_parent(dentry); 1006 struct dentry *parent = dget_parent(dentry);
1007 struct inode *dir = parent->d_inode; 1007 struct inode *dir = d_inode(parent);
1008 struct nfs_server *server = NFS_SERVER(dir); 1008 struct nfs_server *server = NFS_SERVER(dir);
1009 struct nfs_seqid *(*alloc_seqid)(struct nfs_seqid_counter *, gfp_t); 1009 struct nfs_seqid *(*alloc_seqid)(struct nfs_seqid_counter *, gfp_t);
1010 struct nfs4_opendata *p; 1010 struct nfs4_opendata *p;
@@ -1057,7 +1057,7 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct dentry *dentry,
1057 case NFS4_OPEN_CLAIM_FH: 1057 case NFS4_OPEN_CLAIM_FH:
1058 case NFS4_OPEN_CLAIM_DELEG_CUR_FH: 1058 case NFS4_OPEN_CLAIM_DELEG_CUR_FH:
1059 case NFS4_OPEN_CLAIM_DELEG_PREV_FH: 1059 case NFS4_OPEN_CLAIM_DELEG_PREV_FH:
1060 p->o_arg.fh = NFS_FH(dentry->d_inode); 1060 p->o_arg.fh = NFS_FH(d_inode(dentry));
1061 } 1061 }
1062 if (attrs != NULL && attrs->ia_valid != 0) { 1062 if (attrs != NULL && attrs->ia_valid != 0) {
1063 __u32 verf[2]; 1063 __u32 verf[2];
@@ -1794,7 +1794,7 @@ static const struct rpc_call_ops nfs4_open_confirm_ops = {
1794 */ 1794 */
1795static int _nfs4_proc_open_confirm(struct nfs4_opendata *data) 1795static int _nfs4_proc_open_confirm(struct nfs4_opendata *data)
1796{ 1796{
1797 struct nfs_server *server = NFS_SERVER(data->dir->d_inode); 1797 struct nfs_server *server = NFS_SERVER(d_inode(data->dir));
1798 struct rpc_task *task; 1798 struct rpc_task *task;
1799 struct rpc_message msg = { 1799 struct rpc_message msg = {
1800 .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_OPEN_CONFIRM], 1800 .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_OPEN_CONFIRM],
@@ -1951,7 +1951,7 @@ static const struct rpc_call_ops nfs4_open_ops = {
1951 1951
1952static int nfs4_run_open_task(struct nfs4_opendata *data, int isrecover) 1952static int nfs4_run_open_task(struct nfs4_opendata *data, int isrecover)
1953{ 1953{
1954 struct inode *dir = data->dir->d_inode; 1954 struct inode *dir = d_inode(data->dir);
1955 struct nfs_server *server = NFS_SERVER(dir); 1955 struct nfs_server *server = NFS_SERVER(dir);
1956 struct nfs_openargs *o_arg = &data->o_arg; 1956 struct nfs_openargs *o_arg = &data->o_arg;
1957 struct nfs_openres *o_res = &data->o_res; 1957 struct nfs_openres *o_res = &data->o_res;
@@ -1998,7 +1998,7 @@ static int nfs4_run_open_task(struct nfs4_opendata *data, int isrecover)
1998 1998
1999static int _nfs4_recover_proc_open(struct nfs4_opendata *data) 1999static int _nfs4_recover_proc_open(struct nfs4_opendata *data)
2000{ 2000{
2001 struct inode *dir = data->dir->d_inode; 2001 struct inode *dir = d_inode(data->dir);
2002 struct nfs_openres *o_res = &data->o_res; 2002 struct nfs_openres *o_res = &data->o_res;
2003 int status; 2003 int status;
2004 2004
@@ -2067,7 +2067,7 @@ static int nfs4_opendata_access(struct rpc_cred *cred,
2067 */ 2067 */
2068static int _nfs4_proc_open(struct nfs4_opendata *data) 2068static int _nfs4_proc_open(struct nfs4_opendata *data)
2069{ 2069{
2070 struct inode *dir = data->dir->d_inode; 2070 struct inode *dir = d_inode(data->dir);
2071 struct nfs_server *server = NFS_SERVER(dir); 2071 struct nfs_server *server = NFS_SERVER(dir);
2072 struct nfs_openargs *o_arg = &data->o_arg; 2072 struct nfs_openargs *o_arg = &data->o_arg;
2073 struct nfs_openres *o_res = &data->o_res; 2073 struct nfs_openres *o_res = &data->o_res;
@@ -2314,7 +2314,7 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata,
2314 set_bit(NFS_STATE_POSIX_LOCKS, &state->flags); 2314 set_bit(NFS_STATE_POSIX_LOCKS, &state->flags);
2315 2315
2316 dentry = opendata->dentry; 2316 dentry = opendata->dentry;
2317 if (dentry->d_inode == NULL) { 2317 if (d_really_is_negative(dentry)) {
2318 /* FIXME: Is this d_drop() ever needed? */ 2318 /* FIXME: Is this d_drop() ever needed? */
2319 d_drop(dentry); 2319 d_drop(dentry);
2320 dentry = d_add_unique(dentry, igrab(state->inode)); 2320 dentry = d_add_unique(dentry, igrab(state->inode));
@@ -2325,7 +2325,7 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata,
2325 ctx->dentry = dget(dentry); 2325 ctx->dentry = dget(dentry);
2326 } 2326 }
2327 nfs_set_verifier(dentry, 2327 nfs_set_verifier(dentry,
2328 nfs_save_change_attribute(opendata->dir->d_inode)); 2328 nfs_save_change_attribute(d_inode(opendata->dir)));
2329 } 2329 }
2330 2330
2331 ret = nfs4_opendata_access(sp->so_cred, opendata, state, fmode, flags); 2331 ret = nfs4_opendata_access(sp->so_cred, opendata, state, fmode, flags);
@@ -2333,7 +2333,7 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata,
2333 goto out; 2333 goto out;
2334 2334
2335 ctx->state = state; 2335 ctx->state = state;
2336 if (dentry->d_inode == state->inode) { 2336 if (d_inode(dentry) == state->inode) {
2337 nfs_inode_attach_open_context(ctx); 2337 nfs_inode_attach_open_context(ctx);
2338 if (read_seqcount_retry(&sp->so_reclaim_seqcount, seq)) 2338 if (read_seqcount_retry(&sp->so_reclaim_seqcount, seq))
2339 nfs4_schedule_stateid_recovery(server, state); 2339 nfs4_schedule_stateid_recovery(server, state);
@@ -2374,10 +2374,10 @@ static int _nfs4_do_open(struct inode *dir,
2374 status = nfs4_recover_expired_lease(server); 2374 status = nfs4_recover_expired_lease(server);
2375 if (status != 0) 2375 if (status != 0)
2376 goto err_put_state_owner; 2376 goto err_put_state_owner;
2377 if (dentry->d_inode != NULL) 2377 if (d_really_is_positive(dentry))
2378 nfs4_return_incompatible_delegation(dentry->d_inode, fmode); 2378 nfs4_return_incompatible_delegation(d_inode(dentry), fmode);
2379 status = -ENOMEM; 2379 status = -ENOMEM;
2380 if (dentry->d_inode) 2380 if (d_really_is_positive(dentry))
2381 claim = NFS4_OPEN_CLAIM_FH; 2381 claim = NFS4_OPEN_CLAIM_FH;
2382 opendata = nfs4_opendata_alloc(dentry, sp, fmode, flags, sattr, 2382 opendata = nfs4_opendata_alloc(dentry, sp, fmode, flags, sattr,
2383 label, claim, GFP_KERNEL); 2383 label, claim, GFP_KERNEL);
@@ -2400,8 +2400,8 @@ static int _nfs4_do_open(struct inode *dir,
2400 } 2400 }
2401 opendata->o_arg.open_bitmap = &nfs4_pnfs_open_bitmap[0]; 2401 opendata->o_arg.open_bitmap = &nfs4_pnfs_open_bitmap[0];
2402 } 2402 }
2403 if (dentry->d_inode != NULL) 2403 if (d_really_is_positive(dentry))
2404 opendata->state = nfs4_get_open_state(dentry->d_inode, sp); 2404 opendata->state = nfs4_get_open_state(d_inode(dentry), sp);
2405 2405
2406 status = _nfs4_open_and_get_state(opendata, fmode, flags, ctx); 2406 status = _nfs4_open_and_get_state(opendata, fmode, flags, ctx);
2407 if (status != 0) 2407 if (status != 0)
@@ -3254,7 +3254,7 @@ static int
3254nfs4_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr, 3254nfs4_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
3255 struct iattr *sattr) 3255 struct iattr *sattr)
3256{ 3256{
3257 struct inode *inode = dentry->d_inode; 3257 struct inode *inode = d_inode(dentry);
3258 struct rpc_cred *cred = NULL; 3258 struct rpc_cred *cred = NULL;
3259 struct nfs4_state *state = NULL; 3259 struct nfs4_state *state = NULL;
3260 struct nfs4_label *label = NULL; 3260 struct nfs4_label *label = NULL;
@@ -3871,13 +3871,13 @@ static int nfs4_proc_mkdir(struct inode *dir, struct dentry *dentry,
3871static int _nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred, 3871static int _nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
3872 u64 cookie, struct page **pages, unsigned int count, int plus) 3872 u64 cookie, struct page **pages, unsigned int count, int plus)
3873{ 3873{
3874 struct inode *dir = dentry->d_inode; 3874 struct inode *dir = d_inode(dentry);
3875 struct nfs4_readdir_arg args = { 3875 struct nfs4_readdir_arg args = {
3876 .fh = NFS_FH(dir), 3876 .fh = NFS_FH(dir),
3877 .pages = pages, 3877 .pages = pages,
3878 .pgbase = 0, 3878 .pgbase = 0,
3879 .count = count, 3879 .count = count,
3880 .bitmask = NFS_SERVER(dentry->d_inode)->attr_bitmask, 3880 .bitmask = NFS_SERVER(d_inode(dentry))->attr_bitmask,
3881 .plus = plus, 3881 .plus = plus,
3882 }; 3882 };
3883 struct nfs4_readdir_res res; 3883 struct nfs4_readdir_res res;
@@ -3914,8 +3914,8 @@ static int nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
3914 do { 3914 do {
3915 err = _nfs4_proc_readdir(dentry, cred, cookie, 3915 err = _nfs4_proc_readdir(dentry, cred, cookie,
3916 pages, count, plus); 3916 pages, count, plus);
3917 trace_nfs4_readdir(dentry->d_inode, err); 3917 trace_nfs4_readdir(d_inode(dentry), err);
3918 err = nfs4_handle_exception(NFS_SERVER(dentry->d_inode), err, 3918 err = nfs4_handle_exception(NFS_SERVER(d_inode(dentry)), err,
3919 &exception); 3919 &exception);
3920 } while (exception.retry); 3920 } while (exception.retry);
3921 return err; 3921 return err;
@@ -4830,7 +4830,7 @@ nfs4_set_security_label(struct dentry *dentry, const void *buf, size_t buflen)
4830 struct nfs4_label ilabel, *olabel = NULL; 4830 struct nfs4_label ilabel, *olabel = NULL;
4831 struct nfs_fattr fattr; 4831 struct nfs_fattr fattr;
4832 struct rpc_cred *cred; 4832 struct rpc_cred *cred;
4833 struct inode *inode = dentry->d_inode; 4833 struct inode *inode = d_inode(dentry);
4834 int status; 4834 int status;
4835 4835
4836 if (!nfs_server_capable(inode, NFS_CAP_SECURITY_LABEL)) 4836 if (!nfs_server_capable(inode, NFS_CAP_SECURITY_LABEL))
@@ -5670,7 +5670,7 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata)
5670 data->rpc_status = task->tk_status; 5670 data->rpc_status = task->tk_status;
5671 switch (task->tk_status) { 5671 switch (task->tk_status) {
5672 case 0: 5672 case 0:
5673 renew_lease(NFS_SERVER(data->ctx->dentry->d_inode), 5673 renew_lease(NFS_SERVER(d_inode(data->ctx->dentry)),
5674 data->timestamp); 5674 data->timestamp);
5675 if (data->arg.new_lock) { 5675 if (data->arg.new_lock) {
5676 data->fl.fl_flags &= ~(FL_SLEEP | FL_ACCESS); 5676 data->fl.fl_flags &= ~(FL_SLEEP | FL_ACCESS);
@@ -6112,7 +6112,7 @@ static int nfs4_xattr_set_nfs4_acl(struct dentry *dentry, const char *key,
6112 if (strcmp(key, "") != 0) 6112 if (strcmp(key, "") != 0)
6113 return -EINVAL; 6113 return -EINVAL;
6114 6114
6115 return nfs4_proc_set_acl(dentry->d_inode, buf, buflen); 6115 return nfs4_proc_set_acl(d_inode(dentry), buf, buflen);
6116} 6116}
6117 6117
6118static int nfs4_xattr_get_nfs4_acl(struct dentry *dentry, const char *key, 6118static int nfs4_xattr_get_nfs4_acl(struct dentry *dentry, const char *key,
@@ -6121,7 +6121,7 @@ static int nfs4_xattr_get_nfs4_acl(struct dentry *dentry, const char *key,
6121 if (strcmp(key, "") != 0) 6121 if (strcmp(key, "") != 0)
6122 return -EINVAL; 6122 return -EINVAL;
6123 6123
6124 return nfs4_proc_get_acl(dentry->d_inode, buf, buflen); 6124 return nfs4_proc_get_acl(d_inode(dentry), buf, buflen);
6125} 6125}
6126 6126
6127static size_t nfs4_xattr_list_nfs4_acl(struct dentry *dentry, char *list, 6127static size_t nfs4_xattr_list_nfs4_acl(struct dentry *dentry, char *list,
@@ -6130,7 +6130,7 @@ static size_t nfs4_xattr_list_nfs4_acl(struct dentry *dentry, char *list,
6130{ 6130{
6131 size_t len = sizeof(XATTR_NAME_NFSV4_ACL); 6131 size_t len = sizeof(XATTR_NAME_NFSV4_ACL);
6132 6132
6133 if (!nfs4_server_supports_acls(NFS_SERVER(dentry->d_inode))) 6133 if (!nfs4_server_supports_acls(NFS_SERVER(d_inode(dentry))))
6134 return 0; 6134 return 0;
6135 6135
6136 if (list && len <= list_len) 6136 if (list && len <= list_len)
@@ -6158,7 +6158,7 @@ static int nfs4_xattr_get_nfs4_label(struct dentry *dentry, const char *key,
6158 void *buf, size_t buflen, int type) 6158 void *buf, size_t buflen, int type)
6159{ 6159{
6160 if (security_ismaclabel(key)) 6160 if (security_ismaclabel(key))
6161 return nfs4_get_security_label(dentry->d_inode, buf, buflen); 6161 return nfs4_get_security_label(d_inode(dentry), buf, buflen);
6162 return -EOPNOTSUPP; 6162 return -EOPNOTSUPP;
6163} 6163}
6164 6164
@@ -6168,10 +6168,10 @@ static size_t nfs4_xattr_list_nfs4_label(struct dentry *dentry, char *list,
6168{ 6168{
6169 size_t len = 0; 6169 size_t len = 0;
6170 6170
6171 if (nfs_server_capable(dentry->d_inode, NFS_CAP_SECURITY_LABEL)) { 6171 if (nfs_server_capable(d_inode(dentry), NFS_CAP_SECURITY_LABEL)) {
6172 len = security_inode_listsecurity(dentry->d_inode, NULL, 0); 6172 len = security_inode_listsecurity(d_inode(dentry), NULL, 0);
6173 if (list && len <= list_len) 6173 if (list && len <= list_len)
6174 security_inode_listsecurity(dentry->d_inode, list, len); 6174 security_inode_listsecurity(d_inode(dentry), list, len);
6175 } 6175 }
6176 return len; 6176 return len;
6177} 6177}