lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1275095966-18382-1-git-send-email-xiaosuo@gmail.com>
Date:	Sat, 29 May 2010 09:19:26 +0800
From:	Changli Gao <xiaosuo@...il.com>
To:	Alexander Viro <viro@...iv.linux.org.uk>
Cc:	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
	Changli Gao <xiaosuo@...il.com>
Subject: [PATCH 2/2] fs: optimize mpage_bio_submit()

optimize mpage_bio_submit()

check rw, then initialize bio->bi_end_io.

Signed-off-by: Changli Gao <xiaosuo@...il.com>
----
 fs/mpage.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/fs/mpage.c b/fs/mpage.c
index 94ff0d1..632681c 100644
--- a/fs/mpage.c
+++ b/fs/mpage.c
@@ -85,9 +85,7 @@ static void mpage_end_io_write(struct bio *bio, int err)
 
 static struct bio *mpage_bio_submit(int rw, struct bio *bio)
 {
-	bio->bi_end_io = mpage_end_io_read;
-	if (rw == WRITE)
-		bio->bi_end_io = mpage_end_io_write;
+	bio->bi_end_io = rw != WRITE ? mpage_end_io_read : mpage_end_io_write;
 	submit_bio(rw, bio);
 	return NULL;
 }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ