From: Nikolay Borisov <nborisov@suse.com>
To: Johannes Thumshirn <johannes.thumshirn@wdc.com>,
David Sterba <dsterba@suse.cz>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 2/4] btrfs: add filesystem generation to fsinfo ioctl
Date: Wed, 15 Jul 2020 10:21:59 +0300 [thread overview]
Message-ID: <c4c9192a-83dd-d9f8-7975-800464e8ceb5@suse.com> (raw)
In-Reply-To: <20200713122901.1773-3-johannes.thumshirn@wdc.com>
On 13.07.20 г. 15:28 ч., Johannes Thumshirn wrote:
> Add retrieval of the filesystem's generation to the fsinfo ioctl. This is
> driven by setting the BTRFS_FS_INFO_FLAG_GENERATION flag in
> btrfs_ioctl_fs_info_args::flags.
>
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
> ---
> fs/btrfs/ioctl.c | 5 +++++
> include/uapi/linux/btrfs.h | 6 +++++-
> 2 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> index 3a566cf71fc6..f1b433ec09e8 100644
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -3247,6 +3247,11 @@ static long btrfs_ioctl_fs_info(struct btrfs_fs_info *fs_info,
> fi_args->flags |= BTRFS_FS_INFO_FLAG_CSUM_INFO;
> }
>
> + if (flags_in & BTRFS_FS_INFO_FLAG_GENERATION) {
> + fi_args->generation = fs_info->generation;
> + fi_args->flags |= BTRFS_FS_INFO_FLAG_GENERATION;
> + }
> +
> if (copy_to_user(arg, fi_args, sizeof(*fi_args)))
> ret = -EFAULT;
>
> diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
> index b3e0af77642f..b8373723eb4a 100644
> --- a/include/uapi/linux/btrfs.h
> +++ b/include/uapi/linux/btrfs.h
> @@ -250,6 +250,9 @@ struct btrfs_ioctl_dev_info_args {
> /* Request information about checksum type and size */
> #define BTRFS_FS_INFO_FLAG_CSUM_INFO (1 << 0)
>
> +/* Request information about filesystem generation */
> +#define BTRFS_FS_INFO_FLAG_GENERATION (1 << 1)
> +
> struct btrfs_ioctl_fs_info_args {
> __u64 max_id; /* out */
> __u64 num_devices; /* out */
> @@ -261,7 +264,8 @@ struct btrfs_ioctl_fs_info_args {
> __u16 csum_type; /* out */
> __u16 csum_size; /* out */
> __u64 flags; /* in/out */
> - __u8 reserved[968]; /* pad to 1k */
> + __u64 generation; /* out */
> + __u8 reserved[960]; /* pad to 1k */
> };
>
>
>
next prev parent reply other threads:[~2020-07-15 7:22 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-13 12:28 [PATCH v2 0/4] Two furhter additions for fsinfo ioctl Johannes Thumshirn
2020-07-13 12:28 ` [PATCH v2 1/4] btrfs: pass checksum type via BTRFS_IOC_FS_INFO ioctl Johannes Thumshirn
2020-07-13 14:27 ` David Sterba
2020-07-13 14:28 ` Johannes Thumshirn
2020-07-13 14:50 ` David Sterba
2020-07-13 12:28 ` [PATCH v2 2/4] btrfs: add filesystem generation to fsinfo ioctl Johannes Thumshirn
2020-07-15 7:21 ` Nikolay Borisov [this message]
2020-07-13 12:29 ` [PATCH v2 3/4] btrfs: add metadata_uuid " Johannes Thumshirn
2020-07-15 7:22 ` Nikolay Borisov
2020-07-13 12:29 ` [PATCH v2 4/4] btrfs: assert sizes of ioctl structures Johannes Thumshirn
2020-07-13 14:58 ` David Sterba
2020-07-13 16:13 ` Johannes Thumshirn
2020-07-13 21:01 ` kernel test robot
2020-07-14 11:20 ` David Sterba
2020-07-14 11:23 ` David Sterba
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=c4c9192a-83dd-d9f8-7975-800464e8ceb5@suse.com \
--to=nborisov@suse.com \
--cc=dsterba@suse.cz \
--cc=johannes.thumshirn@wdc.com \
--cc=linux-btrfs@vger.kernel.org \
/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