1. 06 Aug, 2018 1 commit
  2. 01 Nov, 2016 1 commit
  3. 07 Jun, 2016 1 commit
  4. 04 Apr, 2016 1 commit
    • Kirill A. Shutemov's avatar
      mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros · 09cbfeaf
      Kirill A. Shutemov authored
      PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time
      ago with promise that one day it will be possible to implement page
      cache with bigger chunks than PAGE_SIZE.
      This promise never materialized.  And unlikely will.
      We have many places where PAGE_CACHE_SIZE assumed to be equal to
      PAGE_SIZE.  And it's constant source of confusion on whether
      PAGE_CACHE_* or PAGE_* constant should be used in a particular case,
      especially on the border between fs and mm.
      Global switching to PAGE_CACHE_SIZE != PAGE_SIZE would cause to much
      breakage to be doable.
      Let's stop pretending that pages in page cache are special.  They are
      The changes are pretty straight-forward:
       - <foo> << (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
       - <foo> >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
       - page_cache_get() -> get_page();
       - page_cache_release() -> put_page();
      This patch contains automated changes generated with coccinelle using
      script below.  For some reason, coccinelle doesn't patch header files.
      I've called spatch for them manually.
      The only adjustment after coccinelle is revert of changes to
      PAGE_CAHCE_ALIGN definition: we are going to drop it later.
      There are few places in the code where coccinelle didn't reach.  I'll
      fix them manually in a separate patch.  Comments and documentation also
      will be addressed with the separate patch.
      virtual patch
      expression E;
      + E
      expression E;
      + E
      + PAGE_SHIFT
      + PAGE_SIZE
      + PAGE_MASK
      expression E;
      + PAGE_ALIGN(E)
      expression E;
      - page_cache_get(E)
      + get_page(E)
      expression E;
      - page_cache_release(E)
      + put_page(E)
      Signed-off-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
  5. 20 Nov, 2013 2 commits
    • Phillip Lougher's avatar
      Squashfs: Generalise paging handling in the decompressors · 846b730e
      Phillip Lougher authored
      Further generalise the decompressors by adding a page handler
      abstraction.  This adds helpers to allow the decompressors
      to access and process the output buffers in an implementation
      independant manner.
      This allows different types of output buffer to be passed
      to the decompressors, with the implementation specific
      aspects handled at decompression time, but without the
      knowledge being held in the decompressor wrapper code.
      This will allow the decompressors to handle Squashfs
      cache buffers, and page cache pages.
      This patch adds the abstraction and an implementation for
      the caches.
      Signed-off-by: default avatarPhillip Lougher <phillip@squashfs.org.uk>
      Reviewed-by: default avatarMinchan Kim <minchan@kernel.org>
    • Phillip Lougher's avatar
      Squashfs: Refactor decompressor interface and code · 9508c6b9
      Phillip Lougher authored
      The decompressor interface and code was written from
      the point of view of single-threaded operation.  In doing
      so it mixed a lot of single-threaded implementation specific
      aspects into the decompressor code and elsewhere which makes it
      difficult to seamlessly support multiple different decompressor
      This patch does the following:
      1.  It removes compressor_options parsing from the decompressor
          init() function.  This allows the decompressor init() function
          to be dynamically called to instantiate multiple decompressors,
          without the compressor options needing to be read and parsed each
      2.  It moves threading and all sleeping operations out of the
          decompressors.  In doing so, it makes the decompressors
          non-blocking wrappers which only deal with interfacing with
          the decompressor implementation.
      3. It splits decompressor.[ch] into decompressor generic functions
         in decompressor.[ch], and moves the single threaded
         decompressor implementation into decompressor_single.c.
      The result of this patch is Squashfs should now be able to
      support multiple decompressors by adding new decompressor_xxx.c
      files with specialised implementations of the functions in
      Signed-off-by: default avatarPhillip Lougher <phillip@squashfs.org.uk>
      Reviewed-by: default avatarMinchan Kim <minchan@kernel.org>
  6. 04 Sep, 2013 1 commit
  7. 10 Mar, 2012 1 commit
  8. 26 May, 2011 1 commit
  9. 26 Jan, 2011 1 commit
    • Phillip Lougher's avatar
      squashfs: fix use of uninitialised variable in zlib & xz decompressors · 3689456b
      Phillip Lougher authored
      Fix potential use of uninitialised variable caused by recent
      decompressor code optimisations.
      In zlib_uncompress (zlib_wrapper.c) we have
      	int zlib_err, zlib_init = 0;
      	do {
      			if (avail == 0) {
      				offset = 0;
      		zlib_err = zlib_inflate(stream, Z_SYNC_FLUSH);
      	} while (zlib_err == Z_OK);
      If continue is executed (avail == 0) then the while condition will be
      evaluated testing zlib_err, which is uninitialised first time around the
      Fix this by getting rid of the 'if (avail == 0)' condition test, this
      edge condition should not be being handled in the decompressor code, and
      instead handle it generically in the caller code.
      Similarly for xz_wrapper.c.
      Incidentally, on most architectures (bar Mips and Parisc), no
      uninitialised variable warning is generated by gcc, this is because the
      while condition test on continue is optimised out and not performed
      (when executing continue zlib_err has not been changed since entering
      the loop, and logically if the while condition was true previously, then
      it's still true).
      Signed-off-by: default avatarPhillip Lougher <phillip@lougher.demon.co.uk>
      Reported-by: default avatarJesper Juhl <jj@chaosbits.net>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
  10. 13 Jan, 2011 1 commit
  11. 25 Apr, 2010 1 commit
  12. 20 Jan, 2010 3 commits
  13. 12 Mar, 2009 1 commit
    • Phillip Lougher's avatar
      Squashfs: Valid filesystems are flagged as bad by the corrupted fs patch · 363911d0
      Phillip Lougher authored
      The corrupted filesystem patch added a check against zlib trying to
      output too much data in the presence of data corruption.  This check
      triggered if zlib_inflate asked to be called again (Z_OK) with
      avail_out == 0 and no more output buffers available.  This check proves
      to be rather dumb, as it incorrectly catches the case where zlib has
      generated all the output, but there are still input bytes to be processed.
      This patch does a number of things.  It removes the original check and
      replaces it with code to not move to the next output buffer if there
      are no more output buffers available, relying on zlib to error if it
      wants an extra output buffer in the case of data corruption.  It
      also replaces the Z_NO_FLUSH flag with the more correct Z_SYNC_FLUSH
      flag, and makes the error messages more understandable to
      non-technical users.
      Signed-off-by: default avatarPhillip Lougher <phillip@lougher.demon.co.uk>
      Reported-by: default avatarStefan Lippers-Hollmann <s.L-H@gmx.de>
  14. 05 Mar, 2009 1 commit
  15. 05 Jan, 2009 1 commit