NFS: Create a new nfs_alloc_fattr_with_label() function
[ Upstream commit d755ad8dc752d44545613ea04d660aed674e540d ] For creating fattrs with the label field already allocated for us. I also update nfs_free_fattr() to free the label in the end. Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
00fa80189c
commit
29b51ae02d
@@ -1589,6 +1589,23 @@ struct nfs_fattr *nfs_alloc_fattr(void)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(nfs_alloc_fattr);
|
||||
|
||||
struct nfs_fattr *nfs_alloc_fattr_with_label(struct nfs_server *server)
|
||||
{
|
||||
struct nfs_fattr *fattr = nfs_alloc_fattr();
|
||||
|
||||
if (!fattr)
|
||||
return NULL;
|
||||
|
||||
fattr->label = nfs4_label_alloc(server, GFP_NOFS);
|
||||
if (IS_ERR(fattr->label)) {
|
||||
kfree(fattr);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return fattr;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(nfs_alloc_fattr_with_label);
|
||||
|
||||
struct nfs_fh *nfs_alloc_fhandle(void)
|
||||
{
|
||||
struct nfs_fh *fh;
|
||||
|
||||
Reference in New Issue
Block a user