Skip to content

Commit 2c56388

Browse files
jamesasimmonsgregkh
authored andcommitted
staging: lustre: llite: basic port to xattr_handler API
Port the xattr functionality to the new xattr_handler API. This is smallest changes needed to move to this new API. The function ll_removexattr can be replaced by generic_removexattr as well since it also uses the xattr_handler set xattr backend. To tell the difference between the two cases we test the flag passed in for XATTR_REPLACE. The ll_getxattr function is replaced by the generic_getxattr function. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 1b85109 commit 2c56388

6 files changed

Lines changed: 141 additions & 87 deletions

File tree

‎drivers/staging/lustre/lustre/llite/file.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3213,10 +3213,10 @@ const struct inode_operations ll_file_inode_operations = {
32133213
.setattr = ll_setattr,
32143214
.getattr = ll_getattr,
32153215
.permission = ll_inode_permission,
3216-
.setxattr = ll_setxattr,
3217-
.getxattr = ll_getxattr,
3216+
.setxattr = generic_setxattr,
3217+
.getxattr = generic_getxattr,
32183218
.listxattr = ll_listxattr,
3219-
.removexattr = ll_removexattr,
3219+
.removexattr = generic_removexattr,
32203220
.fiemap = ll_fiemap,
32213221
.get_acl = ll_get_acl,
32223222
};

‎drivers/staging/lustre/lustre/llite/llite_internal.h‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include "../include/lustre_mdc.h"
4343
#include "../include/lustre_intent.h"
4444
#include <linux/compat.h>
45+
#include <linux/xattr.h>
4546
#include <linux/posix_acl_xattr.h>
4647
#include "vvp_internal.h"
4748

@@ -933,12 +934,9 @@ static inline __u64 ll_file_maxbytes(struct inode *inode)
933934
}
934935

935936
/* llite/xattr.c */
936-
int ll_setxattr(struct dentry *dentry, struct inode *inode,
937-
const char *name, const void *value, size_t size, int flags);
938-
ssize_t ll_getxattr(struct dentry *dentry, struct inode *inode,
939-
const char *name, void *buffer, size_t size);
937+
extern const struct xattr_handler *ll_xattr_handlers[];
938+
940939
ssize_t ll_listxattr(struct dentry *dentry, char *buffer, size_t size);
941-
int ll_removexattr(struct dentry *dentry, const char *name);
942940

943941
/**
944942
* Common IO arguments for various VFS I/O interfaces.

‎drivers/staging/lustre/lustre/llite/llite_lib.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
418418
CDEBUG(D_SUPER, "rootfid "DFID"\n", PFID(&sbi->ll_root_fid));
419419

420420
sb->s_op = &lustre_super_operations;
421+
sb->s_xattr = ll_xattr_handlers;
421422
#if THREAD_SIZE >= 8192 /*b=17630*/
422423
sb->s_export_op = &lustre_export_operations;
423424
#endif

‎drivers/staging/lustre/lustre/llite/namei.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,20 +1101,20 @@ const struct inode_operations ll_dir_inode_operations = {
11011101
.setattr = ll_setattr,
11021102
.getattr = ll_getattr,
11031103
.permission = ll_inode_permission,
1104-
.setxattr = ll_setxattr,
1105-
.getxattr = ll_getxattr,
1104+
.setxattr = generic_setxattr,
1105+
.getxattr = generic_getxattr,
11061106
.listxattr = ll_listxattr,
1107-
.removexattr = ll_removexattr,
1107+
.removexattr = generic_removexattr,
11081108
.get_acl = ll_get_acl,
11091109
};
11101110

11111111
const struct inode_operations ll_special_inode_operations = {
11121112
.setattr = ll_setattr,
11131113
.getattr = ll_getattr,
11141114
.permission = ll_inode_permission,
1115-
.setxattr = ll_setxattr,
1116-
.getxattr = ll_getxattr,
1115+
.setxattr = generic_setxattr,
1116+
.getxattr = generic_getxattr,
11171117
.listxattr = ll_listxattr,
1118-
.removexattr = ll_removexattr,
1118+
.removexattr = generic_removexattr,
11191119
.get_acl = ll_get_acl,
11201120
};

‎drivers/staging/lustre/lustre/llite/symlink.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ const struct inode_operations ll_fast_symlink_inode_operations = {
155155
.get_link = ll_get_link,
156156
.getattr = ll_getattr,
157157
.permission = ll_inode_permission,
158-
.setxattr = ll_setxattr,
159-
.getxattr = ll_getxattr,
158+
.setxattr = generic_setxattr,
159+
.getxattr = generic_getxattr,
160160
.listxattr = ll_listxattr,
161-
.removexattr = ll_removexattr,
161+
.removexattr = generic_removexattr,
162162
};

0 commit comments

Comments
 (0)