Skip to content

Commit 5a8ffb1

Browse files
lostjefflehsiangkao
authored andcommitted
erofs: make the size of read data stored in buffer_ofs
Since now xattr_iter structures have been unified, make the size of the read data stored in buffer_ofs. Don't bother reusing buffer_size for this use, which may be confusing. This is in preparation for the following further cleanup. Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com> Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: https://lore.kernel.org/r/20230613074114.120115-4-jefflexu@linux.alibaba.com Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
1 parent 8e82396 commit 5a8ffb1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fs/erofs/xattr.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ static int xattr_checkbuffer(struct erofs_xattr_iter *it,
315315
{
316316
int err = it->buffer_size < value_sz ? -ERANGE : 0;
317317

318-
it->buffer_size = value_sz;
318+
it->buffer_ofs = value_sz;
319319
return !it->buffer ? 1 : err;
320320
}
321321

@@ -348,7 +348,7 @@ static int inline_getxattr(struct inode *inode, struct erofs_xattr_iter *it)
348348
if (ret != -ENOATTR)
349349
break;
350350
}
351-
return ret ? ret : it->buffer_size;
351+
return ret ? ret : it->buffer_ofs;
352352
}
353353

354354
static int shared_getxattr(struct inode *inode, struct erofs_xattr_iter *it)
@@ -371,7 +371,7 @@ static int shared_getxattr(struct inode *inode, struct erofs_xattr_iter *it)
371371
if (ret != -ENOATTR)
372372
break;
373373
}
374-
return ret ? ret : it->buffer_size;
374+
return ret ? ret : it->buffer_ofs;
375375
}
376376

377377
static bool erofs_xattr_user_list(struct dentry *dentry)

0 commit comments

Comments
 (0)