Skip to contentSkip to conversation

Add ioctl to set per file 'nodatacow' flag

PATCH In review Amit Gud 1 participant 1 message Jun 13, 2009 Btrfs file system

lore
Share & tools
lore

Amit Gud

author
#0 lore raw

PATCH 2/3 Add ioctl to set per file 'nodatacow' flag

Add an ioctl to set 'nodatacow' flag on per file basis.

fs/btrfs/ioctl.h +2 -0
Index: newformat2/fs/btrfs/ioctl.h
===================================================================
@@ -67,5 +67,7 @@ struct btrfs_ioctl_clone_range_args {
 				   struct btrfs_ioctl_vol_args)
 #define BTRFS_IOC_COMPRESS _IOW(BTRFS_IOCTL_MAGIC, 15, \
 			   struct btrfs_ioctl_vol_args)
+#define BTRFS_IOC_NODATACOW _IOW(BTRFS_IOCTL_MAGIC, 16, \
+			   struct btrfs_ioctl_vol_args)
 
 #endif
fs/btrfs/ioctl.c +2 -0
Index: newformat2/fs/btrfs/ioctl.c
===================================================================
@@ -1328,6 +1328,8 @@ long btrfs_ioctl(struct file *file, unsi
 		return 0;
 	case BTRFS_IOC_COMPRESS:
 		return btrfs_ioctl_inode_flag(file, BTRFS_INODE_NOCOMPRESS, 0);
+	case BTRFS_IOC_NODATACOW:
+		return btrfs_ioctl_inode_flag(file, BTRFS_INODE_NODATACOW, 1);
 	}
 
 	return -ENOTTY;
Signature · 2 lines
May the source be with you.
http://www.cis.ksu.edu/~gud