]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
exfat: add exfat_file_open()
authorNamjae Jeon <linkinjeon@kernel.org>
Fri, 8 May 2026 05:33:35 +0000 (14:33 +0900)
committerNamjae Jeon <linkinjeon@kernel.org>
Mon, 15 Jun 2026 10:55:39 +0000 (19:55 +0900)
Add exfat_file_open() to handle file open operation for exFAT.
This change is a preparation step before introducing iomap-based direct
IO support.

Acked-by: Christoph Hellwig <hch@lst.de>
Acked-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
fs/exfat/file.c

index 935dcc803ebb51767b44a482e6d6da284c9fe04c..857cd3030cae77f97ed00cfec9faba7b9f09ad66 100644 (file)
@@ -813,7 +813,16 @@ static ssize_t exfat_splice_read(struct file *in, loff_t *ppos,
        return filemap_splice_read(in, ppos, pipe, len, flags);
 }
 
+static int exfat_file_open(struct inode *inode, struct file *filp)
+{
+       if (unlikely(exfat_forced_shutdown(inode->i_sb)))
+               return -EIO;
+
+       return generic_file_open(inode, filp);
+}
+
 const struct file_operations exfat_file_operations = {
+       .open           = exfat_file_open,
        .llseek         = generic_file_llseek,
        .read_iter      = exfat_file_read_iter,
        .write_iter     = exfat_file_write_iter,