diff options
author | Douglas Fuller <dfuller@redhat.com> | 2017-08-16 10:19:27 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2017-09-06 19:56:49 +0200 |
commit | 06d74376c8af32f5b8d777a943aa4dc99165088b (patch) | |
tree | e3a431e2eaae92a5fc64bc8e55853367efb7cc30 /fs/ceph | |
parent | 92776fd2c230f80be910cf33acd99682345209cd (diff) | |
download | linux-stable-06d74376c8af32f5b8d777a943aa4dc99165088b.tar.gz linux-stable-06d74376c8af32f5b8d777a943aa4dc99165088b.tar.bz2 linux-stable-06d74376c8af32f5b8d777a943aa4dc99165088b.zip |
ceph: more accurate statfs
Improve accuracy of statfs reporting for Ceph filesystems comprising
exactly one data pool. In this case, the Ceph monitor can now report
the space usage for the single data pool instead of the global data
for the entire Ceph cluster. Include support for this message in
mon_client and leverage it in ceph/super.
Signed-off-by: Douglas Fuller <dfuller@redhat.com>
Reviewed-by: Yan, Zheng <zyan@redhat.com>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/super.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/ceph/super.c b/fs/ceph/super.c index 1deb8810d7c7..324d29ecbe0b 100644 --- a/fs/ceph/super.c +++ b/fs/ceph/super.c @@ -49,9 +49,16 @@ static int ceph_statfs(struct dentry *dentry, struct kstatfs *buf) struct ceph_statfs st; u64 fsid; int err; + u64 data_pool; + + if (fsc->mdsc->mdsmap->m_num_data_pg_pools == 1) { + data_pool = fsc->mdsc->mdsmap->m_data_pg_pools[0]; + } else { + data_pool = CEPH_NOPOOL; + } dout("statfs\n"); - err = ceph_monc_do_statfs(&fsc->client->monc, &st); + err = ceph_monc_do_statfs(&fsc->client->monc, data_pool, &st); if (err < 0) return err; |