summaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifs_ioctl.h
diff options
context:
space:
mode:
authorSteve French <stfrench@microsoft.com>2021-04-29 00:18:43 -0500
committerSteve French <stfrench@microsoft.com>2021-05-03 11:21:22 -0500
commit087f757b0129850c99cc9116df4909dac1bce871 (patch)
treec284e0a56d512373e466b67aaed48a60403ae7c5 /fs/cifs/cifs_ioctl.h
parentc3f207ab29f793b8c942ce8067ed123f18d5b81b (diff)
downloadlinux-stable-087f757b0129850c99cc9116df4909dac1bce871.tar.gz
linux-stable-087f757b0129850c99cc9116df4909dac1bce871.tar.bz2
linux-stable-087f757b0129850c99cc9116df4909dac1bce871.zip
cifs: add shutdown support
Various filesystem support the shutdown ioctl which is used by various xfstests. The shutdown ioctl sets a flag on the superblock which prevents open, unlink, symlink, hardlink, rmdir, create etc. on the file system until unmount and remounted. The two flags supported in this patch are: FSOP_GOING_FLAGS_LOGFLUSH and FSOP_GOING_FLAGS_NOLOGFLUSH which require very little other than blocking new operations (since we do not cache writes to metadata on the client with cifs.ko). FSOP_GOING_FLAGS_DEFAULT is not supported yet, but could be added in the future but would need to call syncfs or equivalent to write out pending data on the mount. With this patch various xfstests now work including tests 043 through 046 for example. Signed-off-by: Steve French <stfrench@microsoft.com> Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Diffstat (limited to 'fs/cifs/cifs_ioctl.h')
-rw-r--r--fs/cifs/cifs_ioctl.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/cifs/cifs_ioctl.h b/fs/cifs/cifs_ioctl.h
index 153d5c842a9b..f262c64516bc 100644
--- a/fs/cifs/cifs_ioctl.h
+++ b/fs/cifs/cifs_ioctl.h
@@ -78,3 +78,19 @@ struct smb3_notify {
#define CIFS_QUERY_INFO _IOWR(CIFS_IOCTL_MAGIC, 7, struct smb_query_info)
#define CIFS_DUMP_KEY _IOWR(CIFS_IOCTL_MAGIC, 8, struct smb3_key_debug_info)
#define CIFS_IOC_NOTIFY _IOW(CIFS_IOCTL_MAGIC, 9, struct smb3_notify)
+#define CIFS_IOC_SHUTDOWN _IOR ('X', 125, __u32)
+
+/*
+ * Flags for going down operation
+ */
+#define CIFS_GOING_FLAGS_DEFAULT 0x0 /* going down */
+#define CIFS_GOING_FLAGS_LOGFLUSH 0x1 /* flush log but not data */
+#define CIFS_GOING_FLAGS_NOLOGFLUSH 0x2 /* don't flush log nor data */
+
+static inline bool cifs_forced_shutdown(struct cifs_sb_info *sbi)
+{
+ if (CIFS_MOUNT_SHUTDOWN & sbi->mnt_cifs_flags)
+ return true;
+ else
+ return false;
+}