diff options
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/caps.c | 4 | ||||
-rw-r--r-- | fs/ceph/dir.c | 12 | ||||
-rw-r--r-- | fs/ceph/inode.c | 1 | ||||
-rw-r--r-- | fs/ceph/super.c | 26 | ||||
-rw-r--r-- | fs/ceph/super.h | 2 |
5 files changed, 26 insertions, 19 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 8b53193e4f7c..b60fc8bfb3e9 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c | |||
@@ -928,7 +928,7 @@ static int send_cap_msg(struct ceph_mds_session *session, | |||
928 | u64 size, u64 max_size, | 928 | u64 size, u64 max_size, |
929 | struct timespec *mtime, struct timespec *atime, | 929 | struct timespec *mtime, struct timespec *atime, |
930 | u64 time_warp_seq, | 930 | u64 time_warp_seq, |
931 | uid_t uid, gid_t gid, mode_t mode, | 931 | uid_t uid, gid_t gid, umode_t mode, |
932 | u64 xattr_version, | 932 | u64 xattr_version, |
933 | struct ceph_buffer *xattrs_buf, | 933 | struct ceph_buffer *xattrs_buf, |
934 | u64 follows) | 934 | u64 follows) |
@@ -1078,7 +1078,7 @@ static int __send_cap(struct ceph_mds_client *mdsc, struct ceph_cap *cap, | |||
1078 | u64 size, max_size; | 1078 | u64 size, max_size; |
1079 | struct timespec mtime, atime; | 1079 | struct timespec mtime, atime; |
1080 | int wake = 0; | 1080 | int wake = 0; |
1081 | mode_t mode; | 1081 | umode_t mode; |
1082 | uid_t uid; | 1082 | uid_t uid; |
1083 | gid_t gid; | 1083 | gid_t gid; |
1084 | struct ceph_mds_session *session; | 1084 | struct ceph_mds_session *session; |
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index 5259abfb5dd9..618246bc2196 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c | |||
@@ -666,7 +666,7 @@ int ceph_handle_notrace_create(struct inode *dir, struct dentry *dentry) | |||
666 | } | 666 | } |
667 | 667 | ||
668 | static int ceph_mknod(struct inode *dir, struct dentry *dentry, | 668 | static int ceph_mknod(struct inode *dir, struct dentry *dentry, |
669 | int mode, dev_t rdev) | 669 | umode_t mode, dev_t rdev) |
670 | { | 670 | { |
671 | struct ceph_fs_client *fsc = ceph_sb_to_client(dir->i_sb); | 671 | struct ceph_fs_client *fsc = ceph_sb_to_client(dir->i_sb); |
672 | struct ceph_mds_client *mdsc = fsc->mdsc; | 672 | struct ceph_mds_client *mdsc = fsc->mdsc; |
@@ -676,7 +676,7 @@ static int ceph_mknod(struct inode *dir, struct dentry *dentry, | |||
676 | if (ceph_snap(dir) != CEPH_NOSNAP) | 676 | if (ceph_snap(dir) != CEPH_NOSNAP) |
677 | return -EROFS; | 677 | return -EROFS; |
678 | 678 | ||
679 | dout("mknod in dir %p dentry %p mode 0%o rdev %d\n", | 679 | dout("mknod in dir %p dentry %p mode 0%ho rdev %d\n", |
680 | dir, dentry, mode, rdev); | 680 | dir, dentry, mode, rdev); |
681 | req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_MKNOD, USE_AUTH_MDS); | 681 | req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_MKNOD, USE_AUTH_MDS); |
682 | if (IS_ERR(req)) { | 682 | if (IS_ERR(req)) { |
@@ -699,7 +699,7 @@ static int ceph_mknod(struct inode *dir, struct dentry *dentry, | |||
699 | return err; | 699 | return err; |
700 | } | 700 | } |
701 | 701 | ||
702 | static int ceph_create(struct inode *dir, struct dentry *dentry, int mode, | 702 | static int ceph_create(struct inode *dir, struct dentry *dentry, umode_t mode, |
703 | struct nameidata *nd) | 703 | struct nameidata *nd) |
704 | { | 704 | { |
705 | dout("create in dir %p dentry %p name '%.*s'\n", | 705 | dout("create in dir %p dentry %p name '%.*s'\n", |
@@ -753,7 +753,7 @@ static int ceph_symlink(struct inode *dir, struct dentry *dentry, | |||
753 | return err; | 753 | return err; |
754 | } | 754 | } |
755 | 755 | ||
756 | static int ceph_mkdir(struct inode *dir, struct dentry *dentry, int mode) | 756 | static int ceph_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) |
757 | { | 757 | { |
758 | struct ceph_fs_client *fsc = ceph_sb_to_client(dir->i_sb); | 758 | struct ceph_fs_client *fsc = ceph_sb_to_client(dir->i_sb); |
759 | struct ceph_mds_client *mdsc = fsc->mdsc; | 759 | struct ceph_mds_client *mdsc = fsc->mdsc; |
@@ -767,7 +767,7 @@ static int ceph_mkdir(struct inode *dir, struct dentry *dentry, int mode) | |||
767 | dout("mksnap dir %p snap '%.*s' dn %p\n", dir, | 767 | dout("mksnap dir %p snap '%.*s' dn %p\n", dir, |
768 | dentry->d_name.len, dentry->d_name.name, dentry); | 768 | dentry->d_name.len, dentry->d_name.name, dentry); |
769 | } else if (ceph_snap(dir) == CEPH_NOSNAP) { | 769 | } else if (ceph_snap(dir) == CEPH_NOSNAP) { |
770 | dout("mkdir dir %p dn %p mode 0%o\n", dir, dentry, mode); | 770 | dout("mkdir dir %p dn %p mode 0%ho\n", dir, dentry, mode); |
771 | op = CEPH_MDS_OP_MKDIR; | 771 | op = CEPH_MDS_OP_MKDIR; |
772 | } else { | 772 | } else { |
773 | goto out; | 773 | goto out; |
@@ -870,7 +870,7 @@ static int ceph_unlink(struct inode *dir, struct dentry *dentry) | |||
870 | } else if (ceph_snap(dir) == CEPH_NOSNAP) { | 870 | } else if (ceph_snap(dir) == CEPH_NOSNAP) { |
871 | dout("unlink/rmdir dir %p dn %p inode %p\n", | 871 | dout("unlink/rmdir dir %p dn %p inode %p\n", |
872 | dir, dentry, inode); | 872 | dir, dentry, inode); |
873 | op = ((dentry->d_inode->i_mode & S_IFMT) == S_IFDIR) ? | 873 | op = S_ISDIR(dentry->d_inode->i_mode) ? |
874 | CEPH_MDS_OP_RMDIR : CEPH_MDS_OP_UNLINK; | 874 | CEPH_MDS_OP_RMDIR : CEPH_MDS_OP_UNLINK; |
875 | } else | 875 | } else |
876 | goto out; | 876 | goto out; |
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index f556e76c72e3..2c489378b4cd 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c | |||
@@ -384,7 +384,6 @@ static void ceph_i_callback(struct rcu_head *head) | |||
384 | struct inode *inode = container_of(head, struct inode, i_rcu); | 384 | struct inode *inode = container_of(head, struct inode, i_rcu); |
385 | struct ceph_inode_info *ci = ceph_inode(inode); | 385 | struct ceph_inode_info *ci = ceph_inode(inode); |
386 | 386 | ||
387 | INIT_LIST_HEAD(&inode->i_dentry); | ||
388 | kmem_cache_free(ceph_inode_cachep, ci); | 387 | kmem_cache_free(ceph_inode_cachep, ci); |
389 | } | 388 | } |
390 | 389 | ||
diff --git a/fs/ceph/super.c b/fs/ceph/super.c index 9c62fe02ce05..00de2c9568cd 100644 --- a/fs/ceph/super.c +++ b/fs/ceph/super.c | |||
@@ -351,11 +351,11 @@ out: | |||
351 | /** | 351 | /** |
352 | * ceph_show_options - Show mount options in /proc/mounts | 352 | * ceph_show_options - Show mount options in /proc/mounts |
353 | * @m: seq_file to write to | 353 | * @m: seq_file to write to |
354 | * @mnt: mount descriptor | 354 | * @root: root of that (sub)tree |
355 | */ | 355 | */ |
356 | static int ceph_show_options(struct seq_file *m, struct vfsmount *mnt) | 356 | static int ceph_show_options(struct seq_file *m, struct dentry *root) |
357 | { | 357 | { |
358 | struct ceph_fs_client *fsc = ceph_sb_to_client(mnt->mnt_sb); | 358 | struct ceph_fs_client *fsc = ceph_sb_to_client(root->d_sb); |
359 | struct ceph_mount_options *fsopt = fsc->mount_options; | 359 | struct ceph_mount_options *fsopt = fsc->mount_options; |
360 | struct ceph_options *opt = fsc->client->options; | 360 | struct ceph_options *opt = fsc->client->options; |
361 | 361 | ||
@@ -650,18 +650,26 @@ static struct dentry *open_root_dentry(struct ceph_fs_client *fsc, | |||
650 | req->r_num_caps = 2; | 650 | req->r_num_caps = 2; |
651 | err = ceph_mdsc_do_request(mdsc, NULL, req); | 651 | err = ceph_mdsc_do_request(mdsc, NULL, req); |
652 | if (err == 0) { | 652 | if (err == 0) { |
653 | struct inode *inode = req->r_target_inode; | ||
654 | req->r_target_inode = NULL; | ||
653 | dout("open_root_inode success\n"); | 655 | dout("open_root_inode success\n"); |
654 | if (ceph_ino(req->r_target_inode) == CEPH_INO_ROOT && | 656 | if (ceph_ino(inode) == CEPH_INO_ROOT && |
655 | fsc->sb->s_root == NULL) | 657 | fsc->sb->s_root == NULL) { |
656 | root = d_alloc_root(req->r_target_inode); | 658 | root = d_alloc_root(inode); |
657 | else | 659 | if (!root) { |
658 | root = d_obtain_alias(req->r_target_inode); | 660 | iput(inode); |
661 | root = ERR_PTR(-ENOMEM); | ||
662 | goto out; | ||
663 | } | ||
664 | } else { | ||
665 | root = d_obtain_alias(inode); | ||
666 | } | ||
659 | ceph_init_dentry(root); | 667 | ceph_init_dentry(root); |
660 | req->r_target_inode = NULL; | ||
661 | dout("open_root_inode success, root dentry is %p\n", root); | 668 | dout("open_root_inode success, root dentry is %p\n", root); |
662 | } else { | 669 | } else { |
663 | root = ERR_PTR(err); | 670 | root = ERR_PTR(err); |
664 | } | 671 | } |
672 | out: | ||
665 | ceph_mdsc_put_request(req); | 673 | ceph_mdsc_put_request(req); |
666 | return root; | 674 | return root; |
667 | } | 675 | } |
diff --git a/fs/ceph/super.h b/fs/ceph/super.h index 140f99f978c4..1421f3d875a2 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h | |||
@@ -137,7 +137,7 @@ struct ceph_cap_snap { | |||
137 | int issued, dirty; | 137 | int issued, dirty; |
138 | struct ceph_snap_context *context; | 138 | struct ceph_snap_context *context; |
139 | 139 | ||
140 | mode_t mode; | 140 | umode_t mode; |
141 | uid_t uid; | 141 | uid_t uid; |
142 | gid_t gid; | 142 | gid_t gid; |
143 | 143 | ||