1. 08 6月, 2016 1 次提交
  2. 05 4月, 2016 1 次提交
    • K
      mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros · 09cbfeaf
      Kirill A. Shutemov 提交于
      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
      not.
      
      The changes are pretty straight-forward:
      
       - <foo> << (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
      
       - <foo> >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
      
       - PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} -> PAGE_{SIZE,SHIFT,MASK,ALIGN};
      
       - 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 << (PAGE_CACHE_SHIFT - PAGE_SHIFT)
      + E
      
      @@
      expression E;
      @@
      - E >> (PAGE_CACHE_SHIFT - PAGE_SHIFT)
      + E
      
      @@
      @@
      - PAGE_CACHE_SHIFT
      + PAGE_SHIFT
      
      @@
      @@
      - PAGE_CACHE_SIZE
      + PAGE_SIZE
      
      @@
      @@
      - PAGE_CACHE_MASK
      + PAGE_MASK
      
      @@
      expression E;
      @@
      - PAGE_CACHE_ALIGN(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: NKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Acked-by: NMichal Hocko <mhocko@suse.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      09cbfeaf
  3. 10 9月, 2015 1 次提交
  4. 07 7月, 2015 1 次提交
    • A
      ufs: don't use lock_ufs() for block pointers tree protection · 724bb09f
      Al Viro 提交于
      * stores to block pointers are under per-inode seqlock (meta_lock) and
      mutex (truncate_mutex)
      * fetches of block pointers are either under truncate_mutex, or wrapped
      into seqretry loop on meta_lock
      * all changes of ->i_size are under truncate_mutex and i_mutex
      * all changes of ->i_lastfrag are under truncate_mutex
      
      It's similar to what ext2 is doing; the main difference is that unlike
      ext2 we can't rely upon the atomicity of stores into block pointers -
      on UFS2 they are 64bit.  So we can't cut the corner when switching
      a pointer from NULL to non-NULL as we could in ext2_splice_branch()
      and need to use meta_lock on all modifications.
      
      We use seqlock where ext2 uses rwlock; ext2 could probably also benefit
      from such change...
      
      Another non-trivial difference is that with UFS we *cannot* have reader
      grab truncate_mutex in case of race - it has to keep retrying.  That
      might be possible to change, but not until we lift tail unpacking
      several levels up in call chain.
      
      After that commit we do *NOT* hold fs-wide serialization on accesses
      to block pointers anymore.  Moreover, lock_ufs() can become a normal
      mutex now - it's only used on statfs, remount and sync_fs and none
      of those uses are recursive.  As the matter of fact, *now* it can be
      collapsed with ->s_lock, and be eventually replaced with saner
      per-cylinder-group spinlocks, but that's a separate story.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      724bb09f
  5. 16 6月, 2015 1 次提交
  6. 14 10月, 2014 1 次提交
  7. 07 6月, 2014 2 次提交
  8. 08 4月, 2014 1 次提交
  9. 10 10月, 2012 1 次提交
  10. 23 7月, 2012 1 次提交
    • A
      fs/ufs: get rid of write_super · 9e9ad5f4
      Artem Bityutskiy 提交于
      This patch makes UFS stop using the VFS '->write_super()' method along with
      the 's_dirt' superblock flag, because they are on their way out.
      
      The way we implement this is that we schedule a delay job instead relying on
      's_dirt' and '->write_super()'.
      
      The whole "superblock write-out" VFS infrastructure is served by the
      'sync_supers()' kernel thread, which wakes up every 5 (by default) seconds and
      writes out all dirty superblocks using the '->write_super()' call-back.  But the
      problem with this thread is that it wastes power by waking up the system every
      5 seconds, even if there are no diry superblocks, or there are no client
      file-systems which would need this (e.g., btrfs does not use
      '->write_super()'). So we want to kill it completely and thus, we need to make
      file-systems to stop using the '->write_super()' VFS service, and then remove
      it together with the kernel thread.
      
      Tested using fsstress from the LTP project.
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      9e9ad5f4
  11. 27 5月, 2011 1 次提交
  12. 18 8月, 2010 1 次提交
    • C
      remove SWRITE* I/O types · 9cb569d6
      Christoph Hellwig 提交于
      These flags aren't real I/O types, but tell ll_rw_block to always
      lock the buffer instead of giving up on a failed trylock.
      
      Instead add a new write_dirty_buffer helper that implements this semantic
      and use it from the existing SWRITE* callers.  Note that the ll_rw_block
      code had a bug where it didn't promote WRITE_SYNC_PLUG properly, which
      this patch fixes.
      
      In the ufs code clean up the helper that used to call ll_rw_block
      to mirror sync_dirty_buffer, which is the function it implements for
      compound buffers.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      9cb569d6
  13. 24 5月, 2010 1 次提交
    • J
      ufs: Remove dead quota code · 8f45c33d
      Jan Kara 提交于
      UFS quota is non-functional at least since 2.6.12 because dq_op was set
      to NULL. Since the filesystem exists mainly to allow cooperation with Solaris
      and quota format isn't standard, just remove the dead code.
      
      CC: Evgeniy Dushistov <dushistov@mail.ru>
      Signed-off-by: NJan Kara <jack@suse.cz>
      8f45c33d
  14. 05 3月, 2010 1 次提交
    • C
      dquot: cleanup space allocation / freeing routines · 5dd4056d
      Christoph Hellwig 提交于
      Get rid of the alloc_space, free_space, reserve_space, claim_space and
      release_rsv dquot operations - they are always called from the filesystem
      and if a filesystem really needs their own (which none currently does)
      it can just call into it's own routine directly.
      
      Move shared logic into the common __dquot_alloc_space,
      dquot_claim_space_nodirty and __dquot_free_space low-level methods,
      and rationalize the wrappers around it to move as much as possible
      code into the common block for CONFIG_QUOTA vs not.  Also rename
      all these helpers to be named dquot_* instead of vfs_dq_*.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      5dd4056d
  15. 26 3月, 2009 1 次提交
  16. 28 4月, 2008 1 次提交
  17. 20 3月, 2008 1 次提交
  18. 09 2月, 2008 1 次提交
  19. 17 10月, 2007 1 次提交
  20. 17 3月, 2007 2 次提交
  21. 15 2月, 2007 1 次提交
    • T
      [PATCH] remove many unneeded #includes of sched.h · cd354f1a
      Tim Schmielau 提交于
      After Al Viro (finally) succeeded in removing the sched.h #include in module.h
      recently, it makes sense again to remove other superfluous sched.h includes.
      There are quite a lot of files which include it but don't actually need
      anything defined in there.  Presumably these includes were once needed for
      macros that used to live in sched.h, but moved to other header files in the
      course of cleaning it up.
      
      To ease the pain, this time I did not fiddle with any header files and only
      removed #includes from .c-files, which tend to cause less trouble.
      
      Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
      arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
      allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
      configs in arch/arm/configs on arm.  I also checked that no new warnings were
      introduced by the patch (actually, some warnings are removed that were emitted
      by unnecessarily included header files).
      Signed-off-by: NTim Schmielau <tim@physik3.uni-rostock.de>
      Acked-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cd354f1a
  22. 13 2月, 2007 1 次提交
  23. 31 1月, 2007 2 次提交
  24. 06 1月, 2007 1 次提交
    • E
      [PATCH] fix garbage instead of zeroes in UFS · d63b7090
      Evgeniy Dushistov 提交于
      Looks like this is the problem, which point Al Viro some time ago:
      
      ufs's get_block callback allocates 16k of disk at a time, and links that
      entire 16k into the file's metadata.  But because get_block is called for only
      a single buffer_head (a 2k buffer_head in this case?) we are only able to tell
      the VFS that this 2k is buffer_new().
      
      So when ufs_getfrag_block() is later called to map some more data in the file,
      and when that data resides within the remaining 14k of this fragment,
      ufs_getfrag_block() will incorrectly return a !buffer_new() buffer_head.
      
      I don't see _right_ way to do nullification of whole block, if use inode
      page cache, some pages may be outside of inode limits (inode size), and
      will be lost; if use blockdev page cache it is possible to zero real data,
      if later inode page cache will be used.
      
      The simpliest way, as can I see usage of block device page cache, but not only
      mark dirty, but also sync it during "nullification".  I use my simple tests
      collection, which I used for check that create,open,write,read,close works on
      ufs, and I see that this patch makes ufs code 18% slower then before.
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      d63b7090
  25. 06 8月, 2006 1 次提交
  26. 02 7月, 2006 1 次提交
  27. 26 6月, 2006 10 次提交
  28. 15 1月, 2006 1 次提交
    • E
      [PATCH] ufs cleanup · 7b4ee73e
      Evgeniy 提交于
      Here is update of ufs cleanup patch, brought on by the recently fixed
      ubh_get_usb_second() bug that made some ugly code rather painfully
      obvious.  It also includes
      
       - fix compilation warnings which appears if debug mode turn on
       - remove unnecessary duplication of code to support UFS2
      
      I tested it on ufs1 and ufs2 file-systems.
      Signed-off-by: NEvgeniy Dushistov <dushistov@mail.ru>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      7b4ee73e