提交 0f26c4b2 编写于 作者: Y Yehuda Sadeh 提交者: Sage Weil

ceph: remove unreachable code

We never truncate to a smaller size without contacting the MDS.
Signed-off-by: NYehuda Sadeh <yehuda@hq.newdream.net>
Signed-off-by: NSage Weil <sage@newdream.net>
上级 ac8839d7
...@@ -1396,7 +1396,6 @@ int ceph_setattr(struct dentry *dentry, struct iattr *attr) ...@@ -1396,7 +1396,6 @@ int ceph_setattr(struct dentry *dentry, struct iattr *attr)
int release = 0, dirtied = 0; int release = 0, dirtied = 0;
int mask = 0; int mask = 0;
int err = 0; int err = 0;
int queue_trunc = 0;
if (ceph_snap(inode) != CEPH_NOSNAP) if (ceph_snap(inode) != CEPH_NOSNAP)
return -EROFS; return -EROFS;
...@@ -1510,11 +1509,6 @@ int ceph_setattr(struct dentry *dentry, struct iattr *attr) ...@@ -1510,11 +1509,6 @@ int ceph_setattr(struct dentry *dentry, struct iattr *attr)
if ((issued & CEPH_CAP_FILE_EXCL) && if ((issued & CEPH_CAP_FILE_EXCL) &&
attr->ia_size > inode->i_size) { attr->ia_size > inode->i_size) {
inode->i_size = attr->ia_size; inode->i_size = attr->ia_size;
if (attr->ia_size < inode->i_size) {
ci->i_truncate_size = attr->ia_size;
ci->i_truncate_pending++;
queue_trunc = 1;
}
inode->i_blocks = inode->i_blocks =
(attr->ia_size + (1 << 9) - 1) >> 9; (attr->ia_size + (1 << 9) - 1) >> 9;
inode->i_ctime = attr->ia_ctime; inode->i_ctime = attr->ia_ctime;
...@@ -1567,9 +1561,6 @@ int ceph_setattr(struct dentry *dentry, struct iattr *attr) ...@@ -1567,9 +1561,6 @@ int ceph_setattr(struct dentry *dentry, struct iattr *attr)
release &= issued; release &= issued;
spin_unlock(&inode->i_lock); spin_unlock(&inode->i_lock);
if (queue_trunc)
__ceph_do_pending_vmtruncate(inode);
if (mask) { if (mask) {
req->r_inode = igrab(inode); req->r_inode = igrab(inode);
req->r_inode_drop = release; req->r_inode_drop = release;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册