Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753086AbbKQGkn (ORCPT ); Tue, 17 Nov 2015 01:40:43 -0500 Received: from cmccmta1.chinamobile.com ([221.176.66.79]:4357 "EHLO cmccmta1.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751978AbbKQGkf (ORCPT ); Tue, 17 Nov 2015 01:40:35 -0500 X-RM-TRANSID: 2ee4564acbdfd5c-677b2 X-RM-SPAM-FLAG: 00000000 X-RM-TRANSID: 2ee2564acbde204-f732b From: Yaowei Bai To: akpm@linux-foundation.org, viro@zeniv.linux.org.uk Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/5] fs/namespace.c: path_is_under can be boolean Date: Tue, 17 Nov 2015 14:40:10 +0800 Message-Id: <1447742411-8006-2-git-send-email-baiyaowei@cmss.chinamobile.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447742411-8006-1-git-send-email-baiyaowei@cmss.chinamobile.com> References: <1447742411-8006-1-git-send-email-baiyaowei@cmss.chinamobile.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1650 Lines: 51 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 --- fs/namespace.c | 4 ++-- include/linux/fs.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/namespace.c b/fs/namespace.c index 0570729..b27156f 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -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); diff --git a/include/linux/fs.h b/include/linux/fs.h index 11505af..aab8094 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -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); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/