mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
Support for longnames for files/directories (Linux part)
This patch adds the ability for zfs to support file/dir name up to 1023 bytes. This number is chosen so we can support up to 255 4-byte characters. This new feature is represented by the new feature flag feature@longname. A new dataset property "longname" is also introduced to toggle longname support for each dataset individually. This property can be disabled, even if it contains longname files. In such case, new file cannot be created with longname but existing longname files can still be looked up. Note that, to my knowledge native Linux filesystems don't support name longer than 255 bytes. So there might be programs not able to work with longname. Note that NFS server may needs to use exportfs_get_name to reconnect dentries, and the buffer being passed is limit to NAME_MAX+1 (256). So NFS may not work when longname is enabled. Note, FreeBSD vfs layer imposes a limit of 255 name lengh, so even though we add code to support it here, it won't actually work. Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Chunwei Chen <david.chen@nutanix.com> Closes #15921
This commit is contained in:
committed by
Brian Behlendorf
parent
3cf2bfa570
commit
20232ecfaa
@@ -83,6 +83,7 @@ struct zfsvfs {
|
||||
boolean_t z_use_sa; /* version allow system attributes */
|
||||
boolean_t z_xattr_sa; /* allow xattrs to be stores as SA */
|
||||
boolean_t z_use_namecache; /* make use of FreeBSD name cache */
|
||||
boolean_t z_longname; /* Dataset supports long names */
|
||||
uint8_t z_xattr; /* xattr type in use */
|
||||
uint64_t z_version; /* ZPL version */
|
||||
uint64_t z_shares_dir; /* hidden shares dir */
|
||||
|
||||
@@ -179,7 +179,7 @@ extern void zfs_znode_free(struct znode *);
|
||||
extern zil_replay_func_t *const zfs_replay_vector[TX_MAX_TYPE];
|
||||
|
||||
extern int zfs_znode_parent_and_name(struct znode *zp, struct znode **dzpp,
|
||||
char *buf);
|
||||
char *buf, uint64_t buflen);
|
||||
|
||||
extern int zfs_rlimit_fsize(off_t fsize);
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user