Commit 2c563880 authored by James Simmons's avatar James Simmons Committed by Greg Kroah-Hartman

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: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1b851095
......@@ -3213,10 +3213,10 @@ const struct inode_operations ll_file_inode_operations = {
.setattr = ll_setattr,
.getattr = ll_getattr,
.permission = ll_inode_permission,
.setxattr = ll_setxattr,
.getxattr = ll_getxattr,
.setxattr = generic_setxattr,
.getxattr = generic_getxattr,
.listxattr = ll_listxattr,
.removexattr = ll_removexattr,
.removexattr = generic_removexattr,
.fiemap = ll_fiemap,
.get_acl = ll_get_acl,
};
......
......@@ -42,6 +42,7 @@
#include "../include/lustre_mdc.h"
#include "../include/lustre_intent.h"
#include <linux/compat.h>
#include <linux/xattr.h>
#include <linux/posix_acl_xattr.h>
#include "vvp_internal.h"
......@@ -933,12 +934,9 @@ static inline __u64 ll_file_maxbytes(struct inode *inode)
}
/* llite/xattr.c */
int ll_setxattr(struct dentry *dentry, struct inode *inode,
const char *name, const void *value, size_t size, int flags);
ssize_t ll_getxattr(struct dentry *dentry, struct inode *inode,
const char *name, void *buffer, size_t size);
extern const struct xattr_handler *ll_xattr_handlers[];
ssize_t ll_listxattr(struct dentry *dentry, char *buffer, size_t size);
int ll_removexattr(struct dentry *dentry, const char *name);
/**
* Common IO arguments for various VFS I/O interfaces.
......
......@@ -418,6 +418,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
CDEBUG(D_SUPER, "rootfid "DFID"\n", PFID(&sbi->ll_root_fid));
sb->s_op = &lustre_super_operations;
sb->s_xattr = ll_xattr_handlers;
#if THREAD_SIZE >= 8192 /*b=17630*/
sb->s_export_op = &lustre_export_operations;
#endif
......
......@@ -1101,10 +1101,10 @@ const struct inode_operations ll_dir_inode_operations = {
.setattr = ll_setattr,
.getattr = ll_getattr,
.permission = ll_inode_permission,
.setxattr = ll_setxattr,
.getxattr = ll_getxattr,
.setxattr = generic_setxattr,
.getxattr = generic_getxattr,
.listxattr = ll_listxattr,
.removexattr = ll_removexattr,
.removexattr = generic_removexattr,
.get_acl = ll_get_acl,
};
......@@ -1112,9 +1112,9 @@ const struct inode_operations ll_special_inode_operations = {
.setattr = ll_setattr,
.getattr = ll_getattr,
.permission = ll_inode_permission,
.setxattr = ll_setxattr,
.getxattr = ll_getxattr,
.setxattr = generic_setxattr,
.getxattr = generic_getxattr,
.listxattr = ll_listxattr,
.removexattr = ll_removexattr,
.removexattr = generic_removexattr,
.get_acl = ll_get_acl,
};
......@@ -155,8 +155,8 @@ const struct inode_operations ll_fast_symlink_inode_operations = {
.get_link = ll_get_link,
.getattr = ll_getattr,
.permission = ll_inode_permission,
.setxattr = ll_setxattr,
.getxattr = ll_getxattr,
.setxattr = generic_setxattr,
.getxattr = generic_getxattr,
.listxattr = ll_listxattr,
.removexattr = ll_removexattr,
.removexattr = generic_removexattr,
};
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment