Enable previous version support
Add ioctl to query previous versions of file Allows listing snapshots on files on SMB3 mounts. Signed-off-by: Steve French <smfrench@gmail.com>
This commit is contained in:
@@ -189,7 +189,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
|
||||
xid = get_xid();
|
||||
|
||||
cifs_sb = CIFS_SB(inode->i_sb);
|
||||
|
||||
cifs_dbg(VFS, "cifs ioctl 0x%x\n", command);
|
||||
switch (command) {
|
||||
case FS_IOC_GETFLAGS:
|
||||
if (pSMBFile == NULL)
|
||||
@@ -267,11 +267,23 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
|
||||
tcon = tlink_tcon(pSMBFile->tlink);
|
||||
rc = smb_mnt_get_fsinfo(xid, tcon, (void __user *)arg);
|
||||
break;
|
||||
case CIFS_ENUMERATE_SNAPSHOTS:
|
||||
if (arg == 0) {
|
||||
rc = -EINVAL;
|
||||
goto cifs_ioc_exit;
|
||||
}
|
||||
tcon = tlink_tcon(pSMBFile->tlink);
|
||||
if (tcon->ses->server->ops->enum_snapshots)
|
||||
rc = tcon->ses->server->ops->enum_snapshots(xid, tcon,
|
||||
pSMBFile, (void __user *)arg);
|
||||
else
|
||||
rc = -EOPNOTSUPP;
|
||||
break;
|
||||
default:
|
||||
cifs_dbg(FYI, "unsupported ioctl\n");
|
||||
break;
|
||||
}
|
||||
|
||||
cifs_ioc_exit:
|
||||
free_xid(xid);
|
||||
return rc;
|
||||
}
|
||||
|
Reference in New Issue
Block a user