Message ID | 20200114081051.297488-10-hch@lst.de (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | [01/29] xfs: remove the ATTR_INCOMPLETE flag | expand |
On Tue, Jan 14, 2020 at 09:10:31AM +0100, Christoph Hellwig wrote: > The xattr values are blobs and should not be typed. > > Signed-off-by: Christoph Hellwig <hch@lst.de> /me wonders if it's worth using a union for filetype vs. value/valuelen to save a few padding bytes, but that's another patch... Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> --D > --- > fs/xfs/libxfs/xfs_types.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/xfs/libxfs/xfs_types.h b/fs/xfs/libxfs/xfs_types.h > index e2711d119665..634814dd1d10 100644 > --- a/fs/xfs/libxfs/xfs_types.h > +++ b/fs/xfs/libxfs/xfs_types.h > @@ -192,7 +192,7 @@ typedef struct xfs_da_args { > const uint8_t *name; /* string (maybe not NULL terminated) */ > int namelen; /* length of string (maybe no NULL) */ > uint8_t filetype; /* filetype of inode for directories */ > - uint8_t *value; /* set of bytes (maybe contain NULLs) */ > + void *value; /* set of bytes (maybe contain NULLs) */ > int valuelen; /* length of value */ > int flags; /* argument flags (eg: ATTR_NOCREATE) */ > xfs_dahash_t hashval; /* hash value of name */ > -- > 2.24.1 >
On Tue, Jan 21, 2020 at 10:07:42AM -0800, Darrick J. Wong wrote: > On Tue, Jan 14, 2020 at 09:10:31AM +0100, Christoph Hellwig wrote: > > The xattr values are blobs and should not be typed. > > > > Signed-off-by: Christoph Hellwig <hch@lst.de> > > /me wonders if it's worth using a union for filetype vs. value/valuelen > to save a few padding bytes, but that's another patch... If we want to go down that route it might make sense to have an xfs_attr_args and xfs_dir2_args, which both embedd the da_args. But not for now..
diff --git a/fs/xfs/libxfs/xfs_types.h b/fs/xfs/libxfs/xfs_types.h index e2711d119665..634814dd1d10 100644 --- a/fs/xfs/libxfs/xfs_types.h +++ b/fs/xfs/libxfs/xfs_types.h @@ -192,7 +192,7 @@ typedef struct xfs_da_args { const uint8_t *name; /* string (maybe not NULL terminated) */ int namelen; /* length of string (maybe no NULL) */ uint8_t filetype; /* filetype of inode for directories */ - uint8_t *value; /* set of bytes (maybe contain NULLs) */ + void *value; /* set of bytes (maybe contain NULLs) */ int valuelen; /* length of value */ int flags; /* argument flags (eg: ATTR_NOCREATE) */ xfs_dahash_t hashval; /* hash value of name */
The xattr values are blobs and should not be typed. Signed-off-by: Christoph Hellwig <hch@lst.de> --- fs/xfs/libxfs/xfs_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)