1. 27 7月, 2018 2 次提交
    • B
      xfs: remove all boilerplate defer init/finish code · c8eac49e
      Brian Foster 提交于
      At this point, the transaction subsystem completely manages deferred
      items internally such that the common and boilerplate
      xfs_trans_alloc() -> xfs_defer_init() -> xfs_defer_finish() ->
      xfs_trans_commit() sequence can be replaced with a simple
      transaction allocation and commit.
      
      Remove all such boilerplate deferred ops code. In doing so, we
      change each case over to use the dfops in the transaction and
      specifically eliminate:
      
      - The on-stack dfops and associated xfs_defer_init() call, as the
        internal dfops is initialized on transaction allocation.
      - xfs_bmap_finish() calls that precede a final xfs_trans_commit() of
        a transaction.
      - xfs_defer_cancel() calls in error handlers that precede a
        transaction cancel.
      
      The only deferred ops calls that remain are those that are
      non-deterministic with respect to the final commit of the associated
      transaction or are open-coded due to special handling.
      Signed-off-by: NBrian Foster <bfoster@redhat.com>
      Reviewed-by: NBill O'Donnell <billodo@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      c8eac49e
    • B
      xfs: pull up dfops from xfs_itruncate_extents() · 02dff7bf
      Brian Foster 提交于
      xfs_itruncate_extents[_flags]() uses a local dfops with a
      transaction provided by the caller. It uses hacky ->t_dfops
      replacement logic to avoid stomping over an already populated
      ->t_dfops.
      
      The latter never occurs for current callers and the logic itself is
      not really appropriate. Clean this up by updating all callers to
      initialize a dfops and to use that down in xfs_itruncate_extents().
      This more closely resembles the upcoming logic where dfops will be
      embedded within the transaction. We can also replace the
      xfs_defer_init() in the xfs_itruncate_extents_flags() loop with an
      assert. Both dfops and firstblock should be in a valid state
      after xfs_defer_finish() and the inode joined to the dfops is fixed
      throughout the loop.
      Signed-off-by: NBrian Foster <bfoster@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NBill O'Donnell <billodo@redhat.com>
      Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      02dff7bf
  2. 18 7月, 2018 1 次提交
  3. 12 7月, 2018 16 次提交
  4. 25 6月, 2018 2 次提交
  5. 22 6月, 2018 1 次提交
  6. 09 6月, 2018 1 次提交
  7. 07 6月, 2018 1 次提交
    • D
      xfs: convert to SPDX license tags · 0b61f8a4
      Dave Chinner 提交于
      Remove the verbose license text from XFS files and replace them
      with SPDX tags. This does not change the license of any of the code,
      merely refers to the common, up-to-date license files in LICENSES/
      
      This change was mostly scripted. fs/xfs/Makefile and
      fs/xfs/libxfs/xfs_fs.h were modified by hand, the rest were detected
      and modified by the following command:
      
      for f in `git grep -l "GNU General" fs/xfs/` ; do
      	echo $f
      	cat $f | awk -f hdr.awk > $f.new
      	mv -f $f.new $f
      done
      
      And the hdr.awk script that did the modification (including
      detecting the difference between GPL-2.0 and GPL-2.0+ licenses)
      is as follows:
      
      $ cat hdr.awk
      BEGIN {
      	hdr = 1.0
      	tag = "GPL-2.0"
      	str = ""
      }
      
      /^ \* This program is free software/ {
      	hdr = 2.0;
      	next
      }
      
      /any later version./ {
      	tag = "GPL-2.0+"
      	next
      }
      
      /^ \*\// {
      	if (hdr > 0.0) {
      		print "// SPDX-License-Identifier: " tag
      		print str
      		print $0
      		str=""
      		hdr = 0.0
      		next
      	}
      	print $0
      	next
      }
      
      /^ \* / {
      	if (hdr > 1.0)
      		next
      	if (hdr > 0.0) {
      		if (str != "")
      			str = str "\n"
      		str = str $0
      		next
      	}
      	print $0
      	next
      }
      
      /^ \*/ {
      	if (hdr > 0.0)
      		next
      	print $0
      	next
      }
      
      // {
      	if (hdr > 0.0) {
      		if (str != "")
      			str = str "\n"
      		str = str $0
      		next
      	}
      	print $0
      }
      
      END { }
      $
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      0b61f8a4
  8. 16 5月, 2018 1 次提交
    • B
      xfs: factor out nodiscard helpers · 4e529339
      Brian Foster 提交于
      The changes to skip discards of speculative preallocation and
      unwritten extents introduced several new wrapper functions through
      the bunmapi -> extent free codepath to reduce churn in all of the
      associated callers. In several cases, these wrappers simply toggle a
      single flag to skip or not skip discards for the resulting blocks.
      
      The explicit _nodiscard() wrappers for such an isolated set of
      callers is a bit overkill. Kill off these wrappers and replace with
      the calls to the underlying functions in the contexts that need to
      control discard behavior. Retain the wrappers that preserve the
      original calling conventions to serve the original purpose of
      reducing code churn.
      
      This is a refactoring patch and does not change behavior.
      Signed-off-by: NBrian Foster <bfoster@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      4e529339
  9. 10 5月, 2018 2 次提交
  10. 10 4月, 2018 1 次提交
  11. 16 3月, 2018 2 次提交
  12. 12 3月, 2018 1 次提交
    • B
      xfs: account format bouncing into rmapbt swapext tx reservation · b3fed434
      Brian Foster 提交于
      The extent swap mechanism requires a unique implementation for
      rmapbt enabled filesystems. Because the rmapbt tracks extent owner
      information, extent swap must individually unmap and remap each
      extent between the two inodes.
      
      The rmapbt extent swap transaction block reservation currently
      accounts for the worst case bmapbt block and rmapbt block
      consumption based on the extent count of each inode. There is a
      corner case that exists due to the extent swap implementation that
      is not covered by this reservation, however.
      
      If one of the associated inodes is just over the max extent count
      used for extent format inodes (i.e., the inode is in btree format by
      a single extent), the unmap/remap cycle of the extent swap can
      bounce the inode between extent and btree format multiple times,
      almost as many times as there are extents in the inode (if the
      opposing inode happens to have one less, for example). Each back and
      forth cycle involves a block free and allocation, which isn't a
      problem except for that the initial transaction reservation must
      account for the total number of block allocations performed by the
      chain of deferred operations. If not, a block reservation overrun
      occurs and the filesystem shuts down.
      
      Update the rmapbt extent swap block reservation to check for this
      situation and add some block reservation slop to ensure the entire
      operation succeeds. We'd never likely require reservation for both
      inodes as fsr wouldn't defrag the file in that case, but the
      additional reservation is constrained by the data fork size so be
      cautious and check for both.
      Signed-off-by: NBrian Foster <bfoster@redhat.com>
      Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      b3fed434
  13. 29 1月, 2018 1 次提交
  14. 07 11月, 2017 2 次提交
  15. 27 10月, 2017 6 次提交