Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
[cascardo/linux.git] / fs / proc / proc_sysctl.c
index b59db94..2ed3d71 100644 (file)
@@ -430,6 +430,7 @@ static int sysctl_perm(struct ctl_table_header *head, struct ctl_table *table, i
 static struct inode *proc_sys_make_inode(struct super_block *sb,
                struct ctl_table_header *head, struct ctl_table *table)
 {
+       struct ctl_table_root *root = head->root;
        struct inode *inode;
        struct proc_inode *ei;
 
@@ -457,6 +458,10 @@ static struct inode *proc_sys_make_inode(struct super_block *sb,
                if (is_empty_dir(head))
                        make_empty_dir_inode(inode);
        }
+
+       if (root->set_ownership)
+               root->set_ownership(head, table, &inode->i_uid, &inode->i_gid);
+
 out:
        return inode;
 }
@@ -474,7 +479,7 @@ static struct dentry *proc_sys_lookup(struct inode *dir, struct dentry *dentry,
 {
        struct ctl_table_header *head = grab_header(dir);
        struct ctl_table_header *h = NULL;
-       struct qstr *name = &dentry->d_name;
+       const struct qstr *name = &dentry->d_name;
        struct ctl_table *p;
        struct inode *inode;
        struct dentry *err = ERR_PTR(-ENOENT);
@@ -834,7 +839,7 @@ static int sysctl_is_seen(struct ctl_table_header *p)
        return res;
 }
 
-static int proc_sys_compare(const struct dentry *parent, const struct dentry *dentry,
+static int proc_sys_compare(const struct dentry *dentry,
                unsigned int len, const char *str, const struct qstr *name)
 {
        struct ctl_table_header *head;