From b3152e2c7aa9ad0c50085738d048fbf16d01d32d Mon Sep 17 00:00:00 2001 From: Steve French Date: Wed, 24 Jun 2015 03:17:02 -0500 Subject: Add ioctl to set integrity set integrity increases reliability of files stored on SMB3 servers. Add ioctl to allow setting this on files on SMB3 and later mounts. Signed-off-by: Steve French --- fs/cifs/ioctl.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'fs/cifs/ioctl.c') diff --git a/fs/cifs/ioctl.c b/fs/cifs/ioctl.c index 7843b19ef5be..49b8b6e41a18 100644 --- a/fs/cifs/ioctl.c +++ b/fs/cifs/ioctl.c @@ -35,6 +35,7 @@ #define CIFS_IOCTL_MAGIC 0xCF #define CIFS_IOC_COPYCHUNK_FILE _IOW(CIFS_IOCTL_MAGIC, 3, int) +#define CIFS_IOC_SET_INTEGRITY _IO(CIFS_IOCTL_MAGIC, 4) static long cifs_ioctl_clone(unsigned int xid, struct file *dst_file, unsigned long srcfd, u64 off, u64 len, u64 destoff, @@ -217,6 +218,16 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) case BTRFS_IOC_CLONE: rc = cifs_ioctl_clone(xid, filep, arg, 0, 0, 0, true); break; + case CIFS_IOC_SET_INTEGRITY: + if (pSMBFile == NULL) + break; + tcon = tlink_tcon(pSMBFile->tlink); + if (tcon->ses->server->ops->set_integrity) + rc = tcon->ses->server->ops->set_integrity(xid, + tcon, pSMBFile); + else + rc = -EOPNOTSUPP; + break; default: cifs_dbg(FYI, "unsupported ioctl\n"); break; -- cgit v1.2.3