diff mbox

[12/13] btrfs-progs: obtain used_bytes in BTRFS_IOC_FS_INFO ioctl

Message ID 1371801485-14571-5-git-send-email-anand.jain@oracle.com (mailing list archive)
State Under Review, archived
Headers show

Commit Message

Anand Jain June 21, 2013, 7:58 a.m. UTC
btrfs-progs has to read fs info from the kernel to
read the latest info instead of reading it from the disks,
which generally is a stale info after certain critical
operation.

getting used_bytes parameter will help to fix
      btrfs filesystem show --kernel
to show the current info of the fs

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 ioctl.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Anand Jain June 25, 2013, 8:39 a.m. UTC | #1
kindly ignore this patch, the feature now is implemented
without adding any _new_ ioctl or _new_ parameters.

Thanks, Anand


On 06/21/2013 03:58 PM, Anand Jain wrote:
> btrfs-progs has to read fs info from the kernel to
> read the latest info instead of reading it from the disks,
> which generally is a stale info after certain critical
> operation.
>
> getting used_bytes parameter will help to fix
>        btrfs filesystem show --kernel
> to show the current info of the fs
>
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
> ---
>   ioctl.h | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/ioctl.h b/ioctl.h
> index a40a4a1..d035201 100644
> --- a/ioctl.h
> +++ b/ioctl.h
> @@ -169,7 +169,8 @@ struct btrfs_ioctl_fs_info_args {
>   	__u64 max_id;				/* out */
>   	__u64 num_devices;			/* out */
>   	__u8 fsid[BTRFS_FSID_SIZE];		/* out */
> -	__u64 reserved[124];			/* pad to 1k */
> +	__u64 used_bytes;			/* out */
> +	__u64 reserved[123];			/* pad to 1k */
>   };
>
>   /* balance control ioctl modes */
>
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/ioctl.h b/ioctl.h
index a40a4a1..d035201 100644
--- a/ioctl.h
+++ b/ioctl.h
@@ -169,7 +169,8 @@  struct btrfs_ioctl_fs_info_args {
 	__u64 max_id;				/* out */
 	__u64 num_devices;			/* out */
 	__u8 fsid[BTRFS_FSID_SIZE];		/* out */
-	__u64 reserved[124];			/* pad to 1k */
+	__u64 used_bytes;			/* out */
+	__u64 reserved[123];			/* pad to 1k */
 };
 
 /* balance control ioctl modes */