aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-02-12 22:15:47 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2012-03-20 21:29:37 -0400
commit32991ab305ace7017c62f8eecbe5eb36dc32e13b (patch)
tree7a802091fa9f152f38577a4eeaa24937c4b4b2c9
parent318ceed088497d1ca839b1172518ac4cc7096b82 (diff)
vfs: d_alloc_root() gone
all callers converted to d_make_root() by now Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--Documentation/filesystems/porting6
-rw-r--r--fs/dcache.c24
-rw-r--r--include/linux/dcache.h1
3 files changed, 6 insertions, 25 deletions
diff --git a/Documentation/filesystems/porting b/Documentation/filesystems/porting
index b4a3d765ff9a..74acd9618819 100644
--- a/Documentation/filesystems/porting
+++ b/Documentation/filesystems/porting
@@ -429,3 +429,9 @@ filemap_write_and_wait_range() so that all dirty pages are synced out properly.
429You must also keep in mind that ->fsync() is not called with i_mutex held 429You must also keep in mind that ->fsync() is not called with i_mutex held
430anymore, so if you require i_mutex locking you must make sure to take it and 430anymore, so if you require i_mutex locking you must make sure to take it and
431release it yourself. 431release it yourself.
432
433--
434[mandatory]
435 d_alloc_root() is gone, along with a lot of bugs caused by code
436misusing it. Replacement: d_make_root(inode). The difference is,
437d_make_root() drops the reference to inode if dentry allocation fails.
diff --git a/fs/dcache.c b/fs/dcache.c
index bcbdb33fcc20..a78e145a4357 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1443,30 +1443,6 @@ struct dentry *d_instantiate_unique(struct dentry *entry, struct inode *inode)
1443 1443
1444EXPORT_SYMBOL(d_instantiate_unique); 1444EXPORT_SYMBOL(d_instantiate_unique);
1445 1445
1446/**
1447 * d_alloc_root - allocate root dentry
1448 * @root_inode: inode to allocate the root for
1449 *
1450 * Allocate a root ("/") dentry for the inode given. The inode is
1451 * instantiated and returned. %NULL is returned if there is insufficient
1452 * memory or the inode passed is %NULL.
1453 */
1454
1455struct dentry * d_alloc_root(struct inode * root_inode)
1456{
1457 struct dentry *res = NULL;
1458
1459 if (root_inode) {
1460 static const struct qstr name = { .name = "/", .len = 1 };
1461
1462 res = __d_alloc(root_inode->i_sb, &name);
1463 if (res)
1464 d_instantiate(res, root_inode);
1465 }
1466 return res;
1467}
1468EXPORT_SYMBOL(d_alloc_root);
1469
1470struct dentry *d_make_root(struct inode *root_inode) 1446struct dentry *d_make_root(struct inode *root_inode)
1471{ 1447{
1472 struct dentry *res = NULL; 1448 struct dentry *res = NULL;
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index ff5f5256d175..7e11f1418203 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -222,7 +222,6 @@ extern void shrink_dcache_for_umount(struct super_block *);
222extern int d_invalidate(struct dentry *); 222extern int d_invalidate(struct dentry *);
223 223
224/* only used at mount-time */ 224/* only used at mount-time */
225extern struct dentry * d_alloc_root(struct inode *);
226extern struct dentry * d_make_root(struct inode *); 225extern struct dentry * d_make_root(struct inode *);
227 226
228/* <clickety>-<click> the ramfs-type tree */ 227/* <clickety>-<click> the ramfs-type tree */