NFS: Remove the nfs4_label from the nfs_entry struct
And instead allocate the fattr using nfs_alloc_fattr_with_label() Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
This commit is contained in:
Родитель
d755ad8dc7
Коммит
b1db9a401d
21
fs/nfs/dir.c
21
fs/nfs/dir.c
|
@ -682,7 +682,8 @@ again:
|
||||||
nfs_set_verifier(dentry, dir_verifier);
|
nfs_set_verifier(dentry, dir_verifier);
|
||||||
status = nfs_refresh_inode(d_inode(dentry), entry->fattr);
|
status = nfs_refresh_inode(d_inode(dentry), entry->fattr);
|
||||||
if (!status)
|
if (!status)
|
||||||
nfs_setsecurity(d_inode(dentry), entry->fattr, entry->label);
|
nfs_setsecurity(d_inode(dentry), entry->fattr,
|
||||||
|
entry->fattr->label);
|
||||||
goto out;
|
goto out;
|
||||||
} else {
|
} else {
|
||||||
d_invalidate(dentry);
|
d_invalidate(dentry);
|
||||||
|
@ -696,7 +697,7 @@ again:
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
inode = nfs_fhget(dentry->d_sb, entry->fh, entry->fattr, entry->label);
|
inode = nfs_fhget(dentry->d_sb, entry->fh, entry->fattr, entry->fattr->label);
|
||||||
alias = d_splice_alias(inode, dentry);
|
alias = d_splice_alias(inode, dentry);
|
||||||
d_lookup_done(dentry);
|
d_lookup_done(dentry);
|
||||||
if (alias) {
|
if (alias) {
|
||||||
|
@ -732,8 +733,8 @@ static int nfs_readdir_page_filler(struct nfs_readdir_descriptor *desc,
|
||||||
xdr_set_scratch_page(&stream, scratch);
|
xdr_set_scratch_page(&stream, scratch);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (entry->label)
|
if (entry->fattr->label)
|
||||||
entry->label->len = NFS4_MAXLABELLEN;
|
entry->fattr->label->len = NFS4_MAXLABELLEN;
|
||||||
|
|
||||||
status = xdr_decode(desc, entry, &stream);
|
status = xdr_decode(desc, entry, &stream);
|
||||||
if (status != 0)
|
if (status != 0)
|
||||||
|
@ -838,21 +839,15 @@ static int nfs_readdir_xdr_to_array(struct nfs_readdir_descriptor *desc,
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
entry->cookie = nfs_readdir_page_last_cookie(page);
|
entry->cookie = nfs_readdir_page_last_cookie(page);
|
||||||
entry->fh = nfs_alloc_fhandle();
|
entry->fh = nfs_alloc_fhandle();
|
||||||
entry->fattr = nfs_alloc_fattr();
|
entry->fattr = nfs_alloc_fattr_with_label(NFS_SERVER(inode));
|
||||||
entry->server = NFS_SERVER(inode);
|
entry->server = NFS_SERVER(inode);
|
||||||
if (entry->fh == NULL || entry->fattr == NULL)
|
if (entry->fh == NULL || entry->fattr == NULL)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
entry->label = nfs4_label_alloc(NFS_SERVER(inode), GFP_NOWAIT);
|
|
||||||
if (IS_ERR(entry->label)) {
|
|
||||||
status = PTR_ERR(entry->label);
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
array_size = (dtsize + PAGE_SIZE - 1) >> PAGE_SHIFT;
|
array_size = (dtsize + PAGE_SIZE - 1) >> PAGE_SHIFT;
|
||||||
pages = nfs_readdir_alloc_pages(array_size);
|
pages = nfs_readdir_alloc_pages(array_size);
|
||||||
if (!pages)
|
if (!pages)
|
||||||
goto out_release_label;
|
goto out;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
unsigned int pglen;
|
unsigned int pglen;
|
||||||
|
@ -875,8 +870,6 @@ static int nfs_readdir_xdr_to_array(struct nfs_readdir_descriptor *desc,
|
||||||
} while (!status && nfs_readdir_page_needs_filling(page));
|
} while (!status && nfs_readdir_page_needs_filling(page));
|
||||||
|
|
||||||
nfs_readdir_free_pages(pages, array_size);
|
nfs_readdir_free_pages(pages, array_size);
|
||||||
out_release_label:
|
|
||||||
nfs4_label_free(entry->label);
|
|
||||||
out:
|
out:
|
||||||
nfs_free_fattr(entry->fattr);
|
nfs_free_fattr(entry->fattr);
|
||||||
nfs_free_fhandle(entry->fh);
|
nfs_free_fhandle(entry->fh);
|
||||||
|
|
|
@ -7467,7 +7467,7 @@ int nfs4_decode_dirent(struct xdr_stream *xdr, struct nfs_entry *entry,
|
||||||
return -EAGAIN;
|
return -EAGAIN;
|
||||||
|
|
||||||
if (decode_getfattr_attrs(xdr, bitmap, entry->fattr, entry->fh,
|
if (decode_getfattr_attrs(xdr, bitmap, entry->fattr, entry->fh,
|
||||||
NULL, entry->label, entry->server) < 0)
|
NULL, entry->fattr->label, entry->server) < 0)
|
||||||
return -EAGAIN;
|
return -EAGAIN;
|
||||||
if (entry->fattr->valid & NFS_ATTR_FATTR_MOUNTED_ON_FILEID)
|
if (entry->fattr->valid & NFS_ATTR_FATTR_MOUNTED_ON_FILEID)
|
||||||
entry->ino = entry->fattr->mounted_on_fileid;
|
entry->ino = entry->fattr->mounted_on_fileid;
|
||||||
|
|
|
@ -753,7 +753,6 @@ struct nfs_entry {
|
||||||
int eof;
|
int eof;
|
||||||
struct nfs_fh * fh;
|
struct nfs_fh * fh;
|
||||||
struct nfs_fattr * fattr;
|
struct nfs_fattr * fattr;
|
||||||
struct nfs4_label *label;
|
|
||||||
unsigned char d_type;
|
unsigned char d_type;
|
||||||
struct nfs_server * server;
|
struct nfs_server * server;
|
||||||
};
|
};
|
||||||
|
|
Загрузка…
Ссылка в новой задаче