All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yunfeng Ye <yeyunfeng@huawei.com>
To: <clm@fb.com>, <josef@toxicpanda.com>, <dsterba@suse.com>,
	<linux-btrfs@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	"hushiyuan@huawei.com" <hushiyuan@huawei.com>,
	"linfeilong@huawei.com" <linfeilong@huawei.com>
Subject: [PATCH] btrfs: remove unused condition check in btrfs_page_mkwrite()
Date: Tue, 3 Dec 2019 16:16:43 +0800	[thread overview]
Message-ID: <a84442bc-304b-2514-272e-ea89aae4b992@huawei.com> (raw)

The condition '!ret2' is always true. so remove the unused condition
check.

Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>
---
 fs/btrfs/inode.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 56032c518b26..eef2432597e2 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -9073,7 +9073,6 @@ vm_fault_t btrfs_page_mkwrite(struct vm_fault *vmf)
 		ret = VM_FAULT_SIGBUS;
 		goto out_unlock;
 	}
-	ret2 = 0;

 	/* page is wholly or partially inside EOF */
 	if (page_start + PAGE_SIZE > size)
@@ -9097,12 +9096,10 @@ vm_fault_t btrfs_page_mkwrite(struct vm_fault *vmf)

 	unlock_extent_cached(io_tree, page_start, page_end, &cached_state);

-	if (!ret2) {
-		btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE);
-		sb_end_pagefault(inode->i_sb);
-		extent_changeset_free(data_reserved);
-		return VM_FAULT_LOCKED;
-	}
+	btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE);
+	sb_end_pagefault(inode->i_sb);
+	extent_changeset_free(data_reserved);
+	return VM_FAULT_LOCKED;

 out_unlock:
 	unlock_page(page);
-- 
2.7.4


             reply	other threads:[~2019-12-03  8:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-03  8:16 Yunfeng Ye [this message]
2019-12-03  8:24 ` [PATCH] btrfs: remove unused condition check in btrfs_page_mkwrite() Omar Sandoval
2019-12-03  8:33   ` Yunfeng Ye

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a84442bc-304b-2514-272e-ea89aae4b992@huawei.com \
    --to=yeyunfeng@huawei.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=hushiyuan@huawei.com \
    --cc=josef@toxicpanda.com \
    --cc=linfeilong@huawei.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.