Re: patch: improve generic_file_buffered_write() (2nd try 2/2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I guess when aio was introduced this was probably forgotten. For small chunks 
or synchronous i/o the likehood is correct, but for big data chunks and aio 
the likehood is false.

Signed-off-by: Bernd Schubert <[email protected]>
Signed-off-by: Goswin von Brederlow <[email protected]>

Index: linux-2.6.20.3/mm/filemap.c
===================================================================
--- linux-2.6.20.3.orig/mm/filemap.c	2007-09-05 18:51:59.000000000 +0200
+++ linux-2.6.20.3/mm/filemap.c	2007-09-05 18:53:12.000000000 +0200
@@ -2100,7 +2100,7 @@
 	/*
 	 * handle partial DIO write.  Adjust cur_iov if needed.
 	 */
-	if (likely(nr_segs == 1))
+	if (nr_segs == 1)
 		buf = iov->iov_base + written;
 	else {
 		filemap_set_next_iovec(&cur_iov, &iov_base, written);
@@ -2167,7 +2167,7 @@
 					vmtruncate(inode, isize);
 			}
 		}
-		if (likely(nr_segs == 1))
+		if (nr_segs == 1)
 			copied = filemap_copy_from_user(page, offset,
 							buf, bytes);
 		else
@@ -2213,7 +2213,7 @@
 				count -= copied;
 				pos += copied;
 				buf += copied;
-				if (unlikely(nr_segs > 1)) {
+				if (nr_segs > 1) {
 					filemap_set_next_iovec(&cur_iov,
 							&iov_base, copied);
 					if (count)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux