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

Configure Feed

Select the types of activity you want to include in your feed.

saner calling conventions for unlazy_child()

same as for the previous commit - instead of 0/-ECHILD make
it return true/false, rename to try_to_unlazy_child().

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

Al Viro ae66db45 e36cffed

+14 -14
+14 -14
fs/namei.c
··· 705 705 } 706 706 707 707 /** 708 - * unlazy_child - try to switch to ref-walk mode. 708 + * try_to_unlazy_next - try to switch to ref-walk mode. 709 709 * @nd: nameidata pathwalk data 710 - * @dentry: child of nd->path.dentry 711 - * @seq: seq number to check dentry against 712 - * Returns: 0 on success, -ECHILD on failure 710 + * @dentry: next dentry to step into 711 + * @seq: seq number to check @dentry against 712 + * Returns: true on success, false on failure 713 713 * 714 - * unlazy_child attempts to legitimize the current nd->path, nd->root and dentry 715 - * for ref-walk mode. @dentry must be a path found by a do_lookup call on 716 - * @nd. Must be called from rcu-walk context. 717 - * Nothing should touch nameidata between unlazy_child() failure and 714 + * Similar to to try_to_unlazy(), but here we have the next dentry already 715 + * picked by rcu-walk and want to legitimize that in addition to the current 716 + * nd->path and nd->root for ref-walk mode. Must be called from rcu-walk context. 717 + * Nothing should touch nameidata between try_to_unlazy_next() failure and 718 718 * terminate_walk(). 719 719 */ 720 - static int unlazy_child(struct nameidata *nd, struct dentry *dentry, unsigned seq) 720 + static bool try_to_unlazy_next(struct nameidata *nd, struct dentry *dentry, unsigned seq) 721 721 { 722 722 BUG_ON(!(nd->flags & LOOKUP_RCU)); 723 723 ··· 747 747 if (unlikely(!legitimize_root(nd))) 748 748 goto out_dput; 749 749 rcu_read_unlock(); 750 - return 0; 750 + return true; 751 751 752 752 out2: 753 753 nd->path.mnt = NULL; ··· 755 755 nd->path.dentry = NULL; 756 756 out: 757 757 rcu_read_unlock(); 758 - return -ECHILD; 758 + return false; 759 759 out_dput: 760 760 rcu_read_unlock(); 761 761 dput(dentry); 762 - return -ECHILD; 762 + return false; 763 763 } 764 764 765 765 static inline int d_revalidate(struct dentry *dentry, unsigned int flags) ··· 1372 1372 return -ENOENT; 1373 1373 if (likely(__follow_mount_rcu(nd, path, inode, seqp))) 1374 1374 return 0; 1375 - if (unlazy_child(nd, dentry, seq)) 1375 + if (!try_to_unlazy_next(nd, dentry, seq)) 1376 1376 return -ECHILD; 1377 1377 // *path might've been clobbered by __follow_mount_rcu() 1378 1378 path->mnt = nd->path.mnt; ··· 1493 1493 status = d_revalidate(dentry, nd->flags); 1494 1494 if (likely(status > 0)) 1495 1495 return dentry; 1496 - if (unlazy_child(nd, dentry, seq)) 1496 + if (!try_to_unlazy_next(nd, dentry, seq)) 1497 1497 return ERR_PTR(-ECHILD); 1498 1498 if (status == -ECHILD) 1499 1499 /* we'd been told to redo it in non-rcu mode */