diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/Kconfig | 2 | ||||
-rw-r--r-- | fs/binfmt_elf.c | 19 | ||||
-rw-r--r-- | fs/binfmt_elf_fdpic.c | 19 | ||||
-rw-r--r-- | fs/fuse/file.c | 5 | ||||
-rw-r--r-- | fs/fuse/fuse_i.h | 5 | ||||
-rw-r--r-- | fs/fuse/inode.c | 3 | ||||
-rw-r--r-- | fs/proc/array.c | 8 | ||||
-rw-r--r-- | fs/proc/proc_misc.c | 40 |
8 files changed, 50 insertions, 51 deletions
diff --git a/fs/Kconfig b/fs/Kconfig index e282002b94d2..e46297f020c1 100644 --- a/fs/Kconfig +++ b/fs/Kconfig | |||
@@ -403,7 +403,7 @@ config AUTOFS4_FS | |||
403 | N here. | 403 | N here. |
404 | 404 | ||
405 | config FUSE_FS | 405 | config FUSE_FS |
406 | tristate "Filesystem in Userspace support" | 406 | tristate "FUSE (Filesystem in Userspace) support" |
407 | help | 407 | help |
408 | With FUSE it is possible to implement a fully functional filesystem | 408 | With FUSE it is possible to implement a fully functional filesystem |
409 | in a userspace program. | 409 | in a userspace program. |
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index e2159063198a..8fcfa398d350 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c | |||
@@ -1341,20 +1341,15 @@ static void fill_prstatus(struct elf_prstatus *prstatus, | |||
1341 | prstatus->pr_pgrp = task_pgrp_vnr(p); | 1341 | prstatus->pr_pgrp = task_pgrp_vnr(p); |
1342 | prstatus->pr_sid = task_session_vnr(p); | 1342 | prstatus->pr_sid = task_session_vnr(p); |
1343 | if (thread_group_leader(p)) { | 1343 | if (thread_group_leader(p)) { |
1344 | struct task_cputime cputime; | ||
1345 | |||
1344 | /* | 1346 | /* |
1345 | * This is the record for the group leader. Add in the | 1347 | * This is the record for the group leader. It shows the |
1346 | * cumulative times of previous dead threads. This total | 1348 | * group-wide total, not its individual thread total. |
1347 | * won't include the time of each live thread whose state | ||
1348 | * is included in the core dump. The final total reported | ||
1349 | * to our parent process when it calls wait4 will include | ||
1350 | * those sums as well as the little bit more time it takes | ||
1351 | * this and each other thread to finish dying after the | ||
1352 | * core dump synchronization phase. | ||
1353 | */ | 1349 | */ |
1354 | cputime_to_timeval(cputime_add(p->utime, p->signal->utime), | 1350 | thread_group_cputime(p, &cputime); |
1355 | &prstatus->pr_utime); | 1351 | cputime_to_timeval(cputime.utime, &prstatus->pr_utime); |
1356 | cputime_to_timeval(cputime_add(p->stime, p->signal->stime), | 1352 | cputime_to_timeval(cputime.stime, &prstatus->pr_stime); |
1357 | &prstatus->pr_stime); | ||
1358 | } else { | 1353 | } else { |
1359 | cputime_to_timeval(p->utime, &prstatus->pr_utime); | 1354 | cputime_to_timeval(p->utime, &prstatus->pr_utime); |
1360 | cputime_to_timeval(p->stime, &prstatus->pr_stime); | 1355 | cputime_to_timeval(p->stime, &prstatus->pr_stime); |
diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c index 0e8367c54624..5b5424cb3391 100644 --- a/fs/binfmt_elf_fdpic.c +++ b/fs/binfmt_elf_fdpic.c | |||
@@ -1390,20 +1390,15 @@ static void fill_prstatus(struct elf_prstatus *prstatus, | |||
1390 | prstatus->pr_pgrp = task_pgrp_vnr(p); | 1390 | prstatus->pr_pgrp = task_pgrp_vnr(p); |
1391 | prstatus->pr_sid = task_session_vnr(p); | 1391 | prstatus->pr_sid = task_session_vnr(p); |
1392 | if (thread_group_leader(p)) { | 1392 | if (thread_group_leader(p)) { |
1393 | struct task_cputime cputime; | ||
1394 | |||
1393 | /* | 1395 | /* |
1394 | * This is the record for the group leader. Add in the | 1396 | * This is the record for the group leader. It shows the |
1395 | * cumulative times of previous dead threads. This total | 1397 | * group-wide total, not its individual thread total. |
1396 | * won't include the time of each live thread whose state | ||
1397 | * is included in the core dump. The final total reported | ||
1398 | * to our parent process when it calls wait4 will include | ||
1399 | * those sums as well as the little bit more time it takes | ||
1400 | * this and each other thread to finish dying after the | ||
1401 | * core dump synchronization phase. | ||
1402 | */ | 1398 | */ |
1403 | cputime_to_timeval(cputime_add(p->utime, p->signal->utime), | 1399 | thread_group_cputime(p, &cputime); |
1404 | &prstatus->pr_utime); | 1400 | cputime_to_timeval(cputime.utime, &prstatus->pr_utime); |
1405 | cputime_to_timeval(cputime_add(p->stime, p->signal->stime), | 1401 | cputime_to_timeval(cputime.stime, &prstatus->pr_stime); |
1406 | &prstatus->pr_stime); | ||
1407 | } else { | 1402 | } else { |
1408 | cputime_to_timeval(p->utime, &prstatus->pr_utime); | 1403 | cputime_to_timeval(p->utime, &prstatus->pr_utime); |
1409 | cputime_to_timeval(p->stime, &prstatus->pr_stime); | 1404 | cputime_to_timeval(p->stime, &prstatus->pr_stime); |
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 2bada6bbc317..34930a964b82 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c | |||
@@ -101,6 +101,8 @@ void fuse_finish_open(struct inode *inode, struct file *file, | |||
101 | file->f_op = &fuse_direct_io_file_operations; | 101 | file->f_op = &fuse_direct_io_file_operations; |
102 | if (!(outarg->open_flags & FOPEN_KEEP_CACHE)) | 102 | if (!(outarg->open_flags & FOPEN_KEEP_CACHE)) |
103 | invalidate_inode_pages2(inode->i_mapping); | 103 | invalidate_inode_pages2(inode->i_mapping); |
104 | if (outarg->open_flags & FOPEN_NONSEEKABLE) | ||
105 | nonseekable_open(inode, file); | ||
104 | ff->fh = outarg->fh; | 106 | ff->fh = outarg->fh; |
105 | file->private_data = fuse_file_get(ff); | 107 | file->private_data = fuse_file_get(ff); |
106 | } | 108 | } |
@@ -1448,6 +1450,9 @@ static loff_t fuse_file_llseek(struct file *file, loff_t offset, int origin) | |||
1448 | mutex_lock(&inode->i_mutex); | 1450 | mutex_lock(&inode->i_mutex); |
1449 | switch (origin) { | 1451 | switch (origin) { |
1450 | case SEEK_END: | 1452 | case SEEK_END: |
1453 | retval = fuse_update_attributes(inode, NULL, file, NULL); | ||
1454 | if (retval) | ||
1455 | return retval; | ||
1451 | offset += i_size_read(inode); | 1456 | offset += i_size_read(inode); |
1452 | break; | 1457 | break; |
1453 | case SEEK_CUR: | 1458 | case SEEK_CUR: |
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 3a876076bdd1..35accfdd747f 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h | |||
@@ -6,6 +6,9 @@ | |||
6 | See the file COPYING. | 6 | See the file COPYING. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #ifndef _FS_FUSE_I_H | ||
10 | #define _FS_FUSE_I_H | ||
11 | |||
9 | #include <linux/fuse.h> | 12 | #include <linux/fuse.h> |
10 | #include <linux/fs.h> | 13 | #include <linux/fs.h> |
11 | #include <linux/mount.h> | 14 | #include <linux/mount.h> |
@@ -655,3 +658,5 @@ void fuse_set_nowrite(struct inode *inode); | |||
655 | void fuse_release_nowrite(struct inode *inode); | 658 | void fuse_release_nowrite(struct inode *inode); |
656 | 659 | ||
657 | u64 fuse_get_attr_version(struct fuse_conn *fc); | 660 | u64 fuse_get_attr_version(struct fuse_conn *fc); |
661 | |||
662 | #endif /* _FS_FUSE_I_H */ | ||
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 6a84388cacff..54b1f0e1ef58 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c | |||
@@ -865,7 +865,7 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent) | |||
865 | if (is_bdev) { | 865 | if (is_bdev) { |
866 | fc->destroy_req = fuse_request_alloc(); | 866 | fc->destroy_req = fuse_request_alloc(); |
867 | if (!fc->destroy_req) | 867 | if (!fc->destroy_req) |
868 | goto err_put_root; | 868 | goto err_free_init_req; |
869 | } | 869 | } |
870 | 870 | ||
871 | mutex_lock(&fuse_mutex); | 871 | mutex_lock(&fuse_mutex); |
@@ -895,6 +895,7 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent) | |||
895 | 895 | ||
896 | err_unlock: | 896 | err_unlock: |
897 | mutex_unlock(&fuse_mutex); | 897 | mutex_unlock(&fuse_mutex); |
898 | err_free_init_req: | ||
898 | fuse_request_free(init_req); | 899 | fuse_request_free(init_req); |
899 | err_put_root: | 900 | err_put_root: |
900 | dput(root_dentry); | 901 | dput(root_dentry); |
diff --git a/fs/proc/array.c b/fs/proc/array.c index f4bc0e789539..bb9f4b05703d 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c | |||
@@ -388,20 +388,20 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns, | |||
388 | 388 | ||
389 | /* add up live thread stats at the group level */ | 389 | /* add up live thread stats at the group level */ |
390 | if (whole) { | 390 | if (whole) { |
391 | struct task_cputime cputime; | ||
391 | struct task_struct *t = task; | 392 | struct task_struct *t = task; |
392 | do { | 393 | do { |
393 | min_flt += t->min_flt; | 394 | min_flt += t->min_flt; |
394 | maj_flt += t->maj_flt; | 395 | maj_flt += t->maj_flt; |
395 | utime = cputime_add(utime, task_utime(t)); | ||
396 | stime = cputime_add(stime, task_stime(t)); | ||
397 | gtime = cputime_add(gtime, task_gtime(t)); | 396 | gtime = cputime_add(gtime, task_gtime(t)); |
398 | t = next_thread(t); | 397 | t = next_thread(t); |
399 | } while (t != task); | 398 | } while (t != task); |
400 | 399 | ||
401 | min_flt += sig->min_flt; | 400 | min_flt += sig->min_flt; |
402 | maj_flt += sig->maj_flt; | 401 | maj_flt += sig->maj_flt; |
403 | utime = cputime_add(utime, sig->utime); | 402 | thread_group_cputime(task, &cputime); |
404 | stime = cputime_add(stime, sig->stime); | 403 | utime = cputime.utime; |
404 | stime = cputime.stime; | ||
405 | gtime = cputime_add(gtime, sig->gtime); | 405 | gtime = cputime_add(gtime, sig->gtime); |
406 | } | 406 | } |
407 | 407 | ||
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c index 61b25f4eabe6..7ea52c79b2da 100644 --- a/fs/proc/proc_misc.c +++ b/fs/proc/proc_misc.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/mm.h> | 30 | #include <linux/mm.h> |
31 | #include <linux/mmzone.h> | 31 | #include <linux/mmzone.h> |
32 | #include <linux/pagemap.h> | 32 | #include <linux/pagemap.h> |
33 | #include <linux/irq.h> | ||
33 | #include <linux/interrupt.h> | 34 | #include <linux/interrupt.h> |
34 | #include <linux/swap.h> | 35 | #include <linux/swap.h> |
35 | #include <linux/slab.h> | 36 | #include <linux/slab.h> |
@@ -521,17 +522,13 @@ static const struct file_operations proc_vmalloc_operations = { | |||
521 | 522 | ||
522 | static int show_stat(struct seq_file *p, void *v) | 523 | static int show_stat(struct seq_file *p, void *v) |
523 | { | 524 | { |
524 | int i; | 525 | int i, j; |
525 | unsigned long jif; | 526 | unsigned long jif; |
526 | cputime64_t user, nice, system, idle, iowait, irq, softirq, steal; | 527 | cputime64_t user, nice, system, idle, iowait, irq, softirq, steal; |
527 | cputime64_t guest; | 528 | cputime64_t guest; |
528 | u64 sum = 0; | 529 | u64 sum = 0; |
529 | struct timespec boottime; | 530 | struct timespec boottime; |
530 | unsigned int *per_irq_sum; | 531 | unsigned int per_irq_sum; |
531 | |||
532 | per_irq_sum = kzalloc(sizeof(unsigned int)*NR_IRQS, GFP_KERNEL); | ||
533 | if (!per_irq_sum) | ||
534 | return -ENOMEM; | ||
535 | 532 | ||
536 | user = nice = system = idle = iowait = | 533 | user = nice = system = idle = iowait = |
537 | irq = softirq = steal = cputime64_zero; | 534 | irq = softirq = steal = cputime64_zero; |
@@ -540,8 +537,6 @@ static int show_stat(struct seq_file *p, void *v) | |||
540 | jif = boottime.tv_sec; | 537 | jif = boottime.tv_sec; |
541 | 538 | ||
542 | for_each_possible_cpu(i) { | 539 | for_each_possible_cpu(i) { |
543 | int j; | ||
544 | |||
545 | user = cputime64_add(user, kstat_cpu(i).cpustat.user); | 540 | user = cputime64_add(user, kstat_cpu(i).cpustat.user); |
546 | nice = cputime64_add(nice, kstat_cpu(i).cpustat.nice); | 541 | nice = cputime64_add(nice, kstat_cpu(i).cpustat.nice); |
547 | system = cputime64_add(system, kstat_cpu(i).cpustat.system); | 542 | system = cputime64_add(system, kstat_cpu(i).cpustat.system); |
@@ -551,11 +546,10 @@ static int show_stat(struct seq_file *p, void *v) | |||
551 | softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq); | 546 | softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq); |
552 | steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal); | 547 | steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal); |
553 | guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest); | 548 | guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest); |
554 | for (j = 0; j < NR_IRQS; j++) { | 549 | |
555 | unsigned int temp = kstat_cpu(i).irqs[j]; | 550 | for_each_irq_nr(j) |
556 | sum += temp; | 551 | sum += kstat_irqs_cpu(j, i); |
557 | per_irq_sum[j] += temp; | 552 | |
558 | } | ||
559 | sum += arch_irq_stat_cpu(i); | 553 | sum += arch_irq_stat_cpu(i); |
560 | } | 554 | } |
561 | sum += arch_irq_stat(); | 555 | sum += arch_irq_stat(); |
@@ -597,8 +591,15 @@ static int show_stat(struct seq_file *p, void *v) | |||
597 | } | 591 | } |
598 | seq_printf(p, "intr %llu", (unsigned long long)sum); | 592 | seq_printf(p, "intr %llu", (unsigned long long)sum); |
599 | 593 | ||
600 | for (i = 0; i < NR_IRQS; i++) | 594 | /* sum again ? it could be updated? */ |
601 | seq_printf(p, " %u", per_irq_sum[i]); | 595 | for_each_irq_nr(j) { |
596 | per_irq_sum = 0; | ||
597 | |||
598 | for_each_possible_cpu(i) | ||
599 | per_irq_sum += kstat_irqs_cpu(j, i); | ||
600 | |||
601 | seq_printf(p, " %u", per_irq_sum); | ||
602 | } | ||
602 | 603 | ||
603 | seq_printf(p, | 604 | seq_printf(p, |
604 | "\nctxt %llu\n" | 605 | "\nctxt %llu\n" |
@@ -612,7 +613,6 @@ static int show_stat(struct seq_file *p, void *v) | |||
612 | nr_running(), | 613 | nr_running(), |
613 | nr_iowait()); | 614 | nr_iowait()); |
614 | 615 | ||
615 | kfree(per_irq_sum); | ||
616 | return 0; | 616 | return 0; |
617 | } | 617 | } |
618 | 618 | ||
@@ -651,15 +651,14 @@ static const struct file_operations proc_stat_operations = { | |||
651 | */ | 651 | */ |
652 | static void *int_seq_start(struct seq_file *f, loff_t *pos) | 652 | static void *int_seq_start(struct seq_file *f, loff_t *pos) |
653 | { | 653 | { |
654 | return (*pos <= NR_IRQS) ? pos : NULL; | 654 | return (*pos <= nr_irqs) ? pos : NULL; |
655 | } | 655 | } |
656 | 656 | ||
657 | |||
657 | static void *int_seq_next(struct seq_file *f, void *v, loff_t *pos) | 658 | static void *int_seq_next(struct seq_file *f, void *v, loff_t *pos) |
658 | { | 659 | { |
659 | (*pos)++; | 660 | (*pos)++; |
660 | if (*pos > NR_IRQS) | 661 | return (*pos <= nr_irqs) ? pos : NULL; |
661 | return NULL; | ||
662 | return pos; | ||
663 | } | 662 | } |
664 | 663 | ||
665 | static void int_seq_stop(struct seq_file *f, void *v) | 664 | static void int_seq_stop(struct seq_file *f, void *v) |
@@ -667,7 +666,6 @@ static void int_seq_stop(struct seq_file *f, void *v) | |||
667 | /* Nothing to do */ | 666 | /* Nothing to do */ |
668 | } | 667 | } |
669 | 668 | ||
670 | |||
671 | static const struct seq_operations int_seq_ops = { | 669 | static const struct seq_operations int_seq_ops = { |
672 | .start = int_seq_start, | 670 | .start = int_seq_start, |
673 | .next = int_seq_next, | 671 | .next = int_seq_next, |