android_kernel_xiaomi_sm8350/fs/ntfs
Christoph Lameter eebd2aa355 Pagecache zeroing: zero_user_segment, zero_user_segments and zero_user
Simplify page cache zeroing of segments of pages through 3 functions

zero_user_segments(page, start1, end1, start2, end2)

        Zeros two segments of the page. It takes the position where to
        start and end the zeroing which avoids length calculations and
	makes code clearer.

zero_user_segment(page, start, end)

        Same for a single segment.

zero_user(page, start, length)

        Length variant for the case where we know the length.

We remove the zero_user_page macro. Issues:

1. Its a macro. Inline functions are preferable.

2. The KM_USER0 macro is only defined for HIGHMEM.

   Having to treat this special case everywhere makes the
   code needlessly complex. The parameter for zeroing is always
   KM_USER0 except in one single case that we open code.

Avoiding KM_USER0 makes a lot of code not having to be dealing
with the special casing for HIGHMEM anymore. Dealing with
kmap is only necessary for HIGHMEM configurations. In those
configurations we use KM_USER0 like we do for a series of other
functions defined in highmem.h.

Since KM_USER0 is depends on HIGHMEM the existing zero_user_page
function could not be a macro. zero_user_* functions introduced
here can be be inline because that constant is not used when these
functions are called.

Also extract the flushing of the caches to be outside of the kmap.

[akpm@linux-foundation.org: fix nfs and ntfs build]
[akpm@linux-foundation.org: fix ntfs build some more]
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Cc: Steven French <sfrench@us.ibm.com>
Cc: Michael Halcrow <mhalcrow@us.ibm.com>
Cc: <linux-ext4@vger.kernel.org>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Anton Altaparmakov <aia21@cantab.net>
Cc: Mark Fasheh <mark.fasheh@oracle.com>
Cc: David Chinner <dgc@sgi.com>
Cc: Michael Halcrow <mhalcrow@us.ibm.com>
Cc: Steven French <sfrench@us.ibm.com>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-05 09:44:13 -08:00
..
aops.c Pagecache zeroing: zero_user_segment, zero_user_segments and zero_user 2008-02-05 09:44:13 -08:00
aops.h
attrib.c NTFS: Fix read regression. 2007-11-03 12:27:21 -07:00
attrib.h
bitmap.c
bitmap.h
ChangeLog fix typo "insted" -> "instead" 2007-10-20 01:55:04 +02:00
collate.c
collate.h
compress.c Pagecache zeroing: zero_user_segment, zero_user_segments and zero_user 2008-02-05 09:44:13 -08:00
debug.c
debug.h
dir.c
dir.h
endian.h
file.c Pagecache zeroing: zero_user_segment, zero_user_segments and zero_user 2008-02-05 09:44:13 -08:00
index.c
index.h
inode.c
inode.h
layout.h
lcnalloc.c
lcnalloc.h
logfile.c
logfile.h
Makefile
malloc.h
mft.c
mft.h
mst.c
namei.c exportfs: make struct export_operations const 2007-10-22 08:13:21 -07:00
ntfs.h exportfs: make struct export_operations const 2007-10-22 08:13:21 -07:00
quota.c
quota.h
runlist.c
runlist.h
super.c writeback: fix ntfs with sb_has_dirty_inodes() 2007-10-17 08:43:02 -07:00
sysctl.c Convert files to UTF-8 and some cleanups 2007-10-19 23:21:04 +02:00
sysctl.h Convert files to UTF-8 and some cleanups 2007-10-19 23:21:04 +02:00
time.h
types.h
unistr.c
upcase.c
usnjrnl.c
usnjrnl.h
volume.h