aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2005-06-22 13:16:22 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2005-06-22 16:07:10 -0400
commit6b3b5496d7b261d6c9202008dc528e52dbd11e57 (patch)
treebcd625880fc7799ddd85b132e3cdfd501f5a82b9 /fs/nfs/nfs4proc.c
parentada70d9425bcc5e376fef8591e4e76e204c0834c (diff)
[PATCH] NFSv4: Add {get,set,list}xattr methods for nfs4
Add {get,set,list}xattr methods for nfs4. The new methods are no-ops, to be used by subsequent ACL patch. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c39
1 files changed, 38 insertions, 1 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index a5a8cb3159a0..1b14d17ae9a4 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2732,6 +2732,34 @@ nfs4_proc_lock(struct file *filp, int cmd, struct file_lock *request)
2732 return status; 2732 return status;
2733} 2733}
2734 2734
2735
2736int nfs4_setxattr(struct dentry *dentry, const char *key, const void *buf,
2737 size_t buflen, int flags)
2738{
2739 return -EOPNOTSUPP;
2740}
2741
2742/* The getxattr man page suggests returning -ENODATA for unknown attributes,
2743 * and that's what we'll do for e.g. user attributes that haven't been set.
2744 * But we'll follow ext2/ext3's lead by returning -EOPNOTSUPP for unsupported
2745 * attributes in kernel-managed attribute namespaces. */
2746ssize_t nfs4_getxattr(struct dentry *dentry, const char *key, void *buf,
2747 size_t buflen)
2748{
2749 return -EOPNOTSUPP;
2750}
2751
2752ssize_t nfs4_listxattr(struct dentry *dentry, char *buf, size_t buflen)
2753{
2754 ssize_t len = 0;
2755
2756 if (buf && buflen < len)
2757 return -ERANGE;
2758 if (buf)
2759 memcpy(buf, "", 0);
2760 return 0;
2761}
2762
2735struct nfs4_state_recovery_ops nfs4_reboot_recovery_ops = { 2763struct nfs4_state_recovery_ops nfs4_reboot_recovery_ops = {
2736 .recover_open = nfs4_open_reclaim, 2764 .recover_open = nfs4_open_reclaim,
2737 .recover_lock = nfs4_lock_reclaim, 2765 .recover_lock = nfs4_lock_reclaim,
@@ -2742,11 +2770,20 @@ struct nfs4_state_recovery_ops nfs4_network_partition_recovery_ops = {
2742 .recover_lock = nfs4_lock_expired, 2770 .recover_lock = nfs4_lock_expired,
2743}; 2771};
2744 2772
2773static struct inode_operations nfs4_file_inode_operations = {
2774 .permission = nfs_permission,
2775 .getattr = nfs_getattr,
2776 .setattr = nfs_setattr,
2777 .getxattr = nfs4_getxattr,
2778 .setxattr = nfs4_setxattr,
2779 .listxattr = nfs4_listxattr,
2780};
2781
2745struct nfs_rpc_ops nfs_v4_clientops = { 2782struct nfs_rpc_ops nfs_v4_clientops = {
2746 .version = 4, /* protocol version */ 2783 .version = 4, /* protocol version */
2747 .dentry_ops = &nfs4_dentry_operations, 2784 .dentry_ops = &nfs4_dentry_operations,
2748 .dir_inode_ops = &nfs4_dir_inode_operations, 2785 .dir_inode_ops = &nfs4_dir_inode_operations,
2749 .file_inode_ops = &nfs_file_inode_operations, 2786 .file_inode_ops = &nfs4_file_inode_operations,
2750 .getroot = nfs4_proc_get_root, 2787 .getroot = nfs4_proc_get_root,
2751 .getattr = nfs4_proc_getattr, 2788 .getattr = nfs4_proc_getattr,
2752 .setattr = nfs4_proc_setattr, 2789 .setattr = nfs4_proc_setattr,