X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=block%2Fblktrace.c;h=498a0a54a6aa664f27edce4a32d2fb2d37f4c110;hb=982286d1b8e438f595cdc9304cc4c185c7b90a39;hp=775471ef84a536159da907711070e889659984e2;hpb=37ca506adc395a028cd12760eca419dd0dc14b5c;p=cascardo%2Flinux.git diff --git a/block/blktrace.c b/block/blktrace.c index 775471ef84a5..498a0a54a6aa 100644 --- a/block/blktrace.c +++ b/block/blktrace.c @@ -202,6 +202,7 @@ static void blk_remove_tree(struct dentry *dir) static struct dentry *blk_create_tree(const char *blk_name) { struct dentry *dir = NULL; + int created = 0; mutex_lock(&blk_tree_mutex); @@ -209,13 +210,17 @@ static struct dentry *blk_create_tree(const char *blk_name) blk_tree_root = debugfs_create_dir("block", NULL); if (!blk_tree_root) goto err; + created = 1; } dir = debugfs_create_dir(blk_name, blk_tree_root); if (dir) root_users++; - else - blk_remove_root(); + else { + /* Delete root only if we created it */ + if (created) + blk_remove_root(); + } err: mutex_unlock(&blk_tree_mutex); @@ -550,7 +555,7 @@ static void blk_trace_set_ht_offsets(void) for_each_online_cpu(cpu) { unsigned long long *cpu_off, *sibling_off; - for_each_cpu_mask(i, cpu_sibling_map[cpu]) { + for_each_cpu_mask(i, per_cpu(cpu_sibling_map, cpu)) { if (i == cpu) continue;