diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-05-18 10:10:34 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-06-23 18:02:01 -0400 |
commit | dc3f4198eac14e52a98dfc79cd84b45e280f59cd (patch) | |
tree | 1fa6e8ec571132471e903a6a1d34accacfa9ad33 /fs/tracefs | |
parent | 5d754ced150e392c7b5dbf73ed2feddb60cd579a (diff) |
make simple_positive() public
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/tracefs')
-rw-r--r-- | fs/tracefs/inode.c | 11 |
1 files changed, 3 insertions, 8 deletions
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 | ||
499 | static inline int tracefs_positive(struct dentry *dentry) | ||
500 | { | ||
501 | return dentry->d_inode && !d_unhashed(dentry); | ||
502 | } | ||
503 | |||
504 | static int __tracefs_remove(struct dentry *dentry, struct dentry *parent) | 499 | static 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 | } |