[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260112174629.3729358-6-cel@kernel.org>
Date: Mon, 12 Jan 2026 12:46:18 -0500
From: Chuck Lever <cel@...nel.org>
To: vira@....codeaurora.org, Christian Brauner <brauner@...nel.org>,
Jan Kara <jack@...e.cz>
Cc: <linux-fsdevel@...r.kernel.org>,
linux-ext4@...r.kernel.org,
linux-xfs@...r.kernel.org,
linux-cifs@...r.kernel.org,
<linux-nfs@...r.kernel.org>,
linux-f2fs-devel@...ts.sourceforge.net,
hirofumi@...l.parknet.co.jp,
linkinjeon@...nel.org,
sj1557.seo@...sung.com,
yuezhang.mo@...y.com,
almaz.alexandrovich@...agon-software.com,
slava@...eyko.com,
glaubitz@...sik.fu-berlin.de,
frank.li@...o.com,
tytso@....edu,
adilger.kernel@...ger.ca,
cem@...nel.org,
sfrench@...ba.org,
pc@...guebit.org,
ronniesahlberg@...il.com,
sprasad@...rosoft.com,
trondmy@...nel.org,
anna@...nel.org,
jaegeuk@...nel.org,
chao@...nel.org,
hansg@...nel.org,
senozhatsky@...omium.org,
Chuck Lever <chuck.lever@...cle.com>
Subject: [PATCH v3 05/16] hfs: Implement fileattr_get for case sensitivity
From: Chuck Lever <chuck.lever@...cle.com>
Report HFS case sensitivity behavior via the file_kattr boolean
fields. HFS is always case-insensitive (using Mac OS Roman case
folding) and always preserves case at rest.
Signed-off-by: Chuck Lever <chuck.lever@...cle.com>
---
fs/hfs/dir.c | 1 +
fs/hfs/hfs_fs.h | 2 ++
fs/hfs/inode.c | 13 +++++++++++++
3 files changed, 16 insertions(+)
diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c
index 86a6b317b474..552156896105 100644
--- a/fs/hfs/dir.c
+++ b/fs/hfs/dir.c
@@ -321,4 +321,5 @@ const struct inode_operations hfs_dir_inode_operations = {
.rmdir = hfs_remove,
.rename = hfs_rename,
.setattr = hfs_inode_setattr,
+ .fileattr_get = hfs_fileattr_get,
};
diff --git a/fs/hfs/hfs_fs.h b/fs/hfs/hfs_fs.h
index e94dbc04a1e4..a25cdda8ab34 100644
--- a/fs/hfs/hfs_fs.h
+++ b/fs/hfs/hfs_fs.h
@@ -177,6 +177,8 @@ extern int hfs_get_block(struct inode *inode, sector_t block,
extern const struct address_space_operations hfs_aops;
extern const struct address_space_operations hfs_btree_aops;
+struct file_kattr;
+int hfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa);
int hfs_write_begin(const struct kiocb *iocb, struct address_space *mapping,
loff_t pos, unsigned int len, struct folio **foliop,
void **fsdata);
diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c
index 524db1389737..06429decc1d8 100644
--- a/fs/hfs/inode.c
+++ b/fs/hfs/inode.c
@@ -18,6 +18,7 @@
#include <linux/uio.h>
#include <linux/xattr.h>
#include <linux/blkdev.h>
+#include <linux/fileattr.h>
#include "hfs_fs.h"
#include "btree.h"
@@ -698,6 +699,17 @@ static int hfs_file_fsync(struct file *filp, loff_t start, loff_t end,
return ret;
}
+int hfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa)
+{
+ /*
+ * HFS is always case-insensitive (using Mac OS Roman case
+ * folding) and always preserves case at rest.
+ */
+ fa->case_insensitive = true;
+ fa->case_preserving = true;
+ return 0;
+}
+
static const struct file_operations hfs_file_operations = {
.llseek = generic_file_llseek,
.read_iter = generic_file_read_iter,
@@ -714,4 +726,5 @@ static const struct inode_operations hfs_file_inode_operations = {
.lookup = hfs_file_lookup,
.setattr = hfs_inode_setattr,
.listxattr = generic_listxattr,
+ .fileattr_get = hfs_fileattr_get,
};
--
2.52.0
Powered by blists - more mailing lists