linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miklos Szeredi <mszeredi@redhat.com>
To: David Howells <dhowells@redhat.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>,
	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	[thread overview]
Message-ID: <20180920151214.15484-7-mszeredi@redhat.com> (raw)
In-Reply-To: <20180920151214.15484-1-mszeredi@redhat.com>

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 <mszeredi@redhat.com>
---
 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)
-- 
2.14.3

  parent reply	other threads:[~2018-09-20 20:56 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-20 15:12 [PATCH 0/6] mount-api: fixes and cleanups Miklos Szeredi
2018-09-20 15:12 ` [PATCH 1/6] selinux: fold superblock_doinit() into only caller Miklos Szeredi
2018-09-20 15:12 ` [PATCH 2/6] vfs_submount: use SB_SUBMOUNT instead of MS_SUBMOUNT Miklos Szeredi
2018-09-20 15:12 ` [PATCH 3/6] mount: fix regression in setting "subtype" from legacy API Miklos Szeredi
2018-09-20 15:12 ` [PATCH 4/6] fsconfig: parse "subtype" param for old internal API Miklos Szeredi
2018-09-20 15:12 ` [PATCH 5/6] fsmount: do not use legacy MS_ flags Miklos Szeredi
2018-09-20 15:12 ` Miklos Szeredi [this message]
2018-09-21 14:41 ` [PATCH 1/6] selinux: fold superblock_doinit() into only caller David Howells
2018-09-21 14:45 ` [PATCH 2/6] vfs_submount: use SB_SUBMOUNT instead of MS_SUBMOUNT David Howells
2018-09-21 14:52 ` [PATCH 3/6] mount: fix regression in setting "subtype" from legacy API David Howells
2018-09-21 14:56 ` [PATCH 4/6] fsconfig: parse "subtype" param for old internal API David Howells
2018-09-21 15:07 ` [PATCH 5/6] fsmount: do not use legacy MS_ flags David Howells
2018-09-21 15:28   ` Miklos Szeredi
2018-09-21 15:37   ` David Howells
2018-09-21 15:54   ` Christian Brauner
2018-09-21 16:52   ` David Howells
2018-09-22 13:21     ` Christian Brauner
2018-09-22 15:48     ` David Howells
2018-09-22 16:14       ` Christian Brauner
2018-09-23 22:45       ` David Howells
2018-09-23 23:01         ` Christian Brauner
2018-09-24  6:50         ` David Howells
2018-09-24  9:47           ` Christian Brauner
2018-09-24 12:37           ` David Howells
2018-09-24 13:18             ` Christian Brauner
2018-09-21 15:11 ` [PATCH 6/6] fsconfig: rename FSCONFIG_CMD_CREATE to FSCONFIG_CMD_OBTAIN David Howells
2018-09-21 15:23   ` Miklos Szeredi
2018-09-21 16:44 ` [PATCH 0/6] mount-api: fixes and cleanups David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180920151214.15484-7-mszeredi@redhat.com \
    --to=mszeredi@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).