]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
fs/namespace.c: path_is_under can be boolean
authorYaowei Bai <baiyaowei@cmss.chinamobile.com>
Tue, 17 Nov 2015 06:40:10 +0000 (14:40 +0800)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 7 Dec 2015 02:17:13 +0000 (21:17 -0500)
This patch makes path_is_under 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>
fs/namespace.c
include/linux/fs.h

index 0570729c87fd22dd299c50ee0303f43c384e4932..b27156f2e68b74ef0f5e050d7bf16e118d979823 100644 (file)
@@ -2939,9 +2939,9 @@ bool is_path_reachable(struct mount *mnt, struct dentry *dentry,
        return &mnt->mnt == root->mnt && is_subdir(dentry, root->dentry);
 }
 
-int path_is_under(struct path *path1, struct path *path2)
+bool path_is_under(struct path *path1, struct path *path2)
 {
-       int res;
+       bool res;
        read_seqlock_excl(&mount_lock);
        res = is_path_reachable(real_mount(path1->mnt), path1->dentry, path2);
        read_sequnlock_excl(&mount_lock);
index 11505af0d3589a043747776e236b144f45ac3f2b..aab8094656e4ca85ed5429069b887d23d52226d5 100644 (file)
@@ -2533,7 +2533,7 @@ extern struct file * open_exec(const char *);
  
 /* fs/dcache.c -- generic fs support functions */
 extern int is_subdir(struct dentry *, struct dentry *);
-extern int path_is_under(struct path *, struct path *);
+extern bool path_is_under(struct path *, struct path *);
 
 extern char *file_path(struct file *, char *, int);