progs: Add BTRFS_IOC_NODATASUM ioctl to progs
PATCH 3/3 progs: Add BTRFS_IOC_NODATASUM ioctl to progs
Add the new ioctl to progs.
Signed-off-by Amit Gud <[email protected]>
btrfsctl.c +7 -0
@@ -57,6 +57,7 @@ static void print_usage(void)printf ("\t-c: forces a single FS sync\n" );printf ("\t--compress filename: sets compress flag on the file\n" );printf ("\t--nodatacow filename: sets nodatacow flag on the file\n" ); +printf ("\t--nodatasum filename: sets nodatasum flag on the file\n" );printf ("%s\n" ,BTRFS_BUILD_VERSION );exit (1 ); }
@@ -192,6 +193,12 @@ int main(int ac, char **av)print_usage (); } command =BTRFS_IOC_NODATACOW ; + }else if (strcmp (av[i],"--nodatasum" ) ==0 ) { +if (i >= ac -1 ) { +fprintf (stderr,"-r requires an arg\n" ); +print_usage (); + } + command =BTRFS_IOC_NODATASUM ; } }if (command ==0 ) {
ioctl.h +2 -0
@@ -60,4 +60,6 @@ struct btrfs_ioctl_vol_args { struct btrfs_ioctl_vol_args)#define BTRFS_IOC_NODATACOW _IOW(BTRFS_IOCTL_MAGIC, 16, \ struct btrfs_ioctl_vol_args) +#define BTRFS_IOC_NODATASUM _IOW(BTRFS_IOCTL_MAGIC, 17, \ + struct btrfs_ioctl_vol_args)#endif
Signature · 2 lines
May the source be with you. http://www.cis.ksu.edu/~gud