History

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.

Anna Schumaker committed 5 years ago

Commit d755ad81 parent d4a95a74 files · +36 −20Browse files

Showing the changes to include (1 of 4 files). Show all

Unified · Split

include/linux/nfs_fs.h+13−0
@@ -426,9 +426,22 @@ extern void nfs_fattr_set_barrier(struct nfs_fattr *fattr); · 425 unmodified lines
426426 extern unsigned long nfs_inc_attr_generation_counter(void);
427427
428428 extern struct nfs_fattr *nfs_alloc_fattr(void);
429+extern struct nfs_fattr *nfs_alloc_fattr_with_label(struct nfs_server *server);
430+
431+static inline void nfs4_label_free(struct nfs4_label *label)
432+{
433+#ifdef CONFIG_NFS_V4_SECURITY_LABEL
434+ if (label) {
435+ kfree(label->label);
436+ kfree(label);
437+ }
438+#endif
439+}
429440
430441 static inline void nfs_free_fattr(const struct nfs_fattr *fattr)
431442 {
443+ if (fattr)
444+ nfs4_label_free(fattr->label);
432445 kfree(fattr);
433446 }
434447

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t