summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2025-03-31 21:12:15 +0100
committerJaegeuk Kim <jaegeuk@kernel.org>2025-04-28 15:26:42 +0000
commit39d20727d8b930269c0c84c404f6564cd676f294 (patch)
tree1ec4db977f1b99c04b1f8a36bab29deddb3bd34d
parentcdbe260d559a8cec03bc289588bf50a334028ae3 (diff)
f2fs: Pass a folio to f2fs_getxattr()
The one caller of __f2fs_get_acl() which passes a non-NULL page already has a folio, so pass it in, then into f2fs_getxattr(), which lets us pass it to lookup_all_xattrs(). Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fs/f2fs/acl.c8
-rw-r--r--fs/f2fs/xattr.c12
-rw-r--r--fs/f2fs/xattr.h4
3 files changed, 12 insertions, 12 deletions
diff --git a/fs/f2fs/acl.c b/fs/f2fs/acl.c
index 0a4d160235e0..d4d7f329d23f 100644
--- a/fs/f2fs/acl.c
+++ b/fs/f2fs/acl.c
@@ -166,7 +166,7 @@ fail:
}
static struct posix_acl *__f2fs_get_acl(struct inode *inode, int type,
- struct page *dpage)
+ struct folio *dfolio)
{
int name_index = F2FS_XATTR_INDEX_POSIX_ACL_DEFAULT;
void *value = NULL;
@@ -176,13 +176,13 @@ static struct posix_acl *__f2fs_get_acl(struct inode *inode, int type,
if (type == ACL_TYPE_ACCESS)
name_index = F2FS_XATTR_INDEX_POSIX_ACL_ACCESS;
- retval = f2fs_getxattr(inode, name_index, "", NULL, 0, dpage);
+ retval = f2fs_getxattr(inode, name_index, "", NULL, 0, dfolio);
if (retval > 0) {
value = f2fs_kmalloc(F2FS_I_SB(inode), retval, GFP_F2FS_ZERO);
if (!value)
return ERR_PTR(-ENOMEM);
retval = f2fs_getxattr(inode, name_index, "", value,
- retval, dpage);
+ retval, dfolio);
}
if (retval > 0)
@@ -371,7 +371,7 @@ static int f2fs_acl_create(struct inode *dir, umode_t *mode,
if (S_ISLNK(*mode) || !IS_POSIXACL(dir))
return 0;
- p = __f2fs_get_acl(dir, ACL_TYPE_DEFAULT, &dfolio->page);
+ p = __f2fs_get_acl(dir, ACL_TYPE_DEFAULT, dfolio);
if (!p || p == ERR_PTR(-EOPNOTSUPP)) {
*mode &= ~current_umask();
return 0;
diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c
index 28b32728a113..ff49bcba96f3 100644
--- a/fs/f2fs/xattr.c
+++ b/fs/f2fs/xattr.c
@@ -314,7 +314,7 @@ static int read_xattr_block(struct inode *inode, void *txattr_addr)
return 0;
}
-static int lookup_all_xattrs(struct inode *inode, struct page *ipage,
+static int lookup_all_xattrs(struct inode *inode, struct folio *ifolio,
unsigned int index, unsigned int len,
const char *name, struct f2fs_xattr_entry **xe,
void **base_addr, int *base_size,
@@ -338,7 +338,7 @@ static int lookup_all_xattrs(struct inode *inode, struct page *ipage,
/* read from inline xattr */
if (inline_size) {
- err = read_inline_xattr(inode, ipage, txattr_addr);
+ err = read_inline_xattr(inode, &ifolio->page, txattr_addr);
if (err)
goto out;
@@ -512,7 +512,7 @@ in_page_out:
}
int f2fs_getxattr(struct inode *inode, int index, const char *name,
- void *buffer, size_t buffer_size, struct page *ipage)
+ void *buffer, size_t buffer_size, struct folio *ifolio)
{
struct f2fs_xattr_entry *entry = NULL;
int error;
@@ -528,11 +528,11 @@ int f2fs_getxattr(struct inode *inode, int index, const char *name,
if (len > F2FS_NAME_LEN)
return -ERANGE;
- if (!ipage)
+ if (!ifolio)
f2fs_down_read(&F2FS_I(inode)->i_xattr_sem);
- error = lookup_all_xattrs(inode, ipage, index, len, name,
+ error = lookup_all_xattrs(inode, ifolio, index, len, name,
&entry, &base_addr, &base_size, &is_inline);
- if (!ipage)
+ if (!ifolio)
f2fs_up_read(&F2FS_I(inode)->i_xattr_sem);
if (error)
return error;
diff --git a/fs/f2fs/xattr.h b/fs/f2fs/xattr.h
index e0f7b865c116..4fc0b2305fbd 100644
--- a/fs/f2fs/xattr.h
+++ b/fs/f2fs/xattr.h
@@ -130,7 +130,7 @@ extern const struct xattr_handler * const f2fs_xattr_handlers[];
int f2fs_setxattr(struct inode *, int, const char *, const void *,
size_t, struct folio *, int);
int f2fs_getxattr(struct inode *, int, const char *, void *,
- size_t, struct page *);
+ size_t, struct folio *);
ssize_t f2fs_listxattr(struct dentry *, char *, size_t);
int f2fs_init_xattr_caches(struct f2fs_sb_info *);
void f2fs_destroy_xattr_caches(struct f2fs_sb_info *);
@@ -146,7 +146,7 @@ static inline int f2fs_setxattr(struct inode *inode, int index,
}
static inline int f2fs_getxattr(struct inode *inode, int index,
const char *name, void *buffer,
- size_t buffer_size, struct page *dpage)
+ size_t buffer_size, struct folio *dfolio)
{
return -EOPNOTSUPP;
}