diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/bio.c | 5 | ||||
-rw-r--r-- | fs/proc/stat.c | 19 | ||||
-rw-r--r-- | fs/seq_file.c | 14 |
3 files changed, 32 insertions, 6 deletions
@@ -26,8 +26,11 @@ | |||
26 | #include <linux/mempool.h> | 26 | #include <linux/mempool.h> |
27 | #include <linux/workqueue.h> | 27 | #include <linux/workqueue.h> |
28 | #include <linux/blktrace_api.h> | 28 | #include <linux/blktrace_api.h> |
29 | #include <trace/block.h> | ||
29 | #include <scsi/sg.h> /* for struct sg_iovec */ | 30 | #include <scsi/sg.h> /* for struct sg_iovec */ |
30 | 31 | ||
32 | DEFINE_TRACE(block_split); | ||
33 | |||
31 | static struct kmem_cache *bio_slab __read_mostly; | 34 | static struct kmem_cache *bio_slab __read_mostly; |
32 | 35 | ||
33 | static mempool_t *bio_split_pool __read_mostly; | 36 | static mempool_t *bio_split_pool __read_mostly; |
@@ -1263,7 +1266,7 @@ struct bio_pair *bio_split(struct bio *bi, int first_sectors) | |||
1263 | if (!bp) | 1266 | if (!bp) |
1264 | return bp; | 1267 | return bp; |
1265 | 1268 | ||
1266 | blk_add_trace_pdu_int(bdev_get_queue(bi->bi_bdev), BLK_TA_SPLIT, bi, | 1269 | trace_block_split(bdev_get_queue(bi->bi_bdev), bi, |
1267 | bi->bi_sector + first_sectors); | 1270 | bi->bi_sector + first_sectors); |
1268 | 1271 | ||
1269 | BUG_ON(bi->bi_vcnt != 1); | 1272 | BUG_ON(bi->bi_vcnt != 1); |
diff --git a/fs/proc/stat.c b/fs/proc/stat.c index 81904f07679d..3cb9492801c0 100644 --- a/fs/proc/stat.c +++ b/fs/proc/stat.c | |||
@@ -27,6 +27,7 @@ static int show_stat(struct seq_file *p, void *v) | |||
27 | u64 sum = 0; | 27 | u64 sum = 0; |
28 | struct timespec boottime; | 28 | struct timespec boottime; |
29 | unsigned int per_irq_sum; | 29 | unsigned int per_irq_sum; |
30 | struct irq_desc *desc; | ||
30 | 31 | ||
31 | user = nice = system = idle = iowait = | 32 | user = nice = system = idle = iowait = |
32 | irq = softirq = steal = cputime64_zero; | 33 | irq = softirq = steal = cputime64_zero; |
@@ -44,10 +45,14 @@ static int show_stat(struct seq_file *p, void *v) | |||
44 | softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq); | 45 | softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq); |
45 | steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal); | 46 | steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal); |
46 | guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest); | 47 | guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest); |
47 | 48 | for_each_irq_nr(j) { | |
48 | for_each_irq_nr(j) | 49 | #ifdef CONFIG_SPARSE_IRQ |
50 | desc = irq_to_desc(j); | ||
51 | if (!desc) | ||
52 | continue; | ||
53 | #endif | ||
49 | sum += kstat_irqs_cpu(j, i); | 54 | sum += kstat_irqs_cpu(j, i); |
50 | 55 | } | |
51 | sum += arch_irq_stat_cpu(i); | 56 | sum += arch_irq_stat_cpu(i); |
52 | } | 57 | } |
53 | sum += arch_irq_stat(); | 58 | sum += arch_irq_stat(); |
@@ -92,7 +97,13 @@ static int show_stat(struct seq_file *p, void *v) | |||
92 | /* sum again ? it could be updated? */ | 97 | /* sum again ? it could be updated? */ |
93 | for_each_irq_nr(j) { | 98 | for_each_irq_nr(j) { |
94 | per_irq_sum = 0; | 99 | per_irq_sum = 0; |
95 | 100 | #ifdef CONFIG_SPARSE_IRQ | |
101 | desc = irq_to_desc(j); | ||
102 | if (!desc) { | ||
103 | seq_printf(p, " %u", per_irq_sum); | ||
104 | continue; | ||
105 | } | ||
106 | #endif | ||
96 | for_each_possible_cpu(i) | 107 | for_each_possible_cpu(i) |
97 | per_irq_sum += kstat_irqs_cpu(j, i); | 108 | per_irq_sum += kstat_irqs_cpu(j, i); |
98 | 109 | ||
diff --git a/fs/seq_file.c b/fs/seq_file.c index eba2eabcd2b8..16c211558c22 100644 --- a/fs/seq_file.c +++ b/fs/seq_file.c | |||
@@ -357,7 +357,18 @@ int seq_printf(struct seq_file *m, const char *f, ...) | |||
357 | } | 357 | } |
358 | EXPORT_SYMBOL(seq_printf); | 358 | EXPORT_SYMBOL(seq_printf); |
359 | 359 | ||
360 | static char *mangle_path(char *s, char *p, char *esc) | 360 | /** |
361 | * mangle_path - mangle and copy path to buffer beginning | ||
362 | * @s: buffer start | ||
363 | * @p: beginning of path in above buffer | ||
364 | * @esc: set of characters that need escaping | ||
365 | * | ||
366 | * Copy the path from @p to @s, replacing each occurrence of character from | ||
367 | * @esc with usual octal escape. | ||
368 | * Returns pointer past last written character in @s, or NULL in case of | ||
369 | * failure. | ||
370 | */ | ||
371 | char *mangle_path(char *s, char *p, char *esc) | ||
361 | { | 372 | { |
362 | while (s <= p) { | 373 | while (s <= p) { |
363 | char c = *p++; | 374 | char c = *p++; |
@@ -376,6 +387,7 @@ static char *mangle_path(char *s, char *p, char *esc) | |||
376 | } | 387 | } |
377 | return NULL; | 388 | return NULL; |
378 | } | 389 | } |
390 | EXPORT_SYMBOL(mangle_path); | ||
379 | 391 | ||
380 | /* | 392 | /* |
381 | * return the absolute path of 'dentry' residing in mount 'mnt'. | 393 | * return the absolute path of 'dentry' residing in mount 'mnt'. |