Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 25ab4c9b authored by Yaowei Bai's avatar Yaowei Bai Committed by Al Viro
Browse files

fs/namespace.c: path_is_under can be boolean



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: default avatarYaowei Bai <baiyaowei@cmss.chinamobile.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 3e004eea
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -2939,9 +2939,9 @@ bool is_path_reachable(struct mount *mnt, struct dentry *dentry,
	return &mnt->mnt == root->mnt && is_subdir(dentry, root->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);
	read_seqlock_excl(&mount_lock);
	res = is_path_reachable(real_mount(path1->mnt), path1->dentry, path2);
	res = is_path_reachable(real_mount(path1->mnt), path1->dentry, path2);
	read_sequnlock_excl(&mount_lock);
	read_sequnlock_excl(&mount_lock);
+1 −1
Original line number Original line Diff line number Diff line
@@ -2533,7 +2533,7 @@ extern struct file * open_exec(const char *);
 
 
/* fs/dcache.c -- generic fs support functions */
/* fs/dcache.c -- generic fs support functions */
extern int is_subdir(struct dentry *, struct dentry *);
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);
extern char *file_path(struct file *, char *, int);