dect
/
linux-2.6
Archived
13
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
linux-2.6/fs/gfs2
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
..
locking Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw 2008-01-25 08:39:18 -08:00
Kconfig
Makefile [GFS2] Use ->page_mkwrite() for mmap() 2008-01-25 08:07:13 +00:00
acl.c Introduce is_owner_or_cap() to wrap CAP_FOWNER use with fsuid check 2007-07-17 12:00:03 -07:00
acl.h
bmap.c Pagecache zeroing: zero_user_segment, zero_user_segments and zero_user 2008-02-05 09:44:13 -08:00
bmap.h [GFS2] Remove function gfs2_get_block 2008-01-25 08:08:25 +00:00
daemon.c [GFS2] Move gfs2_logd into log.c 2008-01-25 08:07:56 +00:00
daemon.h [GFS2] Move gfs2_logd into log.c 2008-01-25 08:07:56 +00:00
dir.c [GFS2] Reduce inode size by moving i_alloc out of line 2008-01-25 08:18:25 +00:00
dir.h
eaops.c [GFS2] Remove unrequired code 2008-01-25 08:08:13 +00:00
eaops.h [GFS2] mark struct *_operations const 2007-10-10 08:55:03 +01:00
eattr.c [GFS2] Reduce inode size by moving i_alloc out of line 2008-01-25 08:18:25 +00:00
eattr.h
gfs2.h
glock.c [GFS2] Reorganize function gfs2_glmutex_lock 2008-01-25 08:13:52 +00:00
glock.h [GFS2] flocks from same process trip kernel BUG at fs/gfs2/glock.c:1118! 2007-10-10 08:56:14 +01:00
glops.c [GFS2] Reorder writeback for glock sync 2008-01-25 08:07:42 +00:00
glops.h
incore.h [GFS2] Remove unneeded i_spin 2008-01-25 08:18:44 +00:00
inode.c [GFS2] Lockup on error 2008-01-25 08:21:04 +00:00
inode.h [GFS2] Introduce gfs2_set_aops() 2008-01-25 08:07:23 +00:00
lm.c
lm.h
locking.c
log.c [GFS2] Fix assert in log code 2008-01-25 08:18:03 +00:00
log.h [GFS2] Move gfs2_logd into log.c 2008-01-25 08:07:56 +00:00
lops.c [GFS2] Don't add glocks to the journal 2008-01-25 08:07:52 +00:00
lops.h [GFS2] assertion failure after writing to journaled file, umount 2007-07-09 08:23:47 +01:00
main.c [GFS2] Remove unneeded i_spin 2008-01-25 08:18:44 +00:00
meta_io.c [GFS2] Fix typo 2008-01-25 08:19:51 +00:00
meta_io.h [GFS2] Remove useless i_cache from inodes 2008-01-25 08:07:16 +00:00
mount.c [GFS2] Add NULL entry to token table 2007-10-10 08:55:34 +01:00
mount.h
ops_address.c Pagecache zeroing: zero_user_segment, zero_user_segments and zero_user 2008-02-05 09:44:13 -08:00
ops_address.h [GFS2] Remove function gfs2_get_block 2008-01-25 08:08:25 +00:00
ops_dentry.c
ops_dentry.h
ops_export.c exportfs: make struct export_operations const 2007-10-22 08:13:21 -07:00
ops_file.c [GFS2] Fix page_mkwrite truncation race path 2008-01-25 08:20:15 +00:00
ops_fstype.c [GFS2] Initialize extent_list earlier 2008-01-25 08:17:04 +00:00
ops_fstype.h exportfs: make struct export_operations const 2007-10-22 08:13:21 -07:00
ops_inode.c [GFS2] Reduce inode size by moving i_alloc out of line 2008-01-25 08:18:25 +00:00
ops_inode.h [GFS2] Remove lock methods for lock_nolock protocol 2008-01-25 08:08:15 +00:00
ops_super.c [GFS2] Remove unused field in struct gfs2_inode 2008-01-25 08:07:18 +00:00
ops_super.h
quota.c [GFS2] Reduce inode size by moving i_alloc out of line 2008-01-25 08:18:25 +00:00
quota.h
recovery.c fs/: Spelling fixes 2008-02-03 17:33:42 +02:00
recovery.h
rgrp.c [GFS2] Reduce inode size by moving i_alloc out of line 2008-01-25 08:18:25 +00:00
rgrp.h [GFS2] Reduce inode size by moving i_alloc out of line 2008-01-25 08:18:25 +00:00
super.c [GFS2] Initialize extent_list earlier 2008-01-25 08:17:04 +00:00
super.h [GFS2] Fix sign problem in quota/statfs and cleanup _host structures 2007-07-09 08:23:10 +01:00
sys.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw 2008-01-25 08:39:18 -08:00
sys.h
trans.c [GFS2] Don't add glocks to the journal 2008-01-25 08:07:52 +00:00
trans.h [GFS2] Don't add glocks to the journal 2008-01-25 08:07:52 +00:00
util.c [GFS2] Fix sign problem in quota/statfs and cleanup _host structures 2007-07-09 08:23:10 +01:00
util.h