diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-25 12:18:27 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-25 12:18:27 -0500 |
commit | 53846a21c1766326bb14ce8ab6e997a0c120675d (patch) | |
tree | 37b04485e29844b4e734479181276a2f4d2447e4 /fs/proc | |
parent | 2e9abdd9bad485970b37cd53a82f92702054984c (diff) | |
parent | 1ebbe2b20091d306453a5cf480a87e6cd28ae76f (diff) |
Merge git://git.linux-nfs.org/pub/linux/nfs-2.6
* git://git.linux-nfs.org/pub/linux/nfs-2.6: (103 commits)
SUNRPC,RPCSEC_GSS: spkm3--fix config dependencies
SUNRPC,RPCSEC_GSS: spkm3: import contexts using NID_cast5_cbc
LOCKD: Make nlmsvc_traverse_shares return void
LOCKD: nlmsvc_traverse_blocks return is unused
SUNRPC,RPCSEC_GSS: fix krb5 sequence numbers.
NFSv4: Dont list system.nfs4_acl for filesystems that don't support it.
SUNRPC,RPCSEC_GSS: remove unnecessary kmalloc of a checksum
SUNRPC: Ensure rpc_call_async() always calls tk_ops->rpc_release()
SUNRPC: Fix memory barriers for req->rq_received
NFS: Fix a race in nfs_sync_inode()
NFS: Clean up nfs_flush_list()
NFS: Fix a race with PG_private and nfs_release_page()
NFSv4: Ensure the callback daemon flushes signals
SUNRPC: Fix a 'Busy inodes' error in rpc_pipefs
NFS, NLM: Allow blocking locks to respect signals
NFS: Make nfs_fhget() return appropriate error values
NFSv4: Fix an oops in nfs4_fill_super
lockd: blocks should hold a reference to the nlm_file
NFSv4: SETCLIENTID_CONFIRM should handle NFS4ERR_DELAY/NFS4ERR_RESOURCE
NFSv4: Send the delegation stateid for SETATTR calls
...
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/base.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index 20feb7568deb..8f1f49ceebec 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -104,6 +104,7 @@ enum pid_directory_inos { | |||
104 | PROC_TGID_MAPS, | 104 | PROC_TGID_MAPS, |
105 | PROC_TGID_NUMA_MAPS, | 105 | PROC_TGID_NUMA_MAPS, |
106 | PROC_TGID_MOUNTS, | 106 | PROC_TGID_MOUNTS, |
107 | PROC_TGID_MOUNTSTATS, | ||
107 | PROC_TGID_WCHAN, | 108 | PROC_TGID_WCHAN, |
108 | #ifdef CONFIG_MMU | 109 | #ifdef CONFIG_MMU |
109 | PROC_TGID_SMAPS, | 110 | PROC_TGID_SMAPS, |
@@ -144,6 +145,7 @@ enum pid_directory_inos { | |||
144 | PROC_TID_MAPS, | 145 | PROC_TID_MAPS, |
145 | PROC_TID_NUMA_MAPS, | 146 | PROC_TID_NUMA_MAPS, |
146 | PROC_TID_MOUNTS, | 147 | PROC_TID_MOUNTS, |
148 | PROC_TID_MOUNTSTATS, | ||
147 | PROC_TID_WCHAN, | 149 | PROC_TID_WCHAN, |
148 | #ifdef CONFIG_MMU | 150 | #ifdef CONFIG_MMU |
149 | PROC_TID_SMAPS, | 151 | PROC_TID_SMAPS, |
@@ -201,6 +203,7 @@ static struct pid_entry tgid_base_stuff[] = { | |||
201 | E(PROC_TGID_ROOT, "root", S_IFLNK|S_IRWXUGO), | 203 | E(PROC_TGID_ROOT, "root", S_IFLNK|S_IRWXUGO), |
202 | E(PROC_TGID_EXE, "exe", S_IFLNK|S_IRWXUGO), | 204 | E(PROC_TGID_EXE, "exe", S_IFLNK|S_IRWXUGO), |
203 | E(PROC_TGID_MOUNTS, "mounts", S_IFREG|S_IRUGO), | 205 | E(PROC_TGID_MOUNTS, "mounts", S_IFREG|S_IRUGO), |
206 | E(PROC_TGID_MOUNTSTATS, "mountstats", S_IFREG|S_IRUSR), | ||
204 | #ifdef CONFIG_MMU | 207 | #ifdef CONFIG_MMU |
205 | E(PROC_TGID_SMAPS, "smaps", S_IFREG|S_IRUGO), | 208 | E(PROC_TGID_SMAPS, "smaps", S_IFREG|S_IRUGO), |
206 | #endif | 209 | #endif |
@@ -732,6 +735,38 @@ static struct file_operations proc_mounts_operations = { | |||
732 | .poll = mounts_poll, | 735 | .poll = mounts_poll, |
733 | }; | 736 | }; |
734 | 737 | ||
738 | extern struct seq_operations mountstats_op; | ||
739 | static int mountstats_open(struct inode *inode, struct file *file) | ||
740 | { | ||
741 | struct task_struct *task = proc_task(inode); | ||
742 | int ret = seq_open(file, &mountstats_op); | ||
743 | |||
744 | if (!ret) { | ||
745 | struct seq_file *m = file->private_data; | ||
746 | struct namespace *namespace; | ||
747 | task_lock(task); | ||
748 | namespace = task->namespace; | ||
749 | if (namespace) | ||
750 | get_namespace(namespace); | ||
751 | task_unlock(task); | ||
752 | |||
753 | if (namespace) | ||
754 | m->private = namespace; | ||
755 | else { | ||
756 | seq_release(inode, file); | ||
757 | ret = -EINVAL; | ||
758 | } | ||
759 | } | ||
760 | return ret; | ||
761 | } | ||
762 | |||
763 | static struct file_operations proc_mountstats_operations = { | ||
764 | .open = mountstats_open, | ||
765 | .read = seq_read, | ||
766 | .llseek = seq_lseek, | ||
767 | .release = mounts_release, | ||
768 | }; | ||
769 | |||
735 | #define PROC_BLOCK_SIZE (3*1024) /* 4K page size but our output routines use some slack for overruns */ | 770 | #define PROC_BLOCK_SIZE (3*1024) /* 4K page size but our output routines use some slack for overruns */ |
736 | 771 | ||
737 | static ssize_t proc_info_read(struct file * file, char __user * buf, | 772 | static ssize_t proc_info_read(struct file * file, char __user * buf, |
@@ -1730,6 +1765,10 @@ static struct dentry *proc_pident_lookup(struct inode *dir, | |||
1730 | inode->i_fop = &proc_smaps_operations; | 1765 | inode->i_fop = &proc_smaps_operations; |
1731 | break; | 1766 | break; |
1732 | #endif | 1767 | #endif |
1768 | case PROC_TID_MOUNTSTATS: | ||
1769 | case PROC_TGID_MOUNTSTATS: | ||
1770 | inode->i_fop = &proc_mountstats_operations; | ||
1771 | break; | ||
1733 | #ifdef CONFIG_SECURITY | 1772 | #ifdef CONFIG_SECURITY |
1734 | case PROC_TID_ATTR: | 1773 | case PROC_TID_ATTR: |
1735 | inode->i_nlink = 2; | 1774 | inode->i_nlink = 2; |