aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/acl.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/f2fs/acl.c')
-rw-r--r--fs/f2fs/acl.c51
1 files changed, 0 insertions, 51 deletions
diff --git a/fs/f2fs/acl.c b/fs/f2fs/acl.c
index 1ac9a4b24f6e..fed74d193ffb 100644
--- a/fs/f2fs/acl.c
+++ b/fs/f2fs/acl.c
@@ -412,54 +412,3 @@ const struct xattr_handler f2fs_xattr_acl_access_handler = {
412 .get = f2fs_xattr_get_acl, 412 .get = f2fs_xattr_get_acl,
413 .set = f2fs_xattr_set_acl, 413 .set = f2fs_xattr_set_acl,
414}; 414};
415
416static size_t f2fs_xattr_advise_list(struct dentry *dentry, char *list,
417 size_t list_size, const char *name, size_t name_len, int type)
418{
419 const char *xname = F2FS_SYSTEM_ADVISE_PREFIX;
420 size_t size;
421
422 if (type != F2FS_XATTR_INDEX_ADVISE)
423 return 0;
424
425 size = strlen(xname) + 1;
426 if (list && size <= list_size)
427 memcpy(list, xname, size);
428 return size;
429}
430
431static int f2fs_xattr_advise_get(struct dentry *dentry, const char *name,
432 void *buffer, size_t size, int type)
433{
434 struct inode *inode = dentry->d_inode;
435
436 if (strcmp(name, "") != 0)
437 return -EINVAL;
438
439 *((char *)buffer) = F2FS_I(inode)->i_advise;
440 return sizeof(char);
441}
442
443static int f2fs_xattr_advise_set(struct dentry *dentry, const char *name,
444 const void *value, size_t size, int flags, int type)
445{
446 struct inode *inode = dentry->d_inode;
447
448 if (strcmp(name, "") != 0)
449 return -EINVAL;
450 if (!inode_owner_or_capable(inode))
451 return -EPERM;
452 if (value == NULL)
453 return -EINVAL;
454
455 F2FS_I(inode)->i_advise |= *(char *)value;
456 return 0;
457}
458
459const struct xattr_handler f2fs_xattr_advise_handler = {
460 .prefix = F2FS_SYSTEM_ADVISE_PREFIX,
461 .flags = F2FS_XATTR_INDEX_ADVISE,
462 .list = f2fs_xattr_advise_list,
463 .get = f2fs_xattr_advise_get,
464 .set = f2fs_xattr_advise_set,
465};