1. 06 2月, 2008 1 次提交
    • C
      Pagecache zeroing: zero_user_segment, zero_user_segments and zero_user · eebd2aa3
      Christoph Lameter 提交于
      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: NChristoph 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: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      eebd2aa3
  2. 26 1月, 2008 4 次提交
  3. 28 11月, 2007 1 次提交
  4. 07 11月, 2007 1 次提交
  5. 17 10月, 2007 1 次提交
  6. 13 10月, 2007 4 次提交
    • M
      ocfs2: Write support for inline data · 1afc32b9
      Mark Fasheh 提交于
      This fixes up write, truncate, mmap, and RESVSP/UNRESVP to understand inline
      inode data.
      
      For the most part, the changes to the core write code can be relied on to do
      the heavy lifting. Any code calling ocfs2_write_begin (including shared
      writeable mmap) can count on it doing the right thing with respect to
      growing inline data to an extent tree.
      
      Size reducing truncates, including UNRESVP can simply zero that portion of
      the inode block being removed. Size increasing truncatesm, including RESVP
      have to be a little bit smarter and grow the inode to an extent tree if
      necessary.
      Signed-off-by: NMark Fasheh <mark.fasheh@oracle.com>
      Reviewed-by: NJoel Becker <joel.becker@oracle.com>
      1afc32b9
    • M
      ocfs2: Read support for inline data · 6798d35a
      Mark Fasheh 提交于
      This hooks up ocfs2_readpage() to populate a page with data from an inode
      block. Direct IO reads from inline data are modified to fall back to
      buffered I/O. Appropriate checks are also placed in the extent map code to
      avoid reading an extent list when inline data might be stored.
      Signed-off-by: NMark Fasheh <mark.fasheh@oracle.com>
      Reviewed-by: NJoel Becker <joel.becker@oracle.com>
      6798d35a
    • M
      ocfs2: Small refactor of truncate zeroing code · 1d410a6e
      Mark Fasheh 提交于
      We'll want to reuse most of this when pushing inline data back out to an
      extent. Keeping this part as a seperate patch helps to keep the upcoming
      changes for write support uncluttered.
      
      The core portion of ocfs2_zero_cluster_pages() responsible for making sure a
      page is mapped and properly dirtied is abstracted out into it's own
      function, ocfs2_map_and_dirty_page(). Actual functionality doesn't change,
      though zeroing becomes optional.
      
      We also turn part of ocfs2_free_write_ctxt() into  a common function for
      unlocking and freeing a page array. This operation is very common (and
      uniform) for Ocfs2 cluster sizes greater than page size, so it makes sense
      to keep the code in one place.
      Signed-off-by: NMark Fasheh <mark.fasheh@oracle.com>
      Reviewed-by: NJoel Becker <joel.becker@oracle.com>
      1d410a6e
    • M
      ocfs2: move nonsparse hole-filling into ocfs2_write_begin() · 65ed39d6
      Mark Fasheh 提交于
      By doing this, we can remove any higher level logic which has to have
      knowledge of btree functionality - any callers of ocfs2_write_begin() can
      now expect it to do anything necessary to prepare the inode for new data.
      Signed-off-by: NMark Fasheh <mark.fasheh@oracle.com>
      Reviewed-by: NJoel Becker <joel.becker@oracle.com>
      65ed39d6
  7. 21 9月, 2007 2 次提交
  8. 12 9月, 2007 1 次提交
  9. 20 7月, 2007 1 次提交
    • N
      mm: merge populate and nopage into fault (fixes nonlinear) · 54cb8821
      Nick Piggin 提交于
      Nonlinear mappings are (AFAIKS) simply a virtual memory concept that encodes
      the virtual address -> file offset differently from linear mappings.
      
      ->populate is a layering violation because the filesystem/pagecache code
      should need to know anything about the virtual memory mapping.  The hitch here
      is that the ->nopage handler didn't pass down enough information (ie.  pgoff).
       But it is more logical to pass pgoff rather than have the ->nopage function
      calculate it itself anyway (because that's a similar layering violation).
      
      Having the populate handler install the pte itself is likewise a nasty thing
      to be doing.
      
      This patch introduces a new fault handler that replaces ->nopage and
      ->populate and (later) ->nopfn.  Most of the old mechanism is still in place
      so there is a lot of duplication and nice cleanups that can be removed if
      everyone switches over.
      
      The rationale for doing this in the first place is that nonlinear mappings are
      subject to the pagefault vs invalidate/truncate race too, and it seemed stupid
      to duplicate the synchronisation logic rather than just consolidate the two.
      
      After this patch, MAP_NONBLOCK no longer sets up ptes for pages present in
      pagecache.  Seems like a fringe functionality anyway.
      
      NOPAGE_REFAULT is removed.  This should be implemented with ->fault, and no
      users have hit mainline yet.
      
      [akpm@linux-foundation.org: cleanup]
      [randy.dunlap@oracle.com: doc. fixes for readahead]
      [akpm@linux-foundation.org: build fix]
      Signed-off-by: NNick Piggin <npiggin@suse.de>
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Cc: Mark Fasheh <mark.fasheh@oracle.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      54cb8821
  10. 11 7月, 2007 9 次提交
  11. 07 6月, 2007 1 次提交
    • M
      ocfs2: Fix invalid assertion during write on 64k pages · eeb47d12
      Mark Fasheh 提交于
      The write path code intends to bug if a math error (or unhandled case)
      results in a write outside of the current cluster boundaries. The actual
      BUG_ON() statements however are incorrect, leading to a crash on kernels
      with 64k page size. Fix those by checking against the right variables.
      
      Also, move the assertions higher up within the functions so that they trip
      *before* the code starts to mark buffers.
      Signed-off-by: NMark Fasheh <mark.fasheh@oracle.com>
      eeb47d12
  12. 26 5月, 2007 2 次提交
  13. 03 5月, 2007 3 次提交
  14. 27 4月, 2007 9 次提交