diff options
-rw-r--r-- | fs/ceph/inode.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index e791fa34b23..50001de66c6 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c | |||
@@ -701,10 +701,6 @@ static int fill_inode(struct inode *inode, | |||
701 | ci->i_ceph_flags |= CEPH_I_COMPLETE; | 701 | ci->i_ceph_flags |= CEPH_I_COMPLETE; |
702 | ci->i_max_offset = 2; | 702 | ci->i_max_offset = 2; |
703 | } | 703 | } |
704 | |||
705 | /* it may be better to set st_size in getattr instead? */ | ||
706 | if (ceph_test_mount_opt(ceph_sb_to_client(inode->i_sb), RBYTES)) | ||
707 | inode->i_size = ci->i_rbytes; | ||
708 | break; | 704 | break; |
709 | default: | 705 | default: |
710 | pr_err("fill_inode %llx.%llx BAD mode 0%o\n", | 706 | pr_err("fill_inode %llx.%llx BAD mode 0%o\n", |
@@ -1805,7 +1801,11 @@ int ceph_getattr(struct vfsmount *mnt, struct dentry *dentry, | |||
1805 | else | 1801 | else |
1806 | stat->dev = 0; | 1802 | stat->dev = 0; |
1807 | if (S_ISDIR(inode->i_mode)) { | 1803 | if (S_ISDIR(inode->i_mode)) { |
1808 | stat->size = ci->i_rbytes; | 1804 | if (ceph_test_mount_opt(ceph_sb_to_client(inode->i_sb), |
1805 | RBYTES)) | ||
1806 | stat->size = ci->i_rbytes; | ||
1807 | else | ||
1808 | stat->size = ci->i_files + ci->i_subdirs; | ||
1809 | stat->blocks = 0; | 1809 | stat->blocks = 0; |
1810 | stat->blksize = 65536; | 1810 | stat->blksize = 65536; |
1811 | } | 1811 | } |