From patchwork Fri Jun 29 18:57:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 1133311 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 91FB7DFF34 for ; Fri, 29 Jun 2012 19:01:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932243Ab2F2S6S (ORCPT ); Fri, 29 Jun 2012 14:58:18 -0400 Received: from mail-gh0-f174.google.com ([209.85.160.174]:36203 "EHLO mail-gh0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932622Ab2F2S6Q (ORCPT ); Fri, 29 Jun 2012 14:58:16 -0400 Received: by mail-gh0-f174.google.com with SMTP id r11so3053276ghr.19 for ; Fri, 29 Jun 2012 11:58:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=e7YgkT9oqSuDah1MDfotTrFBUCSe6OlYIJtQGW917/s=; b=DsNGapJTTA35teSadbgP9iIQ+vaUFyWYvx2JXSJxWH+0Xt1TTp4rpTcFD3fqdxajvI QRFw6wgUwCJITGIl0LSZlj9nVizFLdsf8q6dFDuJi84lfb6jnONUjQq24kPtVQUVhiiq QelBm7GN87RQPk2GRSWMaSmBN2lqAyQ1MmFtyC5DpAM7WG1IcU+kMDHHE2pF/KiUVaHd 3auvleKg3AywV/v+7//saFh3SWhuMKQl2D4aQsPPsX0T7HZDJCH14dOT4n7Ay0lFwt39 byf0zVTKan08NKzjUHycRQgeIDS8uJW/DLw7X2aZamsdDmaGxLnQ/4kgmFUcAX9CmxWx qmzg== Received: by 10.101.141.21 with SMTP id t21mr1264027ann.34.1340996296208; Fri, 29 Jun 2012 11:58:16 -0700 (PDT) Received: from salusa.poochiereds.net (cpe-076-182-054-194.nc.res.rr.com. [76.182.54.194]) by mx.google.com with ESMTPS id l13sm3936309ann.2.2012.06.29.11.58.15 (version=SSLv3 cipher=OTHER); Fri, 29 Jun 2012 11:58:15 -0700 (PDT) From: Jeff Layton To: viro@ZenIV.linux.org.uk Cc: linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, michael.brantley@deshaw.com, hch@infradead.org, miklos@szeredi.hu, pstaubach@exagrid.com Subject: [PATCH v3 06/17] vfs: turn "empty" arg in getname_flags into a bool Date: Fri, 29 Jun 2012 14:57:49 -0400 Message-Id: <1340996280-27123-7-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1340996280-27123-1-git-send-email-jlayton@redhat.com> References: <1340996280-27123-1-git-send-email-jlayton@redhat.com> X-Gm-Message-State: ALoCoQnmgMOpP/C+ubSnnHVL8Ow2yn1HtOq3TWsTKZOyq+yxkeAlPsrDJkginGPlSJf9pG8ydx0d Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org ...it's just used as a flag. Signed-off-by: Jeff Layton --- fs/namei.c | 4 ++-- fs/stat.c | 2 +- include/linux/fs.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index 7945b19..a20faa5 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -117,7 +117,7 @@ * POSIX.1 2.4: an empty pathname is invalid (ENOENT). * PATH_MAX includes the nul terminator --RR. */ -char *getname_flags(const char __user *filename, int flags, int *empty) +char *getname_flags(const char __user *filename, int flags, bool *empty) { char *result = __getname(), *err; int len; @@ -133,7 +133,7 @@ char *getname_flags(const char __user *filename, int flags, int *empty) /* The empty path is special. */ if (unlikely(!len)) { if (empty) - *empty = 1; + *empty = true; err = ERR_PTR(-ENOENT); if (!(flags & LOOKUP_EMPTY)) goto error; diff --git a/fs/stat.c b/fs/stat.c index c9d88f7..4f8b6bc 100644 --- a/fs/stat.c +++ b/fs/stat.c @@ -306,7 +306,7 @@ SYSCALL_DEFINE4(readlinkat, int, dfd, const char __user *, pathname, { struct path path; int error; - int empty = 0; + bool empty = false; char *name; unsigned int try = 0; unsigned int lookup_flags = LOOKUP_EMPTY; diff --git a/include/linux/fs.h b/include/linux/fs.h index c7d60db..d044088 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2060,7 +2060,7 @@ extern struct file *file_open_root(struct dentry *, struct vfsmount *, extern struct file * dentry_open(struct dentry *, struct vfsmount *, int, const struct cred *); extern int filp_close(struct file *, fl_owner_t id); -extern char *getname_flags(const char __user *, int, int *); +extern char *getname_flags(const char __user *, int, bool *); extern char *getname(const char __user *); /**