aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-05-18 10:10:34 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2015-06-23 18:02:01 -0400
commitdc3f4198eac14e52a98dfc79cd84b45e280f59cd (patch)
tree1fa6e8ec571132471e903a6a1d34accacfa9ad33 /fs
parent5d754ced150e392c7b5dbf73ed2feddb60cd579a (diff)
make simple_positive() public
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/autofs4/autofs_i.h5
-rw-r--r--fs/ceph/dir.c2
-rw-r--r--fs/configfs/inode.c2
-rw-r--r--fs/debugfs/inode.c11
-rw-r--r--fs/libfs.c5
-rw-r--r--fs/nfs/dir.c2
-rw-r--r--fs/tracefs/inode.c11
7 files changed, 9 insertions, 29 deletions
diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h
index 5b700ef1e59d..c37149b929be 100644
--- a/fs/autofs4/autofs_i.h
+++ b/fs/autofs4/autofs_i.h
@@ -238,11 +238,6 @@ static inline u64 autofs4_get_ino(struct autofs_sb_info *sbi)
238 return d_inode(sbi->sb->s_root)->i_ino; 238 return d_inode(sbi->sb->s_root)->i_ino;
239} 239}
240 240
241static inline int simple_positive(struct dentry *dentry)
242{
243 return d_really_is_positive(dentry) && !d_unhashed(dentry);
244}
245
246static inline void __autofs4_add_expiring(struct dentry *dentry) 241static inline void __autofs4_add_expiring(struct dentry *dentry)
247{ 242{
248 struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb); 243 struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index 4248307fea90..edbb8da02a6a 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -161,7 +161,7 @@ more:
161 } 161 }
162 spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); 162 spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
163 if (di->lease_shared_gen == shared_gen && 163 if (di->lease_shared_gen == shared_gen &&
164 !d_unhashed(dentry) && d_really_is_positive(dentry) && 164 simple_positive(dentry) &&
165 ceph_snap(d_inode(dentry)) != CEPH_SNAPDIR && 165 ceph_snap(d_inode(dentry)) != CEPH_SNAPDIR &&
166 ceph_ino(d_inode(dentry)) != CEPH_INO_CEPH && 166 ceph_ino(d_inode(dentry)) != CEPH_INO_CEPH &&
167 fpos_cmp(ctx->pos, di->offset) <= 0) 167 fpos_cmp(ctx->pos, di->offset) <= 0)
diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c
index 8d89f5fd0331..eae87575e681 100644
--- a/fs/configfs/inode.c
+++ b/fs/configfs/inode.c
@@ -236,7 +236,7 @@ void configfs_drop_dentry(struct configfs_dirent * sd, struct dentry * parent)
236 236
237 if (dentry) { 237 if (dentry) {
238 spin_lock(&dentry->d_lock); 238 spin_lock(&dentry->d_lock);
239 if (!d_unhashed(dentry) && d_really_is_positive(dentry)) { 239 if (simple_positive(dentry)) {
240 dget_dlock(dentry); 240 dget_dlock(dentry);
241 __d_drop(dentry); 241 __d_drop(dentry);
242 spin_unlock(&dentry->d_lock); 242 spin_unlock(&dentry->d_lock);
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index 7eaec88ea970..ef86ad6bdc3e 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -44,11 +44,6 @@ static struct inode *debugfs_get_inode(struct super_block *sb)
44 return inode; 44 return inode;
45} 45}
46 46
47static inline int debugfs_positive(struct dentry *dentry)
48{
49 return d_really_is_positive(dentry) && !d_unhashed(dentry);
50}
51
52struct debugfs_mount_opts { 47struct debugfs_mount_opts {
53 kuid_t uid; 48 kuid_t uid;
54 kgid_t gid; 49 kgid_t gid;
@@ -522,7 +517,7 @@ static int __debugfs_remove(struct dentry *dentry, struct dentry *parent)
522{ 517{
523 int ret = 0; 518 int ret = 0;
524 519
525 if (debugfs_positive(dentry)) { 520 if (simple_positive(dentry)) {
526 dget(dentry); 521 dget(dentry);
527 if (d_is_dir(dentry)) 522 if (d_is_dir(dentry))
528 ret = simple_rmdir(d_inode(parent), dentry); 523 ret = simple_rmdir(d_inode(parent), dentry);
@@ -602,7 +597,7 @@ void debugfs_remove_recursive(struct dentry *dentry)
602 */ 597 */
603 spin_lock(&parent->d_lock); 598 spin_lock(&parent->d_lock);
604 list_for_each_entry(child, &parent->d_subdirs, d_child) { 599 list_for_each_entry(child, &parent->d_subdirs, d_child) {
605 if (!debugfs_positive(child)) 600 if (!simple_positive(child))
606 continue; 601 continue;
607 602
608 /* perhaps simple_empty(child) makes more sense */ 603 /* perhaps simple_empty(child) makes more sense */
@@ -623,7 +618,7 @@ void debugfs_remove_recursive(struct dentry *dentry)
623 * from d_subdirs. When releasing the parent->d_lock we can 618 * from d_subdirs. When releasing the parent->d_lock we can
624 * no longer trust that the next pointer is valid. 619 * no longer trust that the next pointer is valid.
625 * Restart the loop. We'll skip this one with the 620 * Restart the loop. We'll skip this one with the
626 * debugfs_positive() check. 621 * simple_positive() check.
627 */ 622 */
628 goto loop; 623 goto loop;
629 } 624 }
diff --git a/fs/libfs.c b/fs/libfs.c
index 65e1feca8b98..4d9e6c118fe1 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -20,11 +20,6 @@
20 20
21#include "internal.h" 21#include "internal.h"
22 22
23static inline int simple_positive(struct dentry *dentry)
24{
25 return d_really_is_positive(dentry) && !d_unhashed(dentry);
26}
27
28int simple_getattr(struct vfsmount *mnt, struct dentry *dentry, 23int simple_getattr(struct vfsmount *mnt, struct dentry *dentry,
29 struct kstat *stat) 24 struct kstat *stat)
30{ 25{
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index b2c8b31b2be7..b9108f4254a7 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1771,7 +1771,7 @@ EXPORT_SYMBOL_GPL(nfs_mkdir);
1771 1771
1772static void nfs_dentry_handle_enoent(struct dentry *dentry) 1772static void nfs_dentry_handle_enoent(struct dentry *dentry)
1773{ 1773{
1774 if (d_really_is_positive(dentry) && !d_unhashed(dentry)) 1774 if (simple_positive(dentry))
1775 d_delete(dentry); 1775 d_delete(dentry);
1776} 1776}
1777 1777
diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c
index d92bdf3b079a..6e8a1400d662 100644
--- a/fs/tracefs/inode.c
+++ b/fs/tracefs/inode.c
@@ -496,16 +496,11 @@ struct dentry *tracefs_create_instance_dir(const char *name, struct dentry *pare
496 return dentry; 496 return dentry;
497} 497}
498 498
499static inline int tracefs_positive(struct dentry *dentry)
500{
501 return dentry->d_inode && !d_unhashed(dentry);
502}
503
504static int __tracefs_remove(struct dentry *dentry, struct dentry *parent) 499static int __tracefs_remove(struct dentry *dentry, struct dentry *parent)
505{ 500{
506 int ret = 0; 501 int ret = 0;
507 502
508 if (tracefs_positive(dentry)) { 503 if (simple_positive(dentry)) {
509 if (dentry->d_inode) { 504 if (dentry->d_inode) {
510 dget(dentry); 505 dget(dentry);
511 switch (dentry->d_inode->i_mode & S_IFMT) { 506 switch (dentry->d_inode->i_mode & S_IFMT) {
@@ -582,7 +577,7 @@ void tracefs_remove_recursive(struct dentry *dentry)
582 */ 577 */
583 spin_lock(&parent->d_lock); 578 spin_lock(&parent->d_lock);
584 list_for_each_entry(child, &parent->d_subdirs, d_child) { 579 list_for_each_entry(child, &parent->d_subdirs, d_child) {
585 if (!tracefs_positive(child)) 580 if (!simple_positive(child))
586 continue; 581 continue;
587 582
588 /* perhaps simple_empty(child) makes more sense */ 583 /* perhaps simple_empty(child) makes more sense */
@@ -603,7 +598,7 @@ void tracefs_remove_recursive(struct dentry *dentry)
603 * from d_subdirs. When releasing the parent->d_lock we can 598 * from d_subdirs. When releasing the parent->d_lock we can
604 * no longer trust that the next pointer is valid. 599 * no longer trust that the next pointer is valid.
605 * Restart the loop. We'll skip this one with the 600 * Restart the loop. We'll skip this one with the
606 * tracefs_positive() check. 601 * simple_positive() check.
607 */ 602 */
608 goto loop; 603 goto loop;
609 } 604 }