diff options
author | Yan, Zheng <zyan@redhat.com> | 2017-05-22 12:03:32 +0800 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2017-07-07 17:25:12 +0200 |
commit | efb0ca765ac6f4985b57ef215e8d55e746b083f4 (patch) | |
tree | 8333c6ae9ed47a7134c0163d07670970d1eff4b4 /fs/ceph/inode.c | |
parent | 84eea8c79090c44564877cd47c73455e32ec4846 (diff) |
ceph: update the 'approaching max_size' code
The old 'approaching max_size' code expects MDS set max_size to
'2 * reported_size'. This is no longer true. The new code reports
file size when half of previous max_size increment has been used.
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/inode.c')
-rw-r--r-- | fs/ceph/inode.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 4de6cdddf059..53f23c920266 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -1653,20 +1653,17 @@ out: return err; } -int ceph_inode_set_size(struct inode *inode, loff_t size) +bool ceph_inode_set_size(struct inode *inode, loff_t size) { struct ceph_inode_info *ci = ceph_inode(inode); - int ret = 0; + bool ret; spin_lock(&ci->i_ceph_lock); dout("set_size %p %llu -> %llu\n", inode, inode->i_size, size); i_size_write(inode, size); inode->i_blocks = calc_inode_blocks(size); - /* tell the MDS if we are approaching max_size */ - if ((size << 1) >= ci->i_max_size && - (ci->i_reported_size << 1) < ci->i_max_size) - ret = 1; + ret = __ceph_should_report_size(ci); spin_unlock(&ci->i_ceph_lock); return ret; |