summaryrefslogtreecommitdiffstats
path: root/fs/dcache.c
diff options
context:
space:
mode:
authorYaowei Bai <baiyaowei@cmss.chinamobile.com>2015-11-17 01:40:11 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2015-12-06 21:17:13 -0500
commita6e5787fc8fc9c88290a7bceed07aa4d14029fa7 (patch)
tree9d26dfb40f817faee3a49bb5ef13c86a15da6d36 /fs/dcache.c
parent25ab4c9b1ccb64b1433cecd3f19f28fe300c1576 (diff)
fs/dcache.c: is_subdir can be boolean
This patch makes is_subdir return bool to improve readability due to this particular function only using either one or zero as its return value. No functional change. Signed-off-by: Yaowei Bai <baiyaowei@cmss.chinamobile.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/dcache.c')
-rw-r--r--fs/dcache.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index 5c33aeb0f68f..670f7896945b 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -3303,18 +3303,18 @@ out:
3303 * @new_dentry: new dentry 3303 * @new_dentry: new dentry
3304 * @old_dentry: old dentry 3304 * @old_dentry: old dentry
3305 * 3305 *
3306 * Returns 1 if new_dentry is a subdirectory of the parent (at any depth). 3306 * Returns true if new_dentry is a subdirectory of the parent (at any depth).
3307 * Returns 0 otherwise. 3307 * Returns false otherwise.
3308 * Caller must ensure that "new_dentry" is pinned before calling is_subdir() 3308 * Caller must ensure that "new_dentry" is pinned before calling is_subdir()
3309 */ 3309 */
3310 3310
3311int is_subdir(struct dentry *new_dentry, struct dentry *old_dentry) 3311bool is_subdir(struct dentry *new_dentry, struct dentry *old_dentry)
3312{ 3312{
3313 int result; 3313 bool result;
3314 unsigned seq; 3314 unsigned seq;
3315 3315
3316 if (new_dentry == old_dentry) 3316 if (new_dentry == old_dentry)
3317 return 1; 3317 return true;
3318 3318
3319 do { 3319 do {
3320 /* for restarting inner loop in case of seq retry */ 3320 /* for restarting inner loop in case of seq retry */
@@ -3325,9 +3325,9 @@ int is_subdir(struct dentry *new_dentry, struct dentry *old_dentry)
3325 */ 3325 */
3326 rcu_read_lock(); 3326 rcu_read_lock();
3327 if (d_ancestor(old_dentry, new_dentry)) 3327 if (d_ancestor(old_dentry, new_dentry))
3328 result = 1; 3328 result = true;
3329 else 3329 else
3330 result = 0; 3330 result = false;
3331 rcu_read_unlock(); 3331 rcu_read_unlock();
3332 } while (read_seqretry(&rename_lock, seq)); 3332 } while (read_seqretry(&rename_lock, seq));
3333 3333