[PATCH] erofs-utils: fuse: introduce xattr support
Huang Jianan
jnhuang at linux.alibaba.com
Thu Jul 28 22:11:36 AEST 2022
在 2022/7/19 18:21, Gao Xiang 写道:
> Hi Jianan,
>
> On Fri, Jul 15, 2022 at 05:53:59PM +0800, Huang Jianan wrote:
>> This implements xattr functionalities for erofsfuse. A large amount
>> of code was adapted from Linux kernel.
>>
>> Signed-off-by: Huang Jianan <jnhuang at linux.alibaba.com>
>> ---
>> fuse/main.c | 32 +++
>> include/erofs/internal.h | 8 +
>> include/erofs/xattr.h | 21 ++
>> lib/xattr.c | 508 +++++++++++++++++++++++++++++++++++++++
>> 4 files changed, 569 insertions(+)
>>
>> diff --git a/fuse/main.c b/fuse/main.c
>> index f4c2476..30a0bed 100644
>> --- a/fuse/main.c
>> +++ b/fuse/main.c
>> @@ -139,7 +139,39 @@ static int erofsfuse_readlink(const char *path, char *buffer, size_t size)
>> return 0;
>> }
>>
>> +static int erofsfuse_getxattr(const char *path, const char *name, char *value,
>> + size_t size)
>> +{
>> + int ret;
>> + struct erofs_inode vi;
>> +
>> + erofs_dbg("getxattr(%s): name=%s size=%llu", path, name, size);
>> +
>> + ret = erofs_ilookup(path, &vi);
>> + if (ret)
>> + return ret;
>> +
>> + return erofs_getxattr(&vi, name, value, size);
>> +}
>> +
>> +static int erofsfuse_listxattr(const char *path, char *list, size_t size)
>> +{
>> + int ret;
>> + struct erofs_inode vi;
>> + int i;
>
> As we discussed offline, this line should be unneeded.
A new patch has been sent, in addition a test case has been added.
Thanks,
Jianan
>
> Thanks,
> Gao Xiang
More information about the Linux-erofs
mailing list