mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
NFS: Create a new nfs_alloc_fattr_with_label() function
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>
This commit is contained in:
parent
d4a95a7e5a
commit
d755ad8dc7
4 changed files with 36 additions and 20 deletions
|
@ -426,9 +426,22 @@ extern void nfs_fattr_set_barrier(struct nfs_fattr *fattr);
|
|||
extern unsigned long nfs_inc_attr_generation_counter(void);
|
||||
|
||||
extern struct nfs_fattr *nfs_alloc_fattr(void);
|
||||
extern struct nfs_fattr *nfs_alloc_fattr_with_label(struct nfs_server *server);
|
||||
|
||||
static inline void nfs4_label_free(struct nfs4_label *label)
|
||||
{
|
||||
#ifdef CONFIG_NFS_V4_SECURITY_LABEL
|
||||
if (label) {
|
||||
kfree(label->label);
|
||||
kfree(label);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void nfs_free_fattr(const struct nfs_fattr *fattr)
|
||||
{
|
||||
if (fattr)
|
||||
nfs4_label_free(fattr->label);
|
||||
kfree(fattr);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue