From: Dave Chinner <david@fromorbit.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: Eric Sandeen <sandeen@redhat.com>, linux-xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH 5/5 V3] xfs_io: add label command
Date: Fri, 18 May 2018 07:56:55 +1000 [thread overview]
Message-ID: <20180517215655.GA23861@dastard> (raw)
In-Reply-To: <9cee370a-41e2-6dae-4ae1-97fbd7393d38@sandeen.net>
On Thu, May 17, 2018 at 10:22:09AM -0500, Eric Sandeen wrote:
> This adds an online get/set/clear label command to xfs_io.
>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
> +static int
> +label_f(
> + int argc,
> + char **argv)
> +{
> + int c;
> + int error;
> + char label[FSLABEL_MAX];
> +
> + if (argc == 1) {
> + memset(label, 0, sizeof(label));
> + error = ioctl(file->fd, FS_IOC_GETFSLABEL, &label);
> + goto out;
> + }
> +
> + while ((c = getopt(argc, argv, "cs:")) != EOF) {
> + switch (c) {
> + case 'c':
> + label[0] = '\0';
> + break;
> + case 's':
> + strncpy(label, optarg, sizeof(label));
> + break;
> + default:
exitcode = 1
;
> + return command_usage(&label_cmd);
> + }
> + }
> +
> + /* Check for trailing arguments */
> + if (argc != optind)
exitcode = 1
> + return command_usage(&label_cmd);
> +
> + error = ioctl(file->fd, FS_IOC_SETFSLABEL, label);
> +out:
> + if (error) {
> + perror("label");
> + exitcode = 1;
> + } else {
> + printf("label = \"%s\"\n", label);
> + }
> +
> + return 0;
Otherwise looks OK.
Reviewed-by: Dave Chinner <dchinner@redhat.com>
--
Dave Chinner
david@fromorbit.com
prev parent reply other threads:[~2018-05-17 21:56 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-14 17:30 [PATCH V2 0/5] xfs: online label Eric Sandeen
2018-05-14 17:35 ` [PATCH V2 1/5] fs: copy BTRFS_IOC_[SG]ET_FSLABEL to vfs Eric Sandeen
2018-05-14 17:37 ` Darrick J. Wong
2018-05-14 17:36 ` [PATCH 2/4] xfs: New function for secondary superblock updates Eric Sandeen
2018-05-15 20:17 ` Darrick J. Wong
2018-05-14 17:39 ` [PATCH 3/5 V2] xfs: implement online get/set fs label Eric Sandeen
2018-05-15 1:07 ` Darrick J. Wong
2018-05-16 1:04 ` Darrick J. Wong
2018-05-14 17:42 ` [PATCH 4/5] btrfs: use common label ioctl definitions Eric Sandeen
2018-05-14 21:41 ` Darrick J. Wong
2018-05-14 17:43 ` [PATCH 5/5] xfs_io: add label command Eric Sandeen
2018-05-15 4:32 ` Dave Chinner
2018-05-15 15:06 ` Eric Sandeen
2018-05-16 0:57 ` Dave Chinner
2018-05-15 15:32 ` [PATCH 5/5 V2] " Eric Sandeen
2018-05-15 20:12 ` Darrick J. Wong
2018-05-17 15:22 ` [PATCH 5/5 V3] " Eric Sandeen
2018-05-17 21:56 ` Dave Chinner [this message]
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=20180517215655.GA23861@dastard \
--to=david@fromorbit.com \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@redhat.com \
--cc=sandeen@sandeen.net \
/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).