From patchwork Thu Sep 20 15:12:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 10607943 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 40AFC112B for ; Thu, 20 Sep 2018 15:12:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3127C2DC43 for ; Thu, 20 Sep 2018 15:12:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2F5622DC00; Thu, 20 Sep 2018 15:12:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B87702DBD9 for ; Thu, 20 Sep 2018 15:12:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387800AbeITU41 (ORCPT ); Thu, 20 Sep 2018 16:56:27 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:36833 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733291AbeITU40 (ORCPT ); Thu, 20 Sep 2018 16:56:26 -0400 Received: by mail-wm1-f67.google.com with SMTP id j192-v6so11543025wmj.1 for ; Thu, 20 Sep 2018 08:12:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=IVfCHCWltHby4LkZUP1IHTTHkaGRqyiEBRTXLSOUhA8=; b=UWnLz1CW6KM1yCBuM6lQWKLzD6mQPp/siGZHi/pKsr/rcwgYZ1yEtyjwCDrD0H76Zo SuJ9ZoVijkSFyYbxll3tbh4zptE0wiIi2dL0Hb/xvLIFDCbBhrFDYB382yRL5c4hidDi TP5R9n19RAYCP9LBqaOvDKDluB+CRtY7ZcmxXUWpko8khcPgTkcAOGSEZJHinTczxXkV /VkkVljX44lgQCk257X/5nAPIhKRIm87YqTVN3Le7GcfF1VlAMf+L5Rsp9OKz/bPlCUJ LUvwbf64PZO62baS6vm2CTYozTFyXKGpu1prhgtfWH1dC1vod018GViV/EW4AYRC6RLF ozeQ== X-Gm-Message-State: APzg51ABe/R5hkzZ12iJBvHcfFjrmrNIrg2lcFfQ2xoA++O6rszeEcpl 2F9mtq1sC/aK0oLS+BHgI8896w== X-Google-Smtp-Source: ANB0Vdb2/c1Ewj7xGqP8c3nCRRDeZ1eNh93H9kCtIc1ziv7EtEqfdB7uMEx/sFTu+zJQOOW6uWR72A== X-Received: by 2002:a1c:bc87:: with SMTP id m129-v6mr3043187wmf.158.1537456349445; Thu, 20 Sep 2018 08:12:29 -0700 (PDT) Received: from veci.piliscsaba.redhat.com (catv-212-96-48-140.catv.broadband.hu. [212.96.48.140]) by smtp.gmail.com with ESMTPSA id p89-v6sm55286201wrc.97.2018.09.20.08.12.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Sep 2018 08:12:28 -0700 (PDT) From: Miklos Szeredi To: David Howells Cc: Al Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/6] fsconfig: rename FSCONFIG_CMD_CREATE to FSCONFIG_CMD_OBTAIN Date: Thu, 20 Sep 2018 17:12:14 +0200 Message-Id: <20180920151214.15484-7-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180920151214.15484-1-mszeredi@redhat.com> References: <20180920151214.15484-1-mszeredi@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The old name strongly implies that a new superblock will be created from the fs_context. This is not true: filesystems are free to retuse an existing superblock and return that (for good reason). To avoid confusion, rename this command to something more appropriate. Signed-off-by: Miklos Szeredi --- fs/fsopen.c | 6 +++--- include/uapi/linux/fs.h | 2 +- samples/vfs/test-fsmount.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/fsopen.c b/fs/fsopen.c index 9ead9220e2cb..bf1ff70b1fe2 100644 --- a/fs/fsopen.c +++ b/fs/fsopen.c @@ -311,7 +311,7 @@ static int vfs_fsconfig_action(struct fs_context *fc, enum fsconfig_command cmd) int ret = -EINVAL; switch (cmd) { - case FSCONFIG_CMD_CREATE: + case FSCONFIG_CMD_OBTAIN: if (fc->phase != FS_CONTEXT_CREATE_PARAMS) return -EBUSY; fc->phase = FS_CONTEXT_CREATING; @@ -434,7 +434,7 @@ SYSCALL_DEFINE5(fsconfig, if (!_key || _value || aux < 0) return -EINVAL; break; - case FSCONFIG_CMD_CREATE: + case FSCONFIG_CMD_OBTAIN: case FSCONFIG_CMD_RECONFIGURE: if (_key || _value || aux) return -EINVAL; @@ -523,7 +523,7 @@ SYSCALL_DEFINE5(fsconfig, ret = mutex_lock_interruptible(&fc->uapi_mutex); if (ret == 0) { switch (cmd) { - case FSCONFIG_CMD_CREATE: + case FSCONFIG_CMD_OBTAIN: case FSCONFIG_CMD_RECONFIGURE: ret = vfs_fsconfig_action(fc, cmd); break; diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h index 7f01503a9e9b..169642bb2656 100644 --- a/include/uapi/linux/fs.h +++ b/include/uapi/linux/fs.h @@ -366,7 +366,7 @@ enum fsconfig_command { FSCONFIG_SET_PATH = 3, /* Set parameter, supplying an object by path */ FSCONFIG_SET_PATH_EMPTY = 4, /* Set parameter, supplying an object by (empty) path */ FSCONFIG_SET_FD = 5, /* Set parameter, supplying an object by fd */ - FSCONFIG_CMD_CREATE = 6, /* Invoke superblock creation */ + FSCONFIG_CMD_OBTAIN = 6, /* Obtain new or existing superblock */ FSCONFIG_CMD_RECONFIGURE = 7, /* Invoke superblock reconfiguration */ }; diff --git a/samples/vfs/test-fsmount.c b/samples/vfs/test-fsmount.c index 74124025ade0..a161dc530a91 100644 --- a/samples/vfs/test-fsmount.c +++ b/samples/vfs/test-fsmount.c @@ -101,7 +101,7 @@ int main(int argc, char *argv[]) } E_fsconfig(fsfd, FSCONFIG_SET_STRING, "source", "#grand.central.org:root.cell.", 0); - E_fsconfig(fsfd, FSCONFIG_CMD_CREATE, NULL, NULL, 0); + E_fsconfig(fsfd, FSCONFIG_CMD_OBTAIN, NULL, NULL, 0); mfd = fsmount(fsfd, 0, MS_RDONLY); if (mfd < 0)