diff options
Diffstat (limited to 'fs/ceph/inode.c')
-rw-r--r-- | fs/ceph/inode.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index e835eff551e3..193bfa5e9cbd 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c | |||
@@ -707,13 +707,9 @@ static int fill_inode(struct inode *inode, | |||
707 | (issued & CEPH_CAP_FILE_EXCL) == 0 && | 707 | (issued & CEPH_CAP_FILE_EXCL) == 0 && |
708 | (ci->i_ceph_flags & CEPH_I_COMPLETE) == 0) { | 708 | (ci->i_ceph_flags & CEPH_I_COMPLETE) == 0) { |
709 | dout(" marking %p complete (empty)\n", inode); | 709 | dout(" marking %p complete (empty)\n", inode); |
710 | ci->i_ceph_flags |= CEPH_I_COMPLETE; | 710 | /* ci->i_ceph_flags |= CEPH_I_COMPLETE; */ |
711 | ci->i_max_offset = 2; | 711 | ci->i_max_offset = 2; |
712 | } | 712 | } |
713 | |||
714 | /* it may be better to set st_size in getattr instead? */ | ||
715 | if (ceph_test_mount_opt(ceph_sb_to_client(inode->i_sb), RBYTES)) | ||
716 | inode->i_size = ci->i_rbytes; | ||
717 | break; | 713 | break; |
718 | default: | 714 | default: |
719 | pr_err("fill_inode %llx.%llx BAD mode 0%o\n", | 715 | pr_err("fill_inode %llx.%llx BAD mode 0%o\n", |
@@ -1819,7 +1815,11 @@ int ceph_getattr(struct vfsmount *mnt, struct dentry *dentry, | |||
1819 | else | 1815 | else |
1820 | stat->dev = 0; | 1816 | stat->dev = 0; |
1821 | if (S_ISDIR(inode->i_mode)) { | 1817 | if (S_ISDIR(inode->i_mode)) { |
1822 | stat->size = ci->i_rbytes; | 1818 | if (ceph_test_mount_opt(ceph_sb_to_client(inode->i_sb), |
1819 | RBYTES)) | ||
1820 | stat->size = ci->i_rbytes; | ||
1821 | else | ||
1822 | stat->size = ci->i_files + ci->i_subdirs; | ||
1823 | stat->blocks = 0; | 1823 | stat->blocks = 0; |
1824 | stat->blksize = 65536; | 1824 | stat->blksize = 65536; |
1825 | } | 1825 | } |