Skip to content

Commit ba4bc8d

Browse files
amschuma-ntapTrond Myklebust
authored andcommitted
NFS: Remove the nfs4_label from the nfs4_lookupp_res struct
Signed-off-by: Anna Schumaker <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent 9558a00 commit ba4bc8d

File tree

5 files changed

+14
-29
lines changed

5 files changed

+14
-29
lines changed

fs/nfs/export.c

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -131,39 +131,27 @@ nfs_get_parent(struct dentry *dentry)
131131
struct super_block *sb = inode->i_sb;
132132
struct nfs_server *server = NFS_SB(sb);
133133
struct nfs_fattr *fattr = NULL;
134-
struct nfs4_label *label = NULL;
135134
struct dentry *parent;
136135
struct nfs_rpc_ops const *ops = server->nfs_client->rpc_ops;
137136
struct nfs_fh fh;
138137

139138
if (!ops->lookupp)
140139
return ERR_PTR(-EACCES);
141140

142-
fattr = nfs_alloc_fattr();
143-
if (fattr == NULL) {
144-
parent = ERR_PTR(-ENOMEM);
145-
goto out;
146-
}
147-
148-
label = nfs4_label_alloc(server, GFP_KERNEL);
149-
if (IS_ERR(label)) {
150-
parent = ERR_CAST(label);
151-
goto out_free_fattr;
152-
}
141+
fattr = nfs_alloc_fattr_with_label(server);
142+
if (fattr == NULL)
143+
return ERR_PTR(-ENOMEM);
153144

154-
ret = ops->lookupp(inode, &fh, fattr, label);
145+
ret = ops->lookupp(inode, &fh, fattr);
155146
if (ret) {
156147
parent = ERR_PTR(ret);
157-
goto out_free_label;
148+
goto out;
158149
}
159150

160-
pinode = nfs_fhget(sb, &fh, fattr, label);
151+
pinode = nfs_fhget(sb, &fh, fattr, fattr->label);
161152
parent = d_obtain_alias(pinode);
162-
out_free_label:
163-
nfs4_label_free(label);
164-
out_free_fattr:
165-
nfs_free_fattr(fattr);
166153
out:
154+
nfs_free_fattr(fattr);
167155
return parent;
168156
}
169157

fs/nfs/nfs3proc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ nfs3_proc_lookup(struct inode *dir, struct dentry *dentry,
208208
}
209209

210210
static int nfs3_proc_lookupp(struct inode *inode, struct nfs_fh *fhandle,
211-
struct nfs_fattr *fattr, struct nfs4_label *label)
211+
struct nfs_fattr *fattr)
212212
{
213213
const char dotdot[] = "..";
214214
const size_t len = strlen(dotdot);

fs/nfs/nfs4proc.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4416,8 +4416,7 @@ nfs4_proc_lookup_mountpoint(struct inode *dir, struct dentry *dentry,
44164416
}
44174417

44184418
static int _nfs4_proc_lookupp(struct inode *inode,
4419-
struct nfs_fh *fhandle, struct nfs_fattr *fattr,
4420-
struct nfs4_label *label)
4419+
struct nfs_fh *fhandle, struct nfs_fattr *fattr)
44214420
{
44224421
struct rpc_clnt *clnt = NFS_CLIENT(inode);
44234422
struct nfs_server *server = NFS_SERVER(inode);
@@ -4429,7 +4428,6 @@ static int _nfs4_proc_lookupp(struct inode *inode,
44294428
struct nfs4_lookupp_res res = {
44304429
.server = server,
44314430
.fattr = fattr,
4432-
.label = label,
44334431
.fh = fhandle,
44344432
};
44354433
struct rpc_message msg = {
@@ -4442,7 +4440,7 @@ static int _nfs4_proc_lookupp(struct inode *inode,
44424440
if (NFS_SERVER(inode)->flags & NFS_MOUNT_SOFTREVAL)
44434441
task_flags |= RPC_TASK_TIMEOUT;
44444442

4445-
args.bitmask = nfs4_bitmask(server, label);
4443+
args.bitmask = nfs4_bitmask(server, fattr->label);
44464444

44474445
nfs_fattr_init(fattr);
44484446

@@ -4454,14 +4452,14 @@ static int _nfs4_proc_lookupp(struct inode *inode,
44544452
}
44554453

44564454
static int nfs4_proc_lookupp(struct inode *inode, struct nfs_fh *fhandle,
4457-
struct nfs_fattr *fattr, struct nfs4_label *label)
4455+
struct nfs_fattr *fattr)
44584456
{
44594457
struct nfs4_exception exception = {
44604458
.interruptible = true,
44614459
};
44624460
int err;
44634461
do {
4464-
err = _nfs4_proc_lookupp(inode, fhandle, fattr, label);
4462+
err = _nfs4_proc_lookupp(inode, fhandle, fattr);
44654463
trace_nfs4_lookupp(inode, err);
44664464
err = nfs4_handle_exception(NFS_SERVER(inode), err,
44674465
&exception);

fs/nfs/nfs4xdr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6201,7 +6201,7 @@ static int nfs4_xdr_dec_lookupp(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
62016201
status = decode_getfh(xdr, res->fh);
62026202
if (status)
62036203
goto out;
6204-
status = decode_getfattr_label(xdr, res->fattr, res->label, res->server);
6204+
status = decode_getfattr_label(xdr, res->fattr, res->fattr->label, res->server);
62056205
out:
62066206
return status;
62076207
}

include/linux/nfs_xdr.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,6 @@ struct nfs4_lookupp_res {
11081108
const struct nfs_server *server;
11091109
struct nfs_fattr *fattr;
11101110
struct nfs_fh *fh;
1111-
struct nfs4_label *label;
11121111
};
11131112

11141113
struct nfs4_lookup_root_arg {
@@ -1741,7 +1740,7 @@ struct nfs_rpc_ops {
17411740
int (*lookup) (struct inode *, struct dentry *,
17421741
struct nfs_fh *, struct nfs_fattr *);
17431742
int (*lookupp) (struct inode *, struct nfs_fh *,
1744-
struct nfs_fattr *, struct nfs4_label *);
1743+
struct nfs_fattr *);
17451744
int (*access) (struct inode *, struct nfs_access_entry *);
17461745
int (*readlink)(struct inode *, struct page *, unsigned int,
17471746
unsigned int);

0 commit comments

Comments
 (0)