[Devel,vz7] fuse: writepages search nits

Submitted by Maxim Patlasov on April 7, 2017, 5:59 p.m.

Details

Message ID 149158793994.8112.3051571646238719520.stgit@maxim-thinkpad
State New
Series "fuse: writepages search nits"
Headers show

Commit Message

Maxim Patlasov April 7, 2017, 5:59 p.m.
The patch removes redundant checks in rb-tree search. Thanks to
Kirill Tkhai for pointing out.

https://jira.sw.ru/browse/PSBM-59254

Signed-off-by: Maxim Patlasov <mpatlasov@virtuozzo.com>
---
 fs/fuse/file.c |    9 ---------
 1 file changed, 9 deletions(-)

Patch hide | download patch | download mbox

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index eab5030..4f62237 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -507,10 +507,6 @@  static bool fuse_range_is_writeback(struct inode *inode, pgoff_t idx_from,
 	spin_lock(&fc->lock);
 
 	n = fi->writepages.rb_node;
-	if (!n) {
-		spin_unlock(&fc->lock);
-		return false;
-	}
 
 	while (n) {
 		struct fuse_req *req;
@@ -550,11 +546,6 @@  static bool fuse_page_is_writeback(struct inode *inode, pgoff_t index)
 	spin_lock(&fc->lock);
 
 	n = fi->writepages.rb_node;
-	if (!n) {
-		spin_unlock(&fc->lock);
-		return false;
-	}
-
 
 	while (n) {
 		struct fuse_req *req;

Comments

Kirill Tkhai April 7, 2017, 6:58 p.m.
On 07.04.2017 20:59, Maxim Patlasov wrote:
> The patch removes redundant checks in rb-tree search. Thanks to
> Kirill Tkhai for pointing out.
> 
> https://jira.sw.ru/browse/PSBM-59254
> 
> Signed-off-by: Maxim Patlasov <mpatlasov@virtuozzo.com>

Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>

> ---
>  fs/fuse/file.c |    9 ---------
>  1 file changed, 9 deletions(-)
> 
> diff --git a/fs/fuse/file.c b/fs/fuse/file.c
> index eab5030..4f62237 100644
> --- a/fs/fuse/file.c
> +++ b/fs/fuse/file.c
> @@ -507,10 +507,6 @@ static bool fuse_range_is_writeback(struct inode *inode, pgoff_t idx_from,
>  	spin_lock(&fc->lock);
>  
>  	n = fi->writepages.rb_node;
> -	if (!n) {
> -		spin_unlock(&fc->lock);
> -		return false;
> -	}
>  
>  	while (n) {
>  		struct fuse_req *req;
> @@ -550,11 +546,6 @@ static bool fuse_page_is_writeback(struct inode *inode, pgoff_t index)
>  	spin_lock(&fc->lock);
>  
>  	n = fi->writepages.rb_node;
> -	if (!n) {
> -		spin_unlock(&fc->lock);
> -		return false;
> -	}
> -
>  
>  	while (n) {
>  		struct fuse_req *req;
>