Skip to content

Commit dc3f419

Browse files
author
Al Viro
committed
make simple_positive() public
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 5d754ce commit dc3f419

14 files changed

Lines changed: 25 additions & 60 deletions

File tree

‎arch/powerpc/platforms/cell/spufs/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ static void spufs_prune_dir(struct dentry *dir)
166166
mutex_lock(&d_inode(dir)->i_mutex);
167167
list_for_each_entry_safe(dentry, tmp, &dir->d_subdirs, d_child) {
168168
spin_lock(&dentry->d_lock);
169-
if (!(d_unhashed(dentry)) && d_really_is_positive(dentry)) {
169+
if (simple_positive(dentry)) {
170170
dget_dlock(dentry);
171171
__d_drop(dentry);
172172
spin_unlock(&dentry->d_lock);

‎arch/s390/hypfs/inode.c‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,13 @@ static void hypfs_add_dentry(struct dentry *dentry)
6262
hypfs_last_dentry = dentry;
6363
}
6464

65-
static inline int hypfs_positive(struct dentry *dentry)
66-
{
67-
return d_really_is_positive(dentry) && !d_unhashed(dentry);
68-
}
69-
7065
static void hypfs_remove(struct dentry *dentry)
7166
{
7267
struct dentry *parent;
7368

7469
parent = dentry->d_parent;
7570
mutex_lock(&d_inode(parent)->i_mutex);
76-
if (hypfs_positive(dentry)) {
71+
if (simple_positive(dentry)) {
7772
if (d_is_dir(dentry))
7873
simple_rmdir(d_inode(parent), dentry);
7974
else

‎drivers/block/drbd/drbd_debugfs.c‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -419,14 +419,6 @@ static int in_flight_summary_show(struct seq_file *m, void *pos)
419419
return 0;
420420
}
421421

422-
/* simple_positive(file->f_path.dentry) respectively debugfs_positive(),
423-
* but neither is "reachable" from here.
424-
* So we have our own inline version of it above. :-( */
425-
static inline int debugfs_positive(struct dentry *dentry)
426-
{
427-
return d_really_is_positive(dentry) && !d_unhashed(dentry);
428-
}
429-
430422
/* make sure at *open* time that the respective object won't go away. */
431423
static int drbd_single_open(struct file *file, int (*show)(struct seq_file *, void *),
432424
void *data, struct kref *kref,
@@ -444,7 +436,7 @@ static int drbd_single_open(struct file *file, int (*show)(struct seq_file *, vo
444436
/* serialize with d_delete() */
445437
mutex_lock(&d_inode(parent)->i_mutex);
446438
/* Make sure the object is still alive */
447-
if (debugfs_positive(file->f_path.dentry)
439+
if (simple_positive(file->f_path.dentry)
448440
&& kref_get_unless_zero(kref))
449441
ret = 0;
450442
mutex_unlock(&d_inode(parent)->i_mutex);

‎drivers/infiniband/hw/ipath/ipath_fs.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ static int remove_file(struct dentry *parent, char *name)
277277
}
278278

279279
spin_lock(&tmp->d_lock);
280-
if (!d_unhashed(tmp) && d_really_is_positive(tmp)) {
280+
if (simple_positive(tmp)) {
281281
dget_dlock(tmp);
282282
__d_drop(tmp);
283283
spin_unlock(&tmp->d_lock);

‎drivers/infiniband/hw/qib/qib_fs.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ static int remove_file(struct dentry *parent, char *name)
455455
}
456456

457457
spin_lock(&tmp->d_lock);
458-
if (!d_unhashed(tmp) && d_really_is_positive(tmp)) {
458+
if (simple_positive(tmp)) {
459459
__d_drop(tmp);
460460
spin_unlock(&tmp->d_lock);
461461
simple_unlink(d_inode(parent), tmp);

‎fs/autofs4/autofs_i.h‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,6 @@ static inline u64 autofs4_get_ino(struct autofs_sb_info *sbi)
238238
return d_inode(sbi->sb->s_root)->i_ino;
239239
}
240240

241-
static inline int simple_positive(struct dentry *dentry)
242-
{
243-
return d_really_is_positive(dentry) && !d_unhashed(dentry);
244-
}
245-
246241
static inline void __autofs4_add_expiring(struct dentry *dentry)
247242
{
248243
struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);

‎fs/ceph/dir.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ static int __dcache_readdir(struct file *file, struct dir_context *ctx,
161161
}
162162
spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
163163
if (di->lease_shared_gen == shared_gen &&
164-
!d_unhashed(dentry) && d_really_is_positive(dentry) &&
164+
simple_positive(dentry) &&
165165
ceph_snap(d_inode(dentry)) != CEPH_SNAPDIR &&
166166
ceph_ino(d_inode(dentry)) != CEPH_INO_CEPH &&
167167
fpos_cmp(ctx->pos, di->offset) <= 0)

‎fs/configfs/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ void configfs_drop_dentry(struct configfs_dirent * sd, struct dentry * parent)
236236

237237
if (dentry) {
238238
spin_lock(&dentry->d_lock);
239-
if (!d_unhashed(dentry) && d_really_is_positive(dentry)) {
239+
if (simple_positive(dentry)) {
240240
dget_dlock(dentry);
241241
__d_drop(dentry);
242242
spin_unlock(&dentry->d_lock);

‎fs/debugfs/inode.c‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ static struct inode *debugfs_get_inode(struct super_block *sb)
4444
return inode;
4545
}
4646

47-
static inline int debugfs_positive(struct dentry *dentry)
48-
{
49-
return d_really_is_positive(dentry) && !d_unhashed(dentry);
50-
}
51-
5247
struct debugfs_mount_opts {
5348
kuid_t uid;
5449
kgid_t gid;
@@ -522,7 +517,7 @@ static int __debugfs_remove(struct dentry *dentry, struct dentry *parent)
522517
{
523518
int ret = 0;
524519

525-
if (debugfs_positive(dentry)) {
520+
if (simple_positive(dentry)) {
526521
dget(dentry);
527522
if (d_is_dir(dentry))
528523
ret = simple_rmdir(d_inode(parent), dentry);
@@ -602,7 +597,7 @@ void debugfs_remove_recursive(struct dentry *dentry)
602597
*/
603598
spin_lock(&parent->d_lock);
604599
list_for_each_entry(child, &parent->d_subdirs, d_child) {
605-
if (!debugfs_positive(child))
600+
if (!simple_positive(child))
606601
continue;
607602

608603
/* perhaps simple_empty(child) makes more sense */
@@ -623,7 +618,7 @@ void debugfs_remove_recursive(struct dentry *dentry)
623618
* from d_subdirs. When releasing the parent->d_lock we can
624619
* no longer trust that the next pointer is valid.
625620
* Restart the loop. We'll skip this one with the
626-
* debugfs_positive() check.
621+
* simple_positive() check.
627622
*/
628623
goto loop;
629624
}

‎fs/libfs.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@
2020

2121
#include "internal.h"
2222

23-
static inline int simple_positive(struct dentry *dentry)
24-
{
25-
return d_really_is_positive(dentry) && !d_unhashed(dentry);
26-
}
27-
2823
int simple_getattr(struct vfsmount *mnt, struct dentry *dentry,
2924
struct kstat *stat)
3025
{

0 commit comments

Comments
 (0)