Commit 7fb84306 authored by J. Bruce Fields's avatar J. Bruce Fields

nfsd4: rename cr_linkname->cr_data

The name of a link is currently stored in cr_name and cr_namelen, and
the content in cr_linkname and cr_linklen.  That's confusing.
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 52ee0433
...@@ -623,7 +623,7 @@ nfsd4_create(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, ...@@ -623,7 +623,7 @@ nfsd4_create(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
case NF4LNK: case NF4LNK:
status = nfsd_symlink(rqstp, &cstate->current_fh, status = nfsd_symlink(rqstp, &cstate->current_fh,
create->cr_name, create->cr_namelen, create->cr_name, create->cr_namelen,
create->cr_linkname, create->cr_data,
&resfh, &create->cr_iattr); &resfh, &create->cr_iattr);
break; break;
......
...@@ -598,20 +598,19 @@ nfsd4_decode_create(struct nfsd4_compoundargs *argp, struct nfsd4_create *create ...@@ -598,20 +598,19 @@ nfsd4_decode_create(struct nfsd4_compoundargs *argp, struct nfsd4_create *create
switch (create->cr_type) { switch (create->cr_type) {
case NF4LNK: case NF4LNK:
READ_BUF(4); READ_BUF(4);
create->cr_linklen = be32_to_cpup(p++); create->cr_datalen = be32_to_cpup(p++);
READ_BUF(create->cr_linklen); READ_BUF(create->cr_datalen);
/* /*
* The VFS will want a null-terminated string, and * The VFS will want a null-terminated string, and
* null-terminating in place isn't safe since this might * null-terminating in place isn't safe since this might
* end on a page boundary: * end on a page boundary:
*/ */
create->cr_linkname = create->cr_data = kmalloc(create->cr_datalen + 1, GFP_KERNEL);
kmalloc(create->cr_linklen + 1, GFP_KERNEL); if (!create->cr_data)
if (!create->cr_linkname)
return nfserr_jukebox; return nfserr_jukebox;
memcpy(create->cr_linkname, p, create->cr_linklen); memcpy(create->cr_data, p, create->cr_datalen);
create->cr_linkname[create->cr_linklen] = '\0'; create->cr_data[create->cr_datalen] = '\0';
defer_free(argp, kfree, create->cr_linkname); defer_free(argp, kfree, create->cr_data);
break; break;
case NF4BLK: case NF4BLK:
case NF4CHR: case NF4CHR:
......
...@@ -107,8 +107,8 @@ struct nfsd4_create { ...@@ -107,8 +107,8 @@ struct nfsd4_create {
u32 cr_type; /* request */ u32 cr_type; /* request */
union { /* request */ union { /* request */
struct { struct {
u32 namelen; u32 datalen;
char *name; char *data;
} link; /* NF4LNK */ } link; /* NF4LNK */
struct { struct {
u32 specdata1; u32 specdata1;
...@@ -121,8 +121,8 @@ struct nfsd4_create { ...@@ -121,8 +121,8 @@ struct nfsd4_create {
struct nfs4_acl *cr_acl; struct nfs4_acl *cr_acl;
struct xdr_netobj cr_label; struct xdr_netobj cr_label;
}; };
#define cr_linklen u.link.namelen #define cr_datalen u.link.datalen
#define cr_linkname u.link.name #define cr_data u.link.data
#define cr_specdata1 u.dev.specdata1 #define cr_specdata1 u.dev.specdata1
#define cr_specdata2 u.dev.specdata2 #define cr_specdata2 u.dev.specdata2
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment