summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* btrfs: use btrfs_debug instead of pr_debug in transaction abortJeff Mahoney2017-02-171-1/+2
| | | | | | | | | | Commit e5d6b12fe14 (Btrfs: don't WARN() in btrfs_transaction_abort() for IO errors) added a pr_debug call to be printed when a transaction is aborted with -EIO instead of WARN. btrfs_debug prints which file system the message is associated with so let's use that instead. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: btrfs_truncate_free_space_cache always allocates pathJeff Mahoney2017-02-171-7/+7
| | | | | | | | | btrfs_truncate_free_space_cache always allocates a btrfs_path structure but only uses it when the caller passes a block group. Let's move the allocation and free into the conditional. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: free-space-cache, clean up unnecessary root argumentsJeff Mahoney2017-02-175-26/+22
| | | | | | | | | | The free space cache APIs accept a root but always use the tree root. Also, btrfs_truncate_free_space_cache accepts a root AND an inode but the inode always points to the root anyway, so let's just pass the inode. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: convert btrfs_inc_block_group_ro to accept fs_infoJeff Mahoney2017-02-174-6/+5
| | | | | | | | | btrfs_inc_block_group_ro is either passed the extent root or the dev root, but it doesn't do anything with the dev tree. Let's convert to passing an fs_info and using the extent root. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: flush_space always takes fs_info->fs_rootJeff Mahoney2017-02-171-10/+10
| | | | | | | | We don't need to pass a root to flush_space since it always uses the fs_root. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: pass fs_info to (more) routines that are only called with extent_rootJeff Mahoney2017-02-171-50/+53
| | | | | | | | | | | | Outside of interactions with qgroups, the roots passed in extent-tree.c are usually passed to ensure that we don't do refcounts on log trees or to get the allocation profile for an allocation request. Otherwise, it operates on the extent root. This patch converts some more routines in extent-tree.c that are always called with the extent root to accept an fs_info instead. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: qgroup: Move half of the qgroup accounting time out of commit transQu Wenruo2017-02-173-11/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Just as Filipe pointed out, the most time consuming parts of qgroup are btrfs_qgroup_account_extents() and btrfs_qgroup_prepare_account_extents(). Which both call btrfs_find_all_roots() to get old_roots and new_roots ulist. What makes things worse is, we're calling that expensive btrfs_find_all_roots() at transaction committing time with TRANS_STATE_COMMIT_DOING, which will blocks all incoming transaction. Such behavior is necessary for @new_roots search as current btrfs_find_all_roots() can't do it correctly so we do call it just before switch commit roots. However for @old_roots search, it's not necessary as such search is based on commit_root, so it will always be correct and we can move it out of transaction committing. This patch moves the @old_roots search part out of commit_transaction(), so in theory we can half the time qgroup time consumption at commit_transaction(). But please note that, this won't speedup qgroup overall, the total time consumption is still the same, just reduce the performance stall. Cc: Filipe Manana <fdmanana@suse.com> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Reviewed-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove unused parameter from adjust_slots_upwardsDavid Sterba2017-02-171-3/+2
| | | | | | | Never used. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove unused parameters from __btrfs_write_out_cacheDavid Sterba2017-02-171-8/+3
| | | | | | | | Both unused after the call to update_cache_item has been moved to __btrfs_wait_cache_io. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove unused parameter from cleanup_write_cache_enospcDavid Sterba2017-02-171-3/+2
| | | | | | | bitmap_list is unused since the io_ctl framework. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove unused parameter from __add_inode_refDavid Sterba2017-02-171-2/+1
| | | | | | | Unused since the helper has been split, eb used in the caller. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove unused parameter from clone_copy_inline_extentDavid Sterba2017-02-171-3/+2
| | | | | | | Never used. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove unused parameters from btrfs_cmp_dataDavid Sterba2017-02-171-3/+2
| | | | | | | | After the page locking has been reworked, we get all pages prepared via cmp_pages. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove unused parameter from __add_inline_refsDavid Sterba2017-02-171-3/+2
| | | | | | | Never used. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove unused parameters from scrub_setup_wr_ctxDavid Sterba2017-02-171-7/+3
| | | | | | | Never used. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove unused parameter from create_snapshotDavid Sterba2017-02-171-2/+2
| | | | | | | | The name parameters have never been used, as the name is passed via the dentry. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove unused parameter from init_first_rw_deviceDavid Sterba2017-02-171-5/+3
| | | | | | | | The 'device' used to be added in that function, but now it's done by the caller. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove unused parameter from __btrfs_alloc_chunkDavid Sterba2017-02-171-6/+4
| | | | | | | We grab fs_info from other parameters. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove unused parameter from btrfs_fill_superDavid Sterba2017-02-171-3/+2
| | | | | | | | Never used for anything meaningful since we have our own superblock filler. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove unused parameter from extent_write_cache_pagesDavid Sterba2017-02-171-4/+2
| | | | | | | The 'tree' was used to call locking hook that does not exist anymore. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove unused parameter from add_pending_csumsDavid Sterba2017-02-171-4/+2
| | | | | | | Never used. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove unused parameter from update_nr_writtenDavid Sterba2017-02-171-4/+4
| | | | | | | | | The logic has been updated in "Btrfs: make mapping->writeback_index point to the last written page" (a91326679f2a0a4c2) and page is not needed anymore. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove unused parameter from submit_extent_pageDavid Sterba2017-02-171-9/+3
| | | | | | | | This used to hold number of maximum pages to allocate, but this is now limited by BIO_MAX_PAGES. The local are now unused and removed as well. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove unused parameter from tree_move_next_or_upnextDavid Sterba2017-02-171-4/+2
| | | | | | | Not needed. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove unused parameter from tree_move_downDavid Sterba2017-02-171-2/+2
| | | | | | | Never needed. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove unused parameter from btrfs_check_super_validDavid Sterba2017-02-171-5/+3
| | | | | | | | | None of the checks need to know the ro/rw status as they're all not changing the superblock. Moreover, we can access the sb flags directly if we'd need to decide by the ro/rw status. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove unused parameter from btrfs_prepare_extent_commitDavid Sterba2017-02-173-5/+3
| | | | | | | Added but never used. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove unused parameter from btrfs_subvolume_release_metadataDavid Sterba2017-02-173-11/+6
| | | | | | | | Unused since qgroup refactoring that split data and metadata accounting, the btrfs_qgroup_free helper. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove unused parameter from __push_leaf_leftDavid Sterba2017-02-171-3/+2
| | | | | | | Unused since long ago. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove unused parameter from __push_leaf_rightDavid Sterba2017-02-171-3/+2
| | | | | | | Unused since long ago. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: merge two superblock writing helpersDavid Sterba2017-02-174-11/+4
| | | | | | | | write_all_supers and write_ctree_super are almost equal, the parameter 'trans' is unused so we can drop it and have just one helper. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove unused parameter from write_dev_supersDavid Sterba2017-02-171-3/+3
| | | | | | | The barriers are handled by the caller. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove unused parameter from split_itemDavid Sterba2017-02-171-3/+2
| | | | | | | Never used. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove unused parameter from clean_tree_blockDavid Sterba2017-02-177-19/+17
| | | | | | | Added but never needed. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove unused parameter from check_async_writeDavid Sterba2017-02-171-2/+2
| | | | | | | Added but never used. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove unused parameter from read_block_for_searchDavid Sterba2017-02-171-5/+5
| | | | | | | Never used in that function. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: ulist: rename ulist_fini to ulist_releaseDavid Sterba2017-02-173-10/+10
| | | | | | | | Change the name so it matches the naming we already use eg. for btrfs_path. Suggested-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove pointless rcu protection from btrfs_qgroup_inheritDavid Sterba2017-02-171-2/+0
| | | | | | | There was never need for RCU protection around reading nodesize or other fairly constant filesystem data. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: qgroups: opencode qgroup_free helperDavid Sterba2017-02-171-9/+9
| | | | | | The helper name is not too helpful and is just wrapping a simple call. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: remove unnecessary mutex lock in qgroup_account_snapshotDavid Sterba2017-02-171-5/+1
| | | | | | | | | The quota status used to be tracked as a variable, so the mutex was needed (until "Btrfs: add a flags field to btrfs_fs_info" afcdd129e05a9). Since the status is a bit modified atomically and we don't hold the mutex beyond the check, we can drop it. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: check quota status earlier and don't do unnecessary freesDavid Sterba2017-02-171-2/+3
| | | | | | | | Status of quotas should be the first check in btrfs_qgroup_account_extent and we can return immediatelly, no need to do no-op ulist frees. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: embed extent_changeset::range_changed to the structureDavid Sterba2017-02-173-17/+11
| | | | | | | | | | | | | | | | | | | We can embed range_changed to the extent changeset to address following problems: - no need to allocate ulist dynamically, we also get rid of the GFP_NOFS for free - fix lack of allocation failure checking in btrfs_qgroup_reserve_data The stack consuption where extent_changeset is used slightly increases: before: 16 after: 16 - 8 (for pointer) + 32 (sizeof ulist) = 40 Which is bearable. Reviewed-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: ulist: make the finalization function publicDavid Sterba2017-02-172-1/+2
| | | | | | Make ulist_fini externally visible so the ulist API is complete. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: qgroups: make __del_qgroup_relation staticDavid Sterba2017-02-171-1/+1
| | | | | | Internal helper. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: make space cache inode readahead failure nonfatalDavid Sterba2017-02-171-7/+3
| | | | | | | | | We do a readahead of the free space cache inode to speed things up but the failure is not fatal, like in other readahead cases. Proper reads would need to happen anyway and any errors would be caught there. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: use GFP_KERNEL in btrfs_add/del_qgroup_relationDavid Sterba2017-02-171-2/+2
| | | | | | | | Qgroup relations are added/deleted from ioctl, we hold the high level qgroup lock, no deadlocks or recursion from the allocation possible here. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: use GFP_KERNEL in btrfs_quota_enableDavid Sterba2017-02-171-1/+1
| | | | | | | | We don't need to use GFP_NOFS here as this is called from ioctls an the only lock held is the subvol_sem, which is of a high level and protects creation/renames/deletion and is never held in the writeout paths. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: use GFP_KERNEL in btrfs_read_qgroup_configDavid Sterba2017-02-171-1/+1
| | | | | | The qgroup config is read during mount, we do not have to use NOFS. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: use GFP_KERNEL in create_snapshotDavid Sterba2017-02-171-2/+2
| | | | | | | | We don't need to use GFP_NOFS here as this is called from ioctls an the only lock held is the subvol_sem, which is of a high level and protects creation/renames/deletion and is never held in the writeout paths. Signed-off-by: David Sterba <dsterba@suse.com>
* Btrfs: specify a new ordered extent type for create_io_emLiu Bo2017-02-172-4/+6
| | | | | | | | | As 0 refers to an existing type BTRFS_ORDERED_IO_DONE, this specifies a new type 'REGULAR' for regular IO. Signed-off-by: Liu Bo <bo.li.liu@oracle.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
OpenPOWER on IntegriCloud