mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Namjae Jeon <linkinjeon@kernel.org>
Cc: viro@zeniv.linux.org.uk, brauner@kernel.org, hch@lst.de,
	tytso@mit.edu, willy@infradead.org, jack@suse.cz,
	josef@toxicpanda.com, sandeen@sandeen.net, rgoldwyn@suse.com,
	xiang@kernel.org, dsterba@suse.com, pali@kernel.org,
	ebiggers@kernel.org, neil@brown.name, amir73il@gmail.com,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	iamjoonsoo.kim@lge.com, cheol.lee@lge.com, jay.sim@lge.com,
	gunho.lee@lge.com
Subject: Re: [PATCH v6 03/16] fs: add generic FS_IOC_SHUTDOWN definitions
Date: Mon, 2 Feb 2026 14:36:57 -0800	[thread overview]
Message-ID: <20260202223657.GB1535390@frogsfrogsfrogs> (raw)
In-Reply-To: <20260202220202.10907-4-linkinjeon@kernel.org>

On Tue, Feb 03, 2026 at 07:01:49AM +0900, Namjae Jeon wrote:
> 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.
> 
> This patch adds 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.
> 
> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
> ---
>  include/uapi/linux/fs.h | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h
> index 66ca526cf786..32e24778c9e5 100644
> --- a/include/uapi/linux/fs.h
> +++ b/include/uapi/linux/fs.h
> @@ -656,4 +656,16 @@ struct procmap_query {
>  	__u64 build_id_addr;		/* in */
>  };
>  
> +/*
> + * Shutdown the filesystem.
> + */
> +#define FS_IOC_SHUTDOWN _IOR('X', 125, __u32)
> +
> +/*
> + * Flags for FS_IOC_SHUTDOWN
> + */
> +#define FS_SHUTDOWN_FLAGS_DEFAULT	0x0
> +#define FS_SHUTDOWN_FLAGS_LOGFLUSH	0x1	/* flush log but not data*/
> +#define FS_SHUTDOWN_FLAGS_NOLOGFLUSH	0x2	/* don't flush log nor data */

Hoisting this to reduce the copy-pasting already going on in filesystems
sounds like a good idea to me:

$ git grep '_IOR.*X.*125'
fs/ntfs3/file.c:26:#define NTFS3_IOC_SHUTDOWN _IOR('X', 125, __u32)
fs/smb/client/cifs_ioctl.h:117:#define CIFS_IOC_SHUTDOWN _IOR('X', 125, __u32)
fs/xfs/libxfs/xfs_fs.h:1266:#define XFS_IOC_GOINGDOWN        _IOR ('X', 125, uint32_t)
include/uapi/linux/btrfs.h:1230:#define BTRFS_IOC_SHUTDOWN      _IOR('X', 125, __u32)
include/uapi/linux/exfat.h:15:#define EXFAT_IOC_SHUTDOWN _IOR('X', 125, __u32)
include/uapi/linux/ext4.h:39:#define EXT4_IOC_SHUTDOWN _IOR('X', 125, __u32)
include/uapi/linux/f2fs.h:53:#define F2FS_IOC_SHUTDOWN  _IOR('X', 125, __u32)   /* Shutdown */

Christian: any chance we could get this api cleanup queued for 7.0 even
though we're past -rc8?

Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> +
>  #endif /* _UAPI_LINUX_FS_H */
> -- 
> 2.25.1
> 

  reply	other threads:[~2026-02-02 22:36 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-02 22:01 [PATCH v6 00/16] ntfs filesystem remake Namjae Jeon
2026-02-02 22:01 ` [PATCH v6 01/16] Revert "fs: Remove NTFS classic" Namjae Jeon
2026-02-02 22:01 ` [PATCH v6 02/16] Documentation: filesystems: update NTFS driver documentation Namjae Jeon
2026-02-03  5:44   ` Christoph Hellwig
2026-02-03 13:01     ` Namjae Jeon
2026-02-02 22:01 ` [PATCH v6 03/16] fs: add generic FS_IOC_SHUTDOWN definitions Namjae Jeon
2026-02-02 22:36   ` Darrick J. Wong [this message]
2026-02-03  5:38     ` Christoph Hellwig
2026-02-03  8:54   ` Jan Kara
2026-02-02 22:01 ` [PATCH v6 04/16] ntfs: update in-memory, on-disk structures and headers Namjae Jeon
2026-02-03  5:47   ` Christoph Hellwig
2026-02-03 13:03     ` Namjae Jeon
2026-02-02 22:01 ` [PATCH v6 05/16] ntfs: update super block operations Namjae Jeon
2026-02-03  5:52   ` Christoph Hellwig
2026-02-03 13:04     ` Namjae Jeon
2026-02-02 22:01 ` [PATCH v6 07/16] ntfs: update directory operations Namjae Jeon
2026-02-03  5:55   ` Christoph Hellwig
2026-02-03 13:04     ` Namjae Jeon
2026-02-02 22:01 ` [PATCH v6 08/16] ntfs: update file operations Namjae Jeon
2026-02-03  6:07   ` Christoph Hellwig
2026-02-03 13:08     ` Namjae Jeon
2026-02-02 22:01 ` [PATCH v6 09/16] ntfs: update iomap and address space operations Namjae Jeon
2026-02-03  6:20   ` Christoph Hellwig
2026-02-03 14:05     ` Namjae Jeon
2026-02-02 22:01 ` [PATCH v6 10/16] ntfs: update attrib operations Namjae Jeon
2026-02-03  6:22   ` Christoph Hellwig
2026-02-03 14:06     ` Namjae Jeon
2026-02-02 22:01 ` [PATCH v6 11/16] ntfs: update runlist handling and cluster allocator Namjae Jeon
2026-02-03  6:34   ` Christoph Hellwig
2026-02-03 14:22     ` Namjae Jeon
2026-02-02 22:01 ` [PATCH v6 12/16] ntfs: add reparse and ea operations Namjae Jeon
2026-02-03  6:37   ` Christoph Hellwig
2026-02-03 14:17     ` Namjae Jeon
2026-02-02 22:02 ` [PATCH v6 14/16] ntfs3: remove legacy ntfs driver support Namjae Jeon
2026-02-02 22:02 ` [PATCH v6 15/16] ntfs: add Kconfig and Makefile Namjae Jeon
2026-02-03  6:38   ` Christoph Hellwig
2026-02-02 22:02 ` [PATCH v6 16/16] MAINTAINERS: update ntfs filesystem entry Namjae Jeon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260202223657.GB1535390@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=amir73il@gmail.com \
    --cc=brauner@kernel.org \
    --cc=cheol.lee@lge.com \
    --cc=dsterba@suse.com \
    --cc=ebiggers@kernel.org \
    --cc=gunho.lee@lge.com \
    --cc=hch@lst.de \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=jack@suse.cz \
    --cc=jay.sim@lge.com \
    --cc=josef@toxicpanda.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neil@brown.name \
    --cc=pali@kernel.org \
    --cc=rgoldwyn@suse.com \
    --cc=sandeen@sandeen.net \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.org \
    --cc=xiang@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®