btrfs: qgroup: Rename functions to make it follow reserve,trace,account steps
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Tue, 18 Oct 2016 01:31:27 +0000 (09:31 +0800)
committerDavid Sterba <dsterba@suse.com>
Wed, 30 Nov 2016 12:45:21 +0000 (13:45 +0100)
Rename btrfs_qgroup_insert_dirty_extent(_nolock) to
btrfs_qgroup_trace_extent(_nolock), according to the new
reserve/trace/account naming schema.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Reviewed-and-Tested-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/delayed-ref.c
fs/btrfs/extent-tree.c
fs/btrfs/qgroup.c
fs/btrfs/qgroup.h
fs/btrfs/relocation.c
fs/btrfs/tree-log.c
include/trace/events/btrfs.h

index 8d93854a4b4f3524cd2e4b2554c6198ca03fa9f7..a1cd0da72c944f76cbd7872cac07f57e939d354b 100644 (file)
@@ -606,7 +606,7 @@ add_delayed_ref_head(struct btrfs_fs_info *fs_info,
                qrecord->num_bytes = num_bytes;
                qrecord->old_roots = NULL;
 
-               if(btrfs_qgroup_insert_dirty_extent_nolock(fs_info,
+               if(btrfs_qgroup_trace_extent_nolock(fs_info,
                                        delayed_refs, qrecord))
                        kfree(qrecord);
        }
index c17b0d1b081fef0d2ed204c4a872dab0db076e94..1ad5643a507ba8467b008337dd8d5a48958d8988 100644 (file)
@@ -8571,8 +8571,8 @@ static int account_leaf_items(struct btrfs_trans_handle *trans,
 
                num_bytes = btrfs_file_extent_disk_num_bytes(eb, fi);
 
-               ret = btrfs_qgroup_insert_dirty_extent(trans, root->fs_info,
-                               bytenr, num_bytes, GFP_NOFS);
+               ret = btrfs_qgroup_trace_extent(trans, root->fs_info,
+                                               bytenr, num_bytes, GFP_NOFS);
                if (ret)
                        return ret;
        }
@@ -8721,7 +8721,7 @@ walk_down:
                        btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK);
                        path->locks[level] = BTRFS_READ_LOCK_BLOCKING;
 
-                       ret = btrfs_qgroup_insert_dirty_extent(trans,
+                       ret = btrfs_qgroup_trace_extent(trans,
                                        root->fs_info, child_bytenr,
                                        root->nodesize, GFP_NOFS);
                        if (ret)
index 50b32cb25bdbc21197422276b32654c401bd53f3..87ab7387680f400f83772b220a52f2a490922819 100644 (file)
@@ -1457,7 +1457,7 @@ int btrfs_qgroup_prepare_account_extents(struct btrfs_trans_handle *trans,
        return ret;
 }
 
-int btrfs_qgroup_insert_dirty_extent_nolock(struct btrfs_fs_info *fs_info,
+int btrfs_qgroup_trace_extent_nolock(struct btrfs_fs_info *fs_info,
                                struct btrfs_delayed_ref_root *delayed_refs,
                                struct btrfs_qgroup_extent_record *record)
 {
@@ -1467,7 +1467,7 @@ int btrfs_qgroup_insert_dirty_extent_nolock(struct btrfs_fs_info *fs_info,
        u64 bytenr = record->bytenr;
 
        assert_spin_locked(&delayed_refs->lock);
-       trace_btrfs_qgroup_insert_dirty_extent(fs_info, record);
+       trace_btrfs_qgroup_trace_extent(fs_info, record);
 
        while (*p) {
                parent_node = *p;
@@ -1486,7 +1486,7 @@ int btrfs_qgroup_insert_dirty_extent_nolock(struct btrfs_fs_info *fs_info,
        return 0;
 }
 
-int btrfs_qgroup_insert_dirty_extent(struct btrfs_trans_handle *trans,
+int btrfs_qgroup_trace_extent(struct btrfs_trans_handle *trans,
                struct btrfs_fs_info *fs_info, u64 bytenr, u64 num_bytes,
                gfp_t gfp_flag)
 {
@@ -1509,7 +1509,7 @@ int btrfs_qgroup_insert_dirty_extent(struct btrfs_trans_handle *trans,
        record->old_roots = NULL;
 
        spin_lock(&delayed_refs->lock);
-       ret = btrfs_qgroup_insert_dirty_extent_nolock(fs_info, delayed_refs,
+       ret = btrfs_qgroup_trace_extent_nolock(fs_info, delayed_refs,
                                                      record);
        spin_unlock(&delayed_refs->lock);
        if (ret > 0)
index a72bf21927572e58d31f8c17d579b5bc2365d4b2..9303e09c71dcf13efa8a991555d88c06712a9f9f 100644 (file)
@@ -93,8 +93,8 @@ struct btrfs_delayed_extent_op;
 int btrfs_qgroup_prepare_account_extents(struct btrfs_trans_handle *trans,
                                         struct btrfs_fs_info *fs_info);
 /*
- * Insert one dirty extent record into @delayed_refs, informing qgroup to
- * account that extent at commit trans time.
+ * Inform qgroup to trace one dirty extent, its info is recorded in @record.
+ * So qgroup can account it at commit trans time.
  *
  * No lock version, caller must acquire delayed ref lock and allocate memory.
  *
@@ -102,14 +102,15 @@ int btrfs_qgroup_prepare_account_extents(struct btrfs_trans_handle *trans,
  * Return >0 for existing record, caller can free @record safely.
  * Error is not possible
  */
-int btrfs_qgroup_insert_dirty_extent_nolock(
+int btrfs_qgroup_trace_extent_nolock(
                struct btrfs_fs_info *fs_info,
                struct btrfs_delayed_ref_root *delayed_refs,
                struct btrfs_qgroup_extent_record *record);
 
 /*
- * Insert one dirty extent record into @delayed_refs, informing qgroup to
- * account that extent at commit trans time.
+ * Inform qgroup to trace one dirty extent, specified by @bytenr and
+ * @num_bytes.
+ * So qgroup can account it at commit trans time.
  *
  * Better encapsulated version.
  *
@@ -117,7 +118,7 @@ int btrfs_qgroup_insert_dirty_extent_nolock(
  * Return <0 for error, like memory allocation failure or invalid parameter
  * (NULL trans)
  */
-int btrfs_qgroup_insert_dirty_extent(struct btrfs_trans_handle *trans,
+int btrfs_qgroup_trace_extent(struct btrfs_trans_handle *trans,
                struct btrfs_fs_info *fs_info, u64 bytenr, u64 num_bytes,
                gfp_t gfp_flag);
 
index 26f6c5ac879ea5381fd7ed3b893ee2db5bbfc148..c430f2f5be24ffaed8d08a16f1c8e3c33bf03d95 100644 (file)
@@ -4012,7 +4012,7 @@ static int qgroup_fix_relocated_data_extents(struct btrfs_trans_handle *trans,
                if (btrfs_file_extent_type(path->nodes[0], fi) !=
                                BTRFS_FILE_EXTENT_REG)
                        goto next;
-               ret = btrfs_qgroup_insert_dirty_extent(trans, fs_info,
+               ret = btrfs_qgroup_trace_extent(trans, fs_info,
                        btrfs_file_extent_disk_bytenr(path->nodes[0], fi),
                        btrfs_file_extent_disk_num_bytes(path->nodes[0], fi),
                        GFP_NOFS);
index 3d33c4e41e5f9a38195436432e54314548076b0d..e0478f51cf16942aa26b2b1eae03a5a6cd7ca88d 100644 (file)
@@ -689,7 +689,7 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans,
                 * as the owner of the file extent changed from log tree
                 * (doesn't affect qgroup) to fs/file tree(affects qgroup)
                 */
-               ret = btrfs_qgroup_insert_dirty_extent(trans, root->fs_info,
+               ret = btrfs_qgroup_trace_extent(trans, root->fs_info,
                                btrfs_file_extent_disk_bytenr(eb, item),
                                btrfs_file_extent_disk_num_bytes(eb, item),
                                GFP_NOFS);
index e030d6f6c19acb090348298e664739a8cb06c111..e61bbc3b82d50a294551a3c2202ffa5a0cbc5ae2 100644 (file)
@@ -1406,7 +1406,7 @@ DEFINE_EVENT(btrfs_qgroup_extent, btrfs_qgroup_account_extents,
        TP_ARGS(fs_info, rec)
 );
 
-DEFINE_EVENT(btrfs_qgroup_extent, btrfs_qgroup_insert_dirty_extent,
+DEFINE_EVENT(btrfs_qgroup_extent, btrfs_qgroup_trace_extent,
 
        TP_PROTO(struct btrfs_fs_info *fs_info,
                 struct btrfs_qgroup_extent_record *rec),