diff options
| author | Anton Altaparmakov <aia21@cantab.net> | 2006-02-24 04:06:36 -0500 |
|---|---|---|
| committer | Anton Altaparmakov <aia21@cantab.net> | 2006-02-24 04:06:36 -0500 |
| commit | fab8d6ddf6dee2608869005d45fe97f70e4f5bdd (patch) | |
| tree | fecf566e03a87b2a44c7f3363ddb5c0d4bebdca7 /fs/proc/root.c | |
| parent | 64419d93a5906600af5817ad0cae3c6ecf7fb389 (diff) | |
| parent | f52ee1410d563cd409b08822492273a5bc235821 (diff) | |
Merge branch 'master' of /home/src/linux-2.6/
Diffstat (limited to 'fs/proc/root.c')
| -rw-r--r-- | fs/proc/root.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/fs/proc/root.c b/fs/proc/root.c index 68896283c8ae..c3fd3611112f 100644 --- a/fs/proc/root.c +++ b/fs/proc/root.c | |||
| @@ -80,16 +80,16 @@ void __init proc_root_init(void) | |||
| 80 | proc_bus = proc_mkdir("bus", NULL); | 80 | proc_bus = proc_mkdir("bus", NULL); |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | static struct dentry *proc_root_lookup(struct inode * dir, struct dentry * dentry, struct nameidata *nd) | 83 | static int proc_root_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat |
| 84 | ) | ||
| 84 | { | 85 | { |
| 85 | /* | 86 | generic_fillattr(dentry->d_inode, stat); |
| 86 | * nr_threads is actually protected by the tasklist_lock; | 87 | stat->nlink = proc_root.nlink + nr_processes(); |
| 87 | * however, it's conventional to do reads, especially for | 88 | return 0; |
| 88 | * reporting, without any locking whatsoever. | 89 | } |
| 89 | */ | ||
| 90 | if (dir->i_ino == PROC_ROOT_INO) /* check for safety... */ | ||
| 91 | dir->i_nlink = proc_root.nlink + nr_threads; | ||
| 92 | 90 | ||
| 91 | static struct dentry *proc_root_lookup(struct inode * dir, struct dentry * dentry, struct nameidata *nd) | ||
| 92 | { | ||
| 93 | if (!proc_lookup(dir, dentry, nd)) { | 93 | if (!proc_lookup(dir, dentry, nd)) { |
| 94 | return NULL; | 94 | return NULL; |
| 95 | } | 95 | } |
| @@ -134,6 +134,7 @@ static struct file_operations proc_root_operations = { | |||
| 134 | */ | 134 | */ |
| 135 | static struct inode_operations proc_root_inode_operations = { | 135 | static struct inode_operations proc_root_inode_operations = { |
| 136 | .lookup = proc_root_lookup, | 136 | .lookup = proc_root_lookup, |
| 137 | .getattr = proc_root_getattr, | ||
| 137 | }; | 138 | }; |
| 138 | 139 | ||
| 139 | /* | 140 | /* |
