1. 04 6月, 2018 1 次提交
    • A
      gfs2: Iomap cleanups and improvements · 628e366d
      Andreas Gruenbacher 提交于
      Clean up gfs2_iomap_alloc and gfs2_iomap_get.  Document how
      gfs2_iomap_alloc works: it now needs to be called separately after
      gfs2_iomap_get where necessary; this will be used later by iomap write.
      Move gfs2_iomap_ops into bmap.c.
      
      Introduce a new gfs2_iomap_get_alloc helper and use it in
      fallocate_chunk: gfs2_iomap_begin will become unsuitable for fallocate
      with proper iomap write support.
      
      In gfs2_block_map and fallocate_chunk, zero-initialize struct iomap.
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      628e366d
  2. 29 3月, 2018 1 次提交
  3. 09 3月, 2018 1 次提交
    • A
      gfs2: Fix fallocate chunk size · 174d1232
      Andreas Gruenbacher 提交于
      The chunk size of allocations in __gfs2_fallocate is calculated
      incorrectly.  The size can collapse, causing __gfs2_fallocate to
      allocate one block at a time, which is very inefficient.  This needs
      fixing in two places:
      
      In gfs2_quota_lock_check, always set ap->allowed to UINT_MAX to indicate
      that there is no quota limit.  This fixes callers that rely on
      ap->allowed to be set even when quotas are off.
      
      In __gfs2_fallocate, reset max_blks to UINT_MAX in each iteration of the
      loop to make sure that allocation limits from one resource group won't
      spill over into another resource group.
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      174d1232
  4. 23 1月, 2018 2 次提交
  5. 19 1月, 2018 1 次提交
  6. 31 10月, 2017 3 次提交
    • A
      gfs2: Fix and clean up {GET,SET}FLAGS ioctl · b16f7e57
      Andreas Gruenbacher 提交于
      Switch to a simple array for mapping between the FS_*_FL and GFS_DIF_*
      flags.  Clarify how the mapping between FS_JOURNAL_DATA_FL and the
      filesystem flags works.  The GFS2_DIF_SYSTEM flag cannot be set from
      user space, so remove it from GFS2_FLAGS_USER_SET.  Fail with -EINVAL
      when trying to set flags that are not supported instead of silently
      ignoring those flags.
      
      Partially fixes xfstest generic/424.
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      Reviewed-by: NAndrew Price <anprice@redhat.com>
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      b16f7e57
    • B
      GFS2: Take inode off order_write list when setting jdata flag · cc555b09
      Bob Peterson 提交于
      This patch fixes a deadlock caused when the jdata flag is set for
      inodes that are already on the ordered write list. Since it is
      on the ordered write list, log_flush calls gfs2_ordered_write which
      calls filemap_fdatawrite. But since the inode had the jdata flag
      set, that calls gfs2_jdata_writepages, which tries to start a new
      transaction. A new transaction cannot be started because it tries
      to acquire the log_flush rwsem which is already locked by the log
      flush operation.
      
      The bottom line is: We cannot switch an inode from ordered to jdata
      until we eliminate any ordered data pages (via log flush) or any
      log_flush operation afterward will create the circular dependency
      above. So we need to flush the log before setting the diskflags to
      switch the file mode, then we need to remove the inode from the
      ordered writes list.
      
      Before this patch, the log flush was done for jdata->ordered, but
      that's wrong. If we're going from jdata to ordered, we don't need
      to call gfs2_log_flush because the call to filemap_fdatawrite will
      do it for us:
      
         filemap_fdatawrite() -> __filemap_fdatawrite_range()
            __filemap_fdatawrite_range() -> do_writepages()
               do_writepages() -> gfs2_jdata_writepages()
                  gfs2_jdata_writepages() -> gfs2_log_flush()
      
      This patch modifies function do_gfs2_set_flags so that if a file
      has its jdata flag set, and it's already on the ordered write list,
      the log will be flushed and it will be removed from the list
      before setting the flag.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      Acked-by: NAbhijith Das <adas@redhat.com>
      cc555b09
    • A
      gfs2: Implement SEEK_HOLE / SEEK_DATA via iomap · 3a27411c
      Andreas Gruenbacher 提交于
      So far, lseek on gfs2 did not report holes.
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      3a27411c
  7. 26 9月, 2017 1 次提交
  8. 01 8月, 2017 1 次提交
  9. 18 7月, 2017 1 次提交
  10. 05 4月, 2017 1 次提交
  11. 25 2月, 2017 1 次提交
  12. 25 12月, 2016 1 次提交
  13. 06 10月, 2016 1 次提交
  14. 27 9月, 2016 1 次提交
  15. 27 6月, 2016 1 次提交
    • A
      gfs2: Lock holder cleanup · 6df9f9a2
      Andreas Gruenbacher 提交于
      Make the code more readable by cleaning up the different ways of
      initializing lock holders and checking for initialized lock holders:
      mark lock holders as uninitialized by setting the holder's glock to NULL
      (gfs2_holder_mark_uninitialized) instead of zeroing out the entire
      object or using a separate flag.  Recognize initialized holders by their
      non-NULL glock (gfs2_holder_initialized).  Don't zero out holder objects
      which are immeditiately initialized via gfs2_holder_init or
      gfs2_glock_nq_init.
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      6df9f9a2
  16. 13 5月, 2016 1 次提交
  17. 02 5月, 2016 2 次提交
  18. 20 4月, 2016 1 次提交
  19. 06 4月, 2016 1 次提交
  20. 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
  21. 23 1月, 2016 1 次提交
    • A
      wrappers for ->i_mutex access · 5955102c
      Al Viro 提交于
      parallel to mutex_{lock,unlock,trylock,is_locked,lock_nested},
      inode_foo(inode) being mutex_foo(&inode->i_mutex).
      
      Please, use those for access to ->i_mutex; over the coming cycle
      ->i_mutex will become rwsem, with ->lookup() done with it held
      only shared.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      5955102c
  22. 22 12月, 2015 1 次提交
  23. 15 12月, 2015 2 次提交
    • B
      GFS2: Reduce size of incore inode · b58bf407
      Bob Peterson 提交于
      This patch makes no functional changes. Its goal is to reduce the
      size of the gfs2 inode in memory by rearranging structures and
      changing the size of some variables within the structure.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      b58bf407
    • B
      GFS2: Make rgrp reservations part of the gfs2_inode structure · a097dc7e
      Bob Peterson 提交于
      Before this patch, multi-block reservation structures were allocated
      from a special slab. This patch folds the structure into the gfs2_inode
      structure. The disadvantage is that the gfs2_inode needs more memory,
      even when a file is opened read-only. The advantages are: (a) we don't
      need the special slab and the extra time it takes to allocate and
      deallocate from it. (b) we no longer need to worry that the structure
      exists for things like quota management. (c) This also allows us to
      remove the calls to get_write_access and put_write_access since we
      know the structure will exist.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      a097dc7e
  24. 24 11月, 2015 1 次提交
    • B
      GFS2: Extract quota data from reservations structure (revert 5407e242) · b54e9a0b
      Bob Peterson 提交于
      This patch basically reverts the majority of patch 5407e242.
      That patch eliminated the gfs2_qadata structure in favor of just
      using the reservations structure. The problem with doing that is that
      it increases the size of the reservations structure. That is not an
      issue until it comes time to fold the reservations structure into the
      inode in memory so we know it's always there. By separating out the
      quota structure again, we aren't punishing the non-quota users by
      making all the inodes bigger, requiring more slab space. This patch
      creates a new slab area to allocate the quota stuff so it's managed
      a little more sanely.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      b54e9a0b
  25. 11 11月, 2015 1 次提交
  26. 23 10月, 2015 1 次提交
  27. 22 9月, 2015 1 次提交
  28. 09 6月, 2015 1 次提交
  29. 06 5月, 2015 1 次提交
  30. 12 4月, 2015 2 次提交
  31. 26 3月, 2015 1 次提交
  32. 19 3月, 2015 3 次提交