]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - fs/proc/root.c
IB/mthca: Fix SRQ limit event range check
[mv-sheeva.git] / fs / proc / root.c
index 68896283c8ae54d79f1e87277322aa2ce83846bc..8901c65caca83be55d575ea70d51411435d5410e 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/time.h>
 #include <linux/proc_fs.h>
 #include <linux/stat.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/bitops.h>
@@ -26,10 +25,10 @@ struct proc_dir_entry *proc_net, *proc_net_stat, *proc_bus, *proc_root_fs, *proc
 struct proc_dir_entry *proc_sys_root;
 #endif
 
-static struct super_block *proc_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+static int proc_get_sb(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
 {
-       return get_sb_single(fs_type, flags, data, proc_fill_super);
+       return get_sb_single(fs_type, flags, data, proc_fill_super, mnt);
 }
 
 static struct file_system_type proc_fs_type = {
@@ -80,16 +79,16 @@ void __init proc_root_init(void)
        proc_bus = proc_mkdir("bus", NULL);
 }
 
-static struct dentry *proc_root_lookup(struct inode * dir, struct dentry * dentry, struct nameidata *nd)
+static int proc_root_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat
+)
 {
-       /*
-        * nr_threads is actually protected by the tasklist_lock;
-        * however, it's conventional to do reads, especially for
-        * reporting, without any locking whatsoever.
-        */
-       if (dir->i_ino == PROC_ROOT_INO) /* check for safety... */
-               dir->i_nlink = proc_root.nlink + nr_threads;
+       generic_fillattr(dentry->d_inode, stat);
+       stat->nlink = proc_root.nlink + nr_processes();
+       return 0;
+}
 
+static struct dentry *proc_root_lookup(struct inode * dir, struct dentry * dentry, struct nameidata *nd)
+{
        if (!proc_lookup(dir, dentry, nd)) {
                return NULL;
        }
@@ -134,6 +133,7 @@ static struct file_operations proc_root_operations = {
  */
 static struct inode_operations proc_root_inode_operations = {
        .lookup         = proc_root_lookup,
+       .getattr        = proc_root_getattr,
 };
 
 /*