diff options
author | David S. Miller <davem@davemloft.net> | 2008-07-27 19:51:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-27 19:51:21 -0400 |
commit | 281c7413ed914623d3245299a4761b6b27ab9fdb (patch) | |
tree | 182b5222a7ad4b77c32f7845ea777ca665d7def2 /fs | |
parent | 2ab61b01110aa04cd853c619a74881e3225a5e24 (diff) | |
parent | c9272c4f9fbe2087beb3392f526dc5b19efaa56b (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/super.c | 6 | ||||
-rw-r--r-- | fs/nfs/unlink.c | 3 | ||||
-rw-r--r-- | fs/proc/base.c | 57 |
3 files changed, 21 insertions, 45 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 1b94e3650f5c..9abcd2b329f7 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -1718,9 +1718,9 @@ nfs_remount(struct super_block *sb, int *flags, char *raw_data) | |||
1718 | * ones were explicitly specified. Fall back to legacy behavior and | 1718 | * ones were explicitly specified. Fall back to legacy behavior and |
1719 | * just return success. | 1719 | * just return success. |
1720 | */ | 1720 | */ |
1721 | if ((nfsvers == 4 && options4->version == 1) || | 1721 | if ((nfsvers == 4 && (!options4 || options4->version == 1)) || |
1722 | (nfsvers <= 3 && options->version >= 1 && | 1722 | (nfsvers <= 3 && (!options || (options->version >= 1 && |
1723 | options->version <= 6)) | 1723 | options->version <= 6)))) |
1724 | return 0; | 1724 | return 0; |
1725 | 1725 | ||
1726 | data = kzalloc(sizeof(*data), GFP_KERNEL); | 1726 | data = kzalloc(sizeof(*data), GFP_KERNEL); |
diff --git a/fs/nfs/unlink.c b/fs/nfs/unlink.c index 3adf8b266461..f089e5839d7d 100644 --- a/fs/nfs/unlink.c +++ b/fs/nfs/unlink.c | |||
@@ -95,10 +95,11 @@ static void nfs_async_unlink_done(struct rpc_task *task, void *calldata) | |||
95 | static void nfs_async_unlink_release(void *calldata) | 95 | static void nfs_async_unlink_release(void *calldata) |
96 | { | 96 | { |
97 | struct nfs_unlinkdata *data = calldata; | 97 | struct nfs_unlinkdata *data = calldata; |
98 | struct super_block *sb = data->dir->i_sb; | ||
98 | 99 | ||
99 | nfs_dec_sillycount(data->dir); | 100 | nfs_dec_sillycount(data->dir); |
100 | nfs_sb_deactive(NFS_SERVER(data->dir)); | ||
101 | nfs_free_unlinkdata(data); | 101 | nfs_free_unlinkdata(data); |
102 | nfs_sb_deactive(NFS_SB(sb)); | ||
102 | } | 103 | } |
103 | 104 | ||
104 | static const struct rpc_call_ops nfs_unlink_ops = { | 105 | static const struct rpc_call_ops nfs_unlink_ops = { |
diff --git a/fs/proc/base.c b/fs/proc/base.c index e74308bdabd3..01ed610f9b87 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -53,6 +53,7 @@ | |||
53 | #include <linux/time.h> | 53 | #include <linux/time.h> |
54 | #include <linux/proc_fs.h> | 54 | #include <linux/proc_fs.h> |
55 | #include <linux/stat.h> | 55 | #include <linux/stat.h> |
56 | #include <linux/task_io_accounting_ops.h> | ||
56 | #include <linux/init.h> | 57 | #include <linux/init.h> |
57 | #include <linux/capability.h> | 58 | #include <linux/capability.h> |
58 | #include <linux/file.h> | 59 | #include <linux/file.h> |
@@ -2402,44 +2403,17 @@ static int proc_base_fill_cache(struct file *filp, void *dirent, | |||
2402 | #ifdef CONFIG_TASK_IO_ACCOUNTING | 2403 | #ifdef CONFIG_TASK_IO_ACCOUNTING |
2403 | static int do_io_accounting(struct task_struct *task, char *buffer, int whole) | 2404 | static int do_io_accounting(struct task_struct *task, char *buffer, int whole) |
2404 | { | 2405 | { |
2405 | u64 rchar, wchar, syscr, syscw; | 2406 | struct task_io_accounting acct = task->ioac; |
2406 | struct task_io_accounting ioac; | 2407 | unsigned long flags; |
2407 | 2408 | ||
2408 | rchar = task->rchar; | 2409 | if (whole && lock_task_sighand(task, &flags)) { |
2409 | wchar = task->wchar; | 2410 | struct task_struct *t = task; |
2410 | syscr = task->syscr; | 2411 | |
2411 | syscw = task->syscw; | 2412 | task_io_accounting_add(&acct, &task->signal->ioac); |
2412 | memcpy(&ioac, &task->ioac, sizeof(ioac)); | 2413 | while_each_thread(task, t) |
2413 | 2414 | task_io_accounting_add(&acct, &t->ioac); | |
2414 | if (whole) { | 2415 | |
2415 | unsigned long flags; | 2416 | unlock_task_sighand(task, &flags); |
2416 | |||
2417 | if (lock_task_sighand(task, &flags)) { | ||
2418 | struct signal_struct *sig = task->signal; | ||
2419 | struct task_struct *t = task; | ||
2420 | |||
2421 | rchar += sig->rchar; | ||
2422 | wchar += sig->wchar; | ||
2423 | syscr += sig->syscr; | ||
2424 | syscw += sig->syscw; | ||
2425 | |||
2426 | ioac.read_bytes += sig->ioac.read_bytes; | ||
2427 | ioac.write_bytes += sig->ioac.write_bytes; | ||
2428 | ioac.cancelled_write_bytes += | ||
2429 | sig->ioac.cancelled_write_bytes; | ||
2430 | while_each_thread(task, t) { | ||
2431 | rchar += t->rchar; | ||
2432 | wchar += t->wchar; | ||
2433 | syscr += t->syscr; | ||
2434 | syscw += t->syscw; | ||
2435 | |||
2436 | ioac.read_bytes += t->ioac.read_bytes; | ||
2437 | ioac.write_bytes += t->ioac.write_bytes; | ||
2438 | ioac.cancelled_write_bytes += | ||
2439 | t->ioac.cancelled_write_bytes; | ||
2440 | } | ||
2441 | unlock_task_sighand(task, &flags); | ||
2442 | } | ||
2443 | } | 2417 | } |
2444 | return sprintf(buffer, | 2418 | return sprintf(buffer, |
2445 | "rchar: %llu\n" | 2419 | "rchar: %llu\n" |
@@ -2449,9 +2423,10 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole) | |||
2449 | "read_bytes: %llu\n" | 2423 | "read_bytes: %llu\n" |
2450 | "write_bytes: %llu\n" | 2424 | "write_bytes: %llu\n" |
2451 | "cancelled_write_bytes: %llu\n", | 2425 | "cancelled_write_bytes: %llu\n", |
2452 | rchar, wchar, syscr, syscw, | 2426 | acct.rchar, acct.wchar, |
2453 | ioac.read_bytes, ioac.write_bytes, | 2427 | acct.syscr, acct.syscw, |
2454 | ioac.cancelled_write_bytes); | 2428 | acct.read_bytes, acct.write_bytes, |
2429 | acct.cancelled_write_bytes); | ||
2455 | } | 2430 | } |
2456 | 2431 | ||
2457 | static int proc_tid_io_accounting(struct task_struct *task, char *buffer) | 2432 | static int proc_tid_io_accounting(struct task_struct *task, char *buffer) |