Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fs: add generic FS_IOC_SHUTDOWN definitions

Currently, several filesystems (e.g., xfs, ext4, btrfs) implement
a "shutdown" or "going down" ioctl to simulate filesystem force a shutdown.
While they often use the same underlying numeric value, the definition is
duplicated across filesystem headers or private definitions.

Add generic definitions for FS_IOC_SHUTDOWN in uapi/linux/fs.h.
This allows new filesystems (like ntfs) to implement this feature using
a standard VFS definition and paves the way for existing filesystems
to unify their definitions later.

The flag names are standardized as FS_SHUTDOWN_* to be consistent with
the ioctl name, replacing the historical GOING_DOWN naming convention.

Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>

+12
+12
include/uapi/linux/fs.h
··· 657 657 __u64 build_id_addr; /* in */ 658 658 }; 659 659 660 + /* 661 + * Shutdown the filesystem. 662 + */ 663 + #define FS_IOC_SHUTDOWN _IOR('X', 125, __u32) 664 + 665 + /* 666 + * Flags for FS_IOC_SHUTDOWN 667 + */ 668 + #define FS_SHUTDOWN_FLAGS_DEFAULT 0x0 669 + #define FS_SHUTDOWN_FLAGS_LOGFLUSH 0x1 /* flush log but not data*/ 670 + #define FS_SHUTDOWN_FLAGS_NOLOGFLUSH 0x2 /* don't flush log nor data */ 671 + 660 672 #endif /* _UAPI_LINUX_FS_H */