]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bcachefs: Don't set bi_casefold on non directories
authorKent Overstreet <kent.overstreet@linux.dev>
Mon, 19 May 2025 13:15:31 +0000 (09:15 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Thu, 22 May 2025 00:15:08 +0000 (20:15 -0400)
bi_casefold only makes sense for directories, and since it's one of the
variable length fields setting it unnecessarily wastes space.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/inode.c

index a17a952ea161fc0c2dccb0eae303975798d2add0..ee00805078558362c5872e11c3a1edf3262b371f 100644 (file)
@@ -856,6 +856,9 @@ void bch2_inode_init_late(struct bch_inode_unpacked *inode_u, u64 now,
                BCH_INODE_OPTS()
 #undef x
        }
+
+       if (!S_ISDIR(mode))
+               inode_u->bi_casefold = 0;
 }
 
 void bch2_inode_init(struct bch_fs *c, struct bch_inode_unpacked *inode_u,