mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 16:12:59 +02:00
f2fs: Pass a folio to f2fs_setxattr()
Also convert f2fs_initxattrs() to take a folio. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
9de27930c5
commit
953ab314c7
|
|
@ -264,7 +264,7 @@ static int __f2fs_set_acl(struct mnt_idmap *idmap,
|
|||
}
|
||||
}
|
||||
|
||||
error = f2fs_setxattr(inode, name_index, "", value, size, &ifolio->page, 0);
|
||||
error = f2fs_setxattr(inode, name_index, "", value, size, ifolio, 0);
|
||||
|
||||
kfree(value);
|
||||
if (!error)
|
||||
|
|
|
|||
|
|
@ -543,7 +543,7 @@ struct page *f2fs_init_inode_metadata(struct inode *inode, struct inode *dir,
|
|||
|
||||
err = f2fs_init_security(inode, dir,
|
||||
fname ? fname->usr_fname : NULL,
|
||||
&folio->page);
|
||||
folio);
|
||||
if (err)
|
||||
goto put_error;
|
||||
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ static int f2fs_xattr_advise_set(const struct xattr_handler *handler,
|
|||
|
||||
#ifdef CONFIG_F2FS_FS_SECURITY
|
||||
static int f2fs_initxattrs(struct inode *inode, const struct xattr *xattr_array,
|
||||
void *page)
|
||||
void *folio)
|
||||
{
|
||||
const struct xattr *xattr;
|
||||
int err = 0;
|
||||
|
|
@ -144,7 +144,7 @@ static int f2fs_initxattrs(struct inode *inode, const struct xattr *xattr_array,
|
|||
for (xattr = xattr_array; xattr->name != NULL; xattr++) {
|
||||
err = f2fs_setxattr(inode, F2FS_XATTR_INDEX_SECURITY,
|
||||
xattr->name, xattr->value,
|
||||
xattr->value_len, (struct page *)page, 0);
|
||||
xattr->value_len, folio, 0);
|
||||
if (err < 0)
|
||||
break;
|
||||
}
|
||||
|
|
@ -152,10 +152,10 @@ static int f2fs_initxattrs(struct inode *inode, const struct xattr *xattr_array,
|
|||
}
|
||||
|
||||
int f2fs_init_security(struct inode *inode, struct inode *dir,
|
||||
const struct qstr *qstr, struct page *ipage)
|
||||
const struct qstr *qstr, struct folio *ifolio)
|
||||
{
|
||||
return security_inode_init_security(inode, dir, qstr,
|
||||
&f2fs_initxattrs, ipage);
|
||||
f2fs_initxattrs, ifolio);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -800,7 +800,7 @@ static int __f2fs_setxattr(struct inode *inode, int index,
|
|||
|
||||
int f2fs_setxattr(struct inode *inode, int index, const char *name,
|
||||
const void *value, size_t size,
|
||||
struct page *ipage, int flags)
|
||||
struct folio *ifolio, int flags)
|
||||
{
|
||||
struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
|
||||
int err;
|
||||
|
|
@ -815,14 +815,14 @@ int f2fs_setxattr(struct inode *inode, int index, const char *name,
|
|||
return err;
|
||||
|
||||
/* this case is only from f2fs_init_inode_metadata */
|
||||
if (ipage)
|
||||
if (ifolio)
|
||||
return __f2fs_setxattr(inode, index, name, value,
|
||||
size, ipage, flags);
|
||||
size, &ifolio->page, flags);
|
||||
f2fs_balance_fs(sbi, true);
|
||||
|
||||
f2fs_lock_op(sbi);
|
||||
f2fs_down_write(&F2FS_I(inode)->i_xattr_sem);
|
||||
err = __f2fs_setxattr(inode, index, name, value, size, ipage, flags);
|
||||
err = __f2fs_setxattr(inode, index, name, value, size, NULL, flags);
|
||||
f2fs_up_write(&F2FS_I(inode)->i_xattr_sem);
|
||||
f2fs_unlock_op(sbi);
|
||||
|
||||
|
|
|
|||
|
|
@ -127,20 +127,20 @@ extern const struct xattr_handler f2fs_xattr_security_handler;
|
|||
|
||||
extern const struct xattr_handler * const f2fs_xattr_handlers[];
|
||||
|
||||
extern int f2fs_setxattr(struct inode *, int, const char *,
|
||||
const void *, size_t, struct page *, int);
|
||||
extern int f2fs_getxattr(struct inode *, int, const char *, void *,
|
||||
size_t, struct page *);
|
||||
extern ssize_t f2fs_listxattr(struct dentry *, char *, size_t);
|
||||
extern int f2fs_init_xattr_caches(struct f2fs_sb_info *);
|
||||
extern void f2fs_destroy_xattr_caches(struct f2fs_sb_info *);
|
||||
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 *);
|
||||
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 *);
|
||||
#else
|
||||
|
||||
#define f2fs_xattr_handlers NULL
|
||||
#define f2fs_listxattr NULL
|
||||
static inline int f2fs_setxattr(struct inode *inode, int index,
|
||||
const char *name, const void *value, size_t size,
|
||||
struct page *page, int flags)
|
||||
struct folio *folio, int flags)
|
||||
{
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
|
@ -155,11 +155,11 @@ static inline void f2fs_destroy_xattr_caches(struct f2fs_sb_info *sbi) { }
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_F2FS_FS_SECURITY
|
||||
extern int f2fs_init_security(struct inode *, struct inode *,
|
||||
const struct qstr *, struct page *);
|
||||
int f2fs_init_security(struct inode *, struct inode *,
|
||||
const struct qstr *, struct folio *);
|
||||
#else
|
||||
static inline int f2fs_init_security(struct inode *inode, struct inode *dir,
|
||||
const struct qstr *qstr, struct page *ipage)
|
||||
const struct qstr *qstr, struct folio *ifolio)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user