Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

make simple_positive() public

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro dc3f4198 5d754ced

+25 -60
+1 -1
arch/powerpc/platforms/cell/spufs/inode.c
··· 166 166 mutex_lock(&d_inode(dir)->i_mutex); 167 167 list_for_each_entry_safe(dentry, tmp, &dir->d_subdirs, d_child) { 168 168 spin_lock(&dentry->d_lock); 169 - if (!(d_unhashed(dentry)) && d_really_is_positive(dentry)) { 169 + if (simple_positive(dentry)) { 170 170 dget_dlock(dentry); 171 171 __d_drop(dentry); 172 172 spin_unlock(&dentry->d_lock);
+1 -6
arch/s390/hypfs/inode.c
··· 62 62 hypfs_last_dentry = dentry; 63 63 } 64 64 65 - static inline int hypfs_positive(struct dentry *dentry) 66 - { 67 - return d_really_is_positive(dentry) && !d_unhashed(dentry); 68 - } 69 - 70 65 static void hypfs_remove(struct dentry *dentry) 71 66 { 72 67 struct dentry *parent; 73 68 74 69 parent = dentry->d_parent; 75 70 mutex_lock(&d_inode(parent)->i_mutex); 76 - if (hypfs_positive(dentry)) { 71 + if (simple_positive(dentry)) { 77 72 if (d_is_dir(dentry)) 78 73 simple_rmdir(d_inode(parent), dentry); 79 74 else
+1 -9
drivers/block/drbd/drbd_debugfs.c
··· 419 419 return 0; 420 420 } 421 421 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 - 430 422 /* make sure at *open* time that the respective object won't go away. */ 431 423 static int drbd_single_open(struct file *file, int (*show)(struct seq_file *, void *), 432 424 void *data, struct kref *kref, ··· 436 444 /* serialize with d_delete() */ 437 445 mutex_lock(&d_inode(parent)->i_mutex); 438 446 /* Make sure the object is still alive */ 439 - if (debugfs_positive(file->f_path.dentry) 447 + if (simple_positive(file->f_path.dentry) 440 448 && kref_get_unless_zero(kref)) 441 449 ret = 0; 442 450 mutex_unlock(&d_inode(parent)->i_mutex);
+1 -1
drivers/infiniband/hw/ipath/ipath_fs.c
··· 277 277 } 278 278 279 279 spin_lock(&tmp->d_lock); 280 - if (!d_unhashed(tmp) && d_really_is_positive(tmp)) { 280 + if (simple_positive(tmp)) { 281 281 dget_dlock(tmp); 282 282 __d_drop(tmp); 283 283 spin_unlock(&tmp->d_lock);
+1 -1
drivers/infiniband/hw/qib/qib_fs.c
··· 455 455 } 456 456 457 457 spin_lock(&tmp->d_lock); 458 - if (!d_unhashed(tmp) && d_really_is_positive(tmp)) { 458 + if (simple_positive(tmp)) { 459 459 __d_drop(tmp); 460 460 spin_unlock(&tmp->d_lock); 461 461 simple_unlink(d_inode(parent), tmp);
-5
fs/autofs4/autofs_i.h
··· 238 238 return d_inode(sbi->sb->s_root)->i_ino; 239 239 } 240 240 241 - static inline int simple_positive(struct dentry *dentry) 242 - { 243 - return d_really_is_positive(dentry) && !d_unhashed(dentry); 244 - } 245 - 246 241 static inline void __autofs4_add_expiring(struct dentry *dentry) 247 242 { 248 243 struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
+1 -1
fs/ceph/dir.c
··· 161 161 } 162 162 spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); 163 163 if (di->lease_shared_gen == shared_gen && 164 - !d_unhashed(dentry) && d_really_is_positive(dentry) && 164 + simple_positive(dentry) && 165 165 ceph_snap(d_inode(dentry)) != CEPH_SNAPDIR && 166 166 ceph_ino(d_inode(dentry)) != CEPH_INO_CEPH && 167 167 fpos_cmp(ctx->pos, di->offset) <= 0)
+1 -1
fs/configfs/inode.c
··· 236 236 237 237 if (dentry) { 238 238 spin_lock(&dentry->d_lock); 239 - if (!d_unhashed(dentry) && d_really_is_positive(dentry)) { 239 + if (simple_positive(dentry)) { 240 240 dget_dlock(dentry); 241 241 __d_drop(dentry); 242 242 spin_unlock(&dentry->d_lock);
+3 -8
fs/debugfs/inode.c
··· 44 44 return inode; 45 45 } 46 46 47 - static inline int debugfs_positive(struct dentry *dentry) 48 - { 49 - return d_really_is_positive(dentry) && !d_unhashed(dentry); 50 - } 51 - 52 47 struct debugfs_mount_opts { 53 48 kuid_t uid; 54 49 kgid_t gid; ··· 517 522 { 518 523 int ret = 0; 519 524 520 - if (debugfs_positive(dentry)) { 525 + if (simple_positive(dentry)) { 521 526 dget(dentry); 522 527 if (d_is_dir(dentry)) 523 528 ret = simple_rmdir(d_inode(parent), dentry); ··· 597 602 */ 598 603 spin_lock(&parent->d_lock); 599 604 list_for_each_entry(child, &parent->d_subdirs, d_child) { 600 - if (!debugfs_positive(child)) 605 + if (!simple_positive(child)) 601 606 continue; 602 607 603 608 /* perhaps simple_empty(child) makes more sense */ ··· 618 623 * from d_subdirs. When releasing the parent->d_lock we can 619 624 * no longer trust that the next pointer is valid. 620 625 * Restart the loop. We'll skip this one with the 621 - * debugfs_positive() check. 626 + * simple_positive() check. 622 627 */ 623 628 goto loop; 624 629 }
-5
fs/libfs.c
··· 20 20 21 21 #include "internal.h" 22 22 23 - static inline int simple_positive(struct dentry *dentry) 24 - { 25 - return d_really_is_positive(dentry) && !d_unhashed(dentry); 26 - } 27 - 28 23 int simple_getattr(struct vfsmount *mnt, struct dentry *dentry, 29 24 struct kstat *stat) 30 25 {
+1 -1
fs/nfs/dir.c
··· 1771 1771 1772 1772 static 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 1775 d_delete(dentry); 1776 1776 } 1777 1777
+3 -8
fs/tracefs/inode.c
··· 496 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 499 static int __tracefs_remove(struct dentry *dentry, struct dentry *parent) 505 500 { 506 501 int ret = 0; 507 502 508 - if (tracefs_positive(dentry)) { 503 + if (simple_positive(dentry)) { 509 504 if (dentry->d_inode) { 510 505 dget(dentry); 511 506 switch (dentry->d_inode->i_mode & S_IFMT) { ··· 577 582 */ 578 583 spin_lock(&parent->d_lock); 579 584 list_for_each_entry(child, &parent->d_subdirs, d_child) { 580 - if (!tracefs_positive(child)) 585 + if (!simple_positive(child)) 581 586 continue; 582 587 583 588 /* perhaps simple_empty(child) makes more sense */ ··· 598 603 * from d_subdirs. When releasing the parent->d_lock we can 599 604 * no longer trust that the next pointer is valid. 600 605 * Restart the loop. We'll skip this one with the 601 - * tracefs_positive() check. 606 + * simple_positive() check. 602 607 */ 603 608 goto loop; 604 609 }
+5
include/linux/dcache.h
··· 507 507 return dentry->d_inode != NULL; 508 508 } 509 509 510 + static inline int simple_positive(struct dentry *dentry) 511 + { 512 + return d_really_is_positive(dentry) && !d_unhashed(dentry); 513 + } 514 + 510 515 extern void d_set_fallthru(struct dentry *dentry); 511 516 512 517 static inline bool d_is_fallthru(const struct dentry *dentry)
+6 -13
security/inode.c
··· 25 25 static struct vfsmount *mount; 26 26 static int mount_count; 27 27 28 - static inline int positive(struct dentry *dentry) 29 - { 30 - return d_really_is_positive(dentry) && !d_unhashed(dentry); 31 - } 32 - 33 28 static int fill_super(struct super_block *sb, void *data, int silent) 34 29 { 35 30 static struct tree_descr files[] = {{""}}; ··· 196 201 return; 197 202 198 203 mutex_lock(&d_inode(parent)->i_mutex); 199 - if (positive(dentry)) { 200 - if (d_really_is_positive(dentry)) { 201 - if (d_is_dir(dentry)) 202 - simple_rmdir(d_inode(parent), dentry); 203 - else 204 - simple_unlink(d_inode(parent), dentry); 205 - dput(dentry); 206 - } 204 + if (simple_positive(dentry)) { 205 + if (d_is_dir(dentry)) 206 + simple_rmdir(d_inode(parent), dentry); 207 + else 208 + simple_unlink(d_inode(parent), dentry); 209 + dput(dentry); 207 210 } 208 211 mutex_unlock(&d_inode(parent)->i_mutex); 209 212 simple_release_fs(&mount, &mount_count);