summaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-07-19 11:35:08 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2019-07-19 11:35:08 -0700
commit4f5ed1318c0108369a76f4a56242fbeea537abe9 (patch)
treee1092bbcf848124782edc05d931afbec27600357 /Documentation
parentd2fbf4b6d585e40f2369675148777abce3abd0e7 (diff)
parent02e5ad973883c36c0868b301b8357d9c455bb91c (diff)
downloadlinux-4f5ed1318c0108369a76f4a56242fbeea537abe9.tar.bz2
Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull misc vfs updates from Al Viro: "Assorted stuff" * 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: perf_event_get(): don't bother with fget_raw() vfs: update d_make_root() description
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/filesystems/porting15
1 files changed, 13 insertions, 2 deletions
diff --git a/Documentation/filesystems/porting b/Documentation/filesystems/porting
index 2813a19389fe..209672010fb4 100644
--- a/Documentation/filesystems/porting
+++ b/Documentation/filesystems/porting
@@ -428,8 +428,19 @@ release it yourself.
--
[mandatory]
d_alloc_root() is gone, along with a lot of bugs caused by code
-misusing it. Replacement: d_make_root(inode). The difference is,
-d_make_root() drops the reference to inode if dentry allocation fails.
+misusing it. Replacement: d_make_root(inode). On success d_make_root(inode)
+allocates and returns a new dentry instantiated with the passed in inode.
+On failure NULL is returned and the passed in inode is dropped so the reference
+to inode is consumed in all cases and failure handling need not do any cleanup
+for the inode. If d_make_root(inode) is passed a NULL inode it returns NULL
+and also requires no further error handling. Typical usage is:
+
+ inode = foofs_new_inode(....);
+ s->s_root = d_make_inode(inode);
+ if (!s->s_root)
+ /* Nothing needed for the inode cleanup */
+ return -ENOMEM;
+ ...
--
[mandatory]