From: Chuck Lever <[email protected]>

Add case sensitivity reporting to the existing hfsplus_fileattr_get()
function. HFS+ always preserves case at rest.

Case sensitivity depends on how the volume was formatted: HFSX
volumes may be either case-sensitive or case-insensitive, indicated
by the HFSPLUS_SB_CASEFOLD superblock flag.

Signed-off-by: Chuck Lever <[email protected]>
---
 fs/hfsplus/inode.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c
index 7ae6745ca7ae..0ce9561c0f18 100644
--- a/fs/hfsplus/inode.c
+++ b/fs/hfsplus/inode.c
@@ -694,6 +694,7 @@ int hfsplus_fileattr_get(struct dentry *dentry, struct 
file_kattr *fa)
 {
        struct inode *inode = d_inode(dentry);
        struct hfsplus_inode_info *hip = HFSPLUS_I(inode);
+       struct hfsplus_sb_info *sbi = HFSPLUS_SB(inode->i_sb);
        unsigned int flags = 0;
 
        if (inode->i_flags & S_IMMUTABLE)
@@ -705,6 +706,14 @@ int hfsplus_fileattr_get(struct dentry *dentry, struct 
file_kattr *fa)
 
        fileattr_fill_flags(fa, flags);
 
+       /*
+        * HFS+ always preserves case. Case sensitivity depends on how
+        * the filesystem was formatted: HFSX volumes may be either
+        * case-sensitive or case-insensitive.
+        */
+       fa->case_insensitive = test_bit(HFSPLUS_SB_CASEFOLD, &sbi->flags);
+       fa->case_preserving = true;
+
        return 0;
 }
 
-- 
2.52.0



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to