Skip to contentSkip to conversation

ceph: delete unnecessary condition judgment

PATCH In review Zhang Zhen 2 participants 2 messages Apr 28, 2014 1 message not in the archive Ceph client

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Zhang Zhen

author
#1 lore raw

PATCH 1/1 ceph: delete unnecessary condition judgment

If the return number of ceph_osdc_readpages() is not less than zero, it is certainly greater than or equal to zero.

So the condition judgment is unnecessary.

---
 fs/ceph/addr.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/ceph/addr.c +1 -2
index b53278c..8f579d2 100644
@@ -221,8 +221,7 @@ static int readpage_nounlock(struct file *filp, struct page *page)
 	}
 	SetPageUptodate(page);
 
-	if (err >= 0)
-		ceph_readpage_to_fscache(inode, page);
+	ceph_readpage_to_fscache(inode, page);
 
 out:
 	return err < 0 ? err : 0;
Signature · 4 lines
1.8.1.2


.
Reviewed-by on v1 1/1
#2 lore raw
Quoted 5 lines · Zhang Zhen

If the return number of ceph_osdc_readpages() is not less than zero, it is certainly greater than or equal to zero.

So the condition judgment is unnecessary.

Looks good.

Quoted 20 lines
---
  fs/ceph/addr.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
fs/ceph/addr.c +1 -2
index b53278c..8f579d2 100644
@@ -221,8 +221,7 @@ static int readpage_nounlock(struct file *filp, struct page *page)
  	}
  	SetPageUptodate(page);
 
-	if (err >= 0)
-		ceph_readpage_to_fscache(inode, page);
+	ceph_readpage_to_fscache(inode, page);
 
  out:
  	return err < 0 ? err : 0;