diff options
Diffstat (limited to 'fs/ceph/xattr.c')
-rw-r--r-- | fs/ceph/xattr.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/fs/ceph/xattr.c b/fs/ceph/xattr.c index 9578af610b73..6e12a6ba5f79 100644 --- a/fs/ceph/xattr.c +++ b/fs/ceph/xattr.c | |||
@@ -1,6 +1,9 @@ | |||
1 | #include "ceph_debug.h" | 1 | #include <linux/ceph/ceph_debug.h> |
2 | |||
2 | #include "super.h" | 3 | #include "super.h" |
3 | #include "decode.h" | 4 | #include "mds_client.h" |
5 | |||
6 | #include <linux/ceph/decode.h> | ||
4 | 7 | ||
5 | #include <linux/xattr.h> | 8 | #include <linux/xattr.h> |
6 | #include <linux/slab.h> | 9 | #include <linux/slab.h> |
@@ -620,12 +623,12 @@ out: | |||
620 | static int ceph_sync_setxattr(struct dentry *dentry, const char *name, | 623 | static int ceph_sync_setxattr(struct dentry *dentry, const char *name, |
621 | const char *value, size_t size, int flags) | 624 | const char *value, size_t size, int flags) |
622 | { | 625 | { |
623 | struct ceph_client *client = ceph_sb_to_client(dentry->d_sb); | 626 | struct ceph_fs_client *fsc = ceph_sb_to_client(dentry->d_sb); |
624 | struct inode *inode = dentry->d_inode; | 627 | struct inode *inode = dentry->d_inode; |
625 | struct ceph_inode_info *ci = ceph_inode(inode); | 628 | struct ceph_inode_info *ci = ceph_inode(inode); |
626 | struct inode *parent_inode = dentry->d_parent->d_inode; | 629 | struct inode *parent_inode = dentry->d_parent->d_inode; |
627 | struct ceph_mds_request *req; | 630 | struct ceph_mds_request *req; |
628 | struct ceph_mds_client *mdsc = &client->mdsc; | 631 | struct ceph_mds_client *mdsc = fsc->mdsc; |
629 | int err; | 632 | int err; |
630 | int i, nr_pages; | 633 | int i, nr_pages; |
631 | struct page **pages = NULL; | 634 | struct page **pages = NULL; |
@@ -713,10 +716,9 @@ int ceph_setxattr(struct dentry *dentry, const char *name, | |||
713 | 716 | ||
714 | /* preallocate memory for xattr name, value, index node */ | 717 | /* preallocate memory for xattr name, value, index node */ |
715 | err = -ENOMEM; | 718 | err = -ENOMEM; |
716 | newname = kmalloc(name_len + 1, GFP_NOFS); | 719 | newname = kmemdup(name, name_len + 1, GFP_NOFS); |
717 | if (!newname) | 720 | if (!newname) |
718 | goto out; | 721 | goto out; |
719 | memcpy(newname, name, name_len + 1); | ||
720 | 722 | ||
721 | if (val_len) { | 723 | if (val_len) { |
722 | newval = kmalloc(val_len + 1, GFP_NOFS); | 724 | newval = kmalloc(val_len + 1, GFP_NOFS); |
@@ -777,8 +779,8 @@ out: | |||
777 | 779 | ||
778 | static int ceph_send_removexattr(struct dentry *dentry, const char *name) | 780 | static int ceph_send_removexattr(struct dentry *dentry, const char *name) |
779 | { | 781 | { |
780 | struct ceph_client *client = ceph_sb_to_client(dentry->d_sb); | 782 | struct ceph_fs_client *fsc = ceph_sb_to_client(dentry->d_sb); |
781 | struct ceph_mds_client *mdsc = &client->mdsc; | 783 | struct ceph_mds_client *mdsc = fsc->mdsc; |
782 | struct inode *inode = dentry->d_inode; | 784 | struct inode *inode = dentry->d_inode; |
783 | struct inode *parent_inode = dentry->d_parent->d_inode; | 785 | struct inode *parent_inode = dentry->d_parent->d_inode; |
784 | struct ceph_mds_request *req; | 786 | struct ceph_mds_request *req; |