android_kernel_motorola_sm6225/include
OGAWA Hirofumi 111ebb6e6f [PATCH] writeback: fix range handling
When a writeback_control's `start' and `end' fields are used to
indicate a one-byte-range starting at file offset zero, the required
values of .start=0,.end=0 mean that the ->writepages() implementation
has no way of telling that it is being asked to perform a range
request.  Because we're currently overloading (start == 0 && end == 0)
to mean "this is not a write-a-range request".

To make all this sane, the patch changes range of writeback_control.

So caller does: If it is calling ->writepages() to write pages, it
sets range (range_start/end or range_cyclic) always.

And if range_cyclic is true, ->writepages() thinks the range is
cyclic, otherwise it just uses range_start and range_end.

This patch does,

    - Add LLONG_MAX, LLONG_MIN, ULLONG_MAX to include/linux/kernel.h
      -1 is usually ok for range_end (type is long long). But, if someone did,

		range_end += val;		range_end is "val - 1"
		u64val = range_end >> bits;	u64val is "~(0ULL)"

      or something, they are wrong. So, this adds LLONG_MAX to avoid nasty
      things, and uses LLONG_MAX for range_end.

    - All callers of ->writepages() sets range_start/end or range_cyclic.

    - Fix updates of ->writeback_index. It seems already bit strange.
      If it starts at 0 and ended by check of nr_to_write, this last
      index may reduce chance to scan end of file.  So, this updates
      ->writeback_index only if range_cyclic is true or whole-file is
      scanned.

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Nathan Scott <nathans@sgi.com>
Cc: Anton Altaparmakov <aia21@cantab.net>
Cc: Steven French <sfrench@us.ibm.com>
Cc: "Vladimir V. Saveliev" <vs@namesys.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-06-23 07:42:49 -07:00
..
acpi [PATCH] Unify pxm_to_node() and node_to_pxm() 2006-06-23 07:42:48 -07:00
asm-alpha [PATCH] vgacon: make VGA_MAP_MEM take size, remove extra use 2006-06-22 15:05:58 -07:00
asm-arm Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm 2006-06-22 22:46:28 -07:00
asm-arm26 Remove unneeded _syscallX macros from user view in asm-*/unistd.h 2006-04-29 01:51:47 +01:00
asm-cris Remove unneeded _syscallX macros from user view in asm-*/unistd.h 2006-04-29 01:51:47 +01:00
asm-frv Remove unneeded _syscallX macros from user view in asm-*/unistd.h 2006-04-29 01:51:47 +01:00
asm-generic [PATCH] squash duplicate page_to_pfn and pfn_to_page 2006-06-23 07:42:47 -07:00
asm-h8300 Remove unneeded _syscallX macros from user view in asm-*/unistd.h 2006-04-29 01:51:47 +01:00
asm-i386 Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6 2006-06-22 15:07:59 -07:00
asm-ia64 Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6 2006-06-22 15:07:59 -07:00
asm-m32r [PATCH] vgacon: make VGA_MAP_MEM take size, remove extra use 2006-06-22 15:05:58 -07:00
asm-m68k Remove unneeded _syscallX macros from user view in asm-*/unistd.h 2006-04-29 01:51:47 +01:00
asm-m68knommu Remove unneeded _syscallX macros from user view in asm-*/unistd.h 2006-04-29 01:51:47 +01:00
asm-mips [PATCH] vgacon: make VGA_MAP_MEM take size, remove extra use 2006-06-22 15:05:58 -07:00
asm-parisc Remove unneeded _syscallX macros from user view in asm-*/unistd.h 2006-04-29 01:51:47 +01:00
asm-powerpc Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2006-06-22 22:11:30 -07:00
asm-ppc Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2006-06-22 22:11:30 -07:00
asm-s390 [PATCH] s390: add __raw_writeq required by __iowrite64_copy 2006-06-20 19:55:53 -07:00
asm-sh Remove unneeded _syscallX macros from user view in asm-*/unistd.h 2006-04-29 01:51:47 +01:00
asm-sh64 Remove unneeded _syscallX macros from user view in asm-*/unistd.h 2006-04-29 01:51:47 +01:00
asm-sparc Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6 2006-06-20 17:39:28 -07:00
asm-sparc64 [PATCH] vgacon: make VGA_MAP_MEM take size, remove extra use 2006-06-22 15:05:58 -07:00
asm-um Merge git://git.infradead.org/hdrcleanup-2.6 2006-06-20 15:10:08 -07:00
asm-v850 Remove unneeded _syscallX macros from user view in asm-*/unistd.h 2006-04-29 01:51:47 +01:00
asm-x86_64 [PATCH] Unify pxm_to_node() and node_to_pxm() 2006-06-23 07:42:48 -07:00
asm-xtensa [PATCH] vgacon: make VGA_MAP_MEM take size, remove extra use 2006-06-22 15:05:58 -07:00
keys
linux [PATCH] writeback: fix range handling 2006-06-23 07:42:49 -07:00
math-emu
media Revert include/media changes: Mauro says those ioctls are only used in-kernel(!) 2006-05-06 19:47:57 +01:00
mtd Merge git://git.infradead.org/hdrcleanup-2.6 2006-06-20 15:10:08 -07:00
net Merge branch 'master' into upstream 2006-06-22 22:51:46 -04:00
pcmcia Don't include linux/config.h from anywhere else in include/ 2006-04-26 12:56:16 +01:00
rdma IB/uverbs: Don't serialize with ib_uverbs_idr_mutex 2006-06-17 20:44:49 -07:00
rxrpc
scsi Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2006-06-21 11:18:25 -07:00
sound [ALSA] version 1.0.12rc1 2006-06-22 21:35:11 +02:00
video Don't include linux/config.h from anywhere else in include/ 2006-04-26 12:56:16 +01:00