1. 18 4月, 2018 1 次提交
    • Q
      btrfs: qgroup: Commit transaction in advance to reduce early EDQUOT · a514d638
      Qu Wenruo 提交于
      Unlike previous method that tries to commit transaction inside
      qgroup_reserve(), this time we will try to commit transaction using
      fs_info->transaction_kthread to avoid nested transaction and no need to
      worry about locking context.
      
      Since it's an asynchronous function call and we won't wait for
      transaction commit, unlike previous method, we must call it before we
      hit the qgroup limit.
      
      So this patch will use the ratio and size of qgroup meta_pertrans
      reservation as indicator to check if we should trigger a transaction
      commit.  (meta_prealloc won't be cleaned in transaction committ, it's
      useless anyway)
      Signed-off-by: NQu Wenruo <wqu@suse.com>
      Signed-off-by: NDavid Sterba <dsterba@suse.com>
      a514d638
  2. 12 4月, 2018 1 次提交
  3. 31 3月, 2018 7 次提交
  4. 26 3月, 2018 15 次提交
  5. 16 3月, 2018 1 次提交
  6. 01 3月, 2018 1 次提交
    • A
      btrfs: use proper endianness accessors for super_copy · 3c181c12
      Anand Jain 提交于
      The fs_info::super_copy is a byte copy of the on-disk structure and all
      members must use the accessor macros/functions to obtain the right
      value.  This was missing in update_super_roots and in sysfs readers.
      
      Moving between opposite endianness hosts will report bogus numbers in
      sysfs, and mount may fail as the root will not be restored correctly. If
      the filesystem is always used on a same endian host, this will not be a
      problem.
      
      Fix this by using the btrfs_set_super...() functions to set
      fs_info::super_copy values, and for the sysfs, use the cached
      fs_info::nodesize/sectorsize values.
      
      CC: stable@vger.kernel.org
      Fixes: df93589a ("btrfs: export more from FS_INFO to sysfs")
      Signed-off-by: NAnand Jain <anand.jain@oracle.com>
      Reviewed-by: NLiu Bo <bo.li.liu@oracle.com>
      Reviewed-by: NDavid Sterba <dsterba@suse.com>
      [ update changelog ]
      Signed-off-by: NDavid Sterba <dsterba@suse.com>
      3c181c12
  7. 22 1月, 2018 3 次提交
  8. 02 11月, 2017 1 次提交
    • J
      btrfs: don't call btrfs_start_delalloc_roots in flushoncommit · ce8ea7cc
      Josef Bacik 提交于
      We're holding the sb_start_intwrite lock at this point, and doing async
      filemap_flush of the inodes will result in a deadlock if we freeze the
      fs during this operation.  This is because we could do a
      btrfs_join_transaction() in the thread we are waiting on which would
      block at sb_start_intwrite, and thus deadlock.  Using
      writeback_inodes_sb() side steps the problem by not introducing all of
      these extra locking dependencies.
      Signed-off-by: NJosef Bacik <jbacik@fb.com>
      Signed-off-by: NDavid Sterba <dsterba@suse.com>
      ce8ea7cc
  9. 30 10月, 2017 2 次提交
  10. 30 6月, 2017 2 次提交
  11. 20 6月, 2017 3 次提交
    • D
      btrfs: move fs_info::fs_frozen to the flags · fac03c8d
      David Sterba 提交于
      We can keep the state among the other fs_info flags, there's no reason
      why fs_frozen would need to be separate.
      Reviewed-by: NNikolay Borisov <nborisov@suse.com>
      Signed-off-by: NDavid Sterba <dsterba@suse.com>
      fac03c8d
    • D
      btrfs: use generic slab for for btrfs_transaction · 4b5faeac
      David Sterba 提交于
      Observing the number of slab objects of btrfs_transaction, there's just
      one active on an almost quiescent filesystem, and the number of objects
      goes to about ten when sync is in progress. Then the nubmer goes down to
      1.  This matches the expectations of the transaction lifetime.
      
      For such use the separate slab cache is not justified, as we do not
      reuse objects frequently. For the shortlived transaction, the generic
      slab (size 512) should be ok. We can optimistically expect that the 512
      slabs are not all used (fragmentation) and there are free slots to take
      when we do the allocation, compared to potentially allocating a whole new
      page for the separate slab.
      
      We'll lose the stats about the object use, which could be added later if
      we really need them.
      Signed-off-by: NDavid Sterba <dsterba@suse.com>
      4b5faeac
    • J
      Btrfs: replace tree->mapping with tree->private_data · c6100a4b
      Josef Bacik 提交于
      For extent_io tree's we have carried the address_mapping of the inode
      around in the io tree in order to pull the inode back out for calling
      into various tree ops hooks.  This works fine when everything that has
      an extent_io_tree has an inode.  But we are going to remove the
      btree_inode, so we need to change this.  Instead just have a generic
      void * for private data that we can initialize with, and have all the
      tree ops use that instead.  This had a lot of cascading changes but
      should be relatively straightforward.
      Signed-off-by: NJosef Bacik <jbacik@fb.com>
      Reviewed-by: NChandan Rajendra <chandan@linux.vnet.ibm.com>
      Reviewed-by: NDavid Sterba <dsterba@suse.com>
      [ minor reordering of the callback prototypes ]
      Signed-off-by: NDavid Sterba <dsterba@suse.com>
      c6100a4b
  12. 18 4月, 2017 3 次提交