On Wed 14-01-26 09:28:44, Chuck Lever wrote:
> From: Chuck Lever <[email protected]>
>
> Enable upper layers such as NFSD to retrieve case sensitivity
> information from file systems by adding case_insensitive and
> case_nonpreserving boolean fields to struct file_kattr.
>
> These fields default to false (POSIX semantics: case-sensitive and
> case-preserving), allowing filesystems to set them only when
> behavior differs from the default.
>
> Signed-off-by: Chuck Lever <[email protected]>
...
> diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h
> index 66ca526cf786..07286d34b48b 100644
> --- a/include/uapi/linux/fs.h
> +++ b/include/uapi/linux/fs.h
> @@ -229,10 +229,20 @@ struct file_attr {
> __u32 fa_nextents; /* nextents field value (get) */
> __u32 fa_projid; /* project identifier (get/set) */
> __u32 fa_cowextsize; /* CoW extsize field value (get/set) */
> + /* VER1 additions: */
> + __u32 fa_case_behavior; /* case sensitivity (get) */
> + __u32 fa_reserved;
> };
>
> #define FILE_ATTR_SIZE_VER0 24
> -#define FILE_ATTR_SIZE_LATEST FILE_ATTR_SIZE_VER0
> +#define FILE_ATTR_SIZE_VER1 32
> +#define FILE_ATTR_SIZE_LATEST FILE_ATTR_SIZE_VER1
> +
> +/*
> + * Case sensitivity flags for fa_case_behavior
> + */
> +#define FS_CASE_INSENSITIVE 0x00000001 /* case-insensitive lookups */
> +#define FS_CASE_NONPRESERVING 0x00000002 /* case not preserved */
This is a matter of taste so not sure what others think about it but
file_attr already have fa_xflags field and there is already one flag which
doesn't directly correspond to on-disk representation (FS_XFLAG_HASATTR) so
we could also put the two new flags in there... I have hard time imagining
fa_case_behavior would grow past the two flags you've introduced so u32
seems a bit wasteful.
Honza
--
Jan Kara <[email protected]>
SUSE Labs, CR
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel