X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=fs%2Fproc%2Fproc_sysctl.c;h=614c34b6d1c22214ffcdeb46a5f9e9eb63d69678;hb=6f157c1d268d5888ca44c589dccd01729c4172f6;hp=20e8cbb34364e0b18106c690c65d91962c5d76c1;hpb=4559b438225b01942e1661759db0df55883b1bc0;p=linux-2.6-omap-h63xx.git diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 20e8cbb3436..614c34b6d1c 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -9,7 +9,7 @@ static struct dentry_operations proc_sys_dentry_operations; static const struct file_operations proc_sys_file_operations; -static struct inode_operations proc_sys_inode_operations; +static const struct inode_operations proc_sys_inode_operations; static void proc_sys_refresh_inode(struct inode *inode, struct ctl_table *table) { @@ -171,7 +171,8 @@ static ssize_t proc_sys_read(struct file *filp, char __user *buf, struct dentry *dentry = filp->f_dentry; struct ctl_table_header *head; struct ctl_table *table; - ssize_t error, res; + ssize_t error; + size_t res; table = do_proc_sys_lookup(dentry->d_parent, &dentry->d_name, &head); /* Has the sysctl entry disappeared on us? */ @@ -209,7 +210,8 @@ static ssize_t proc_sys_write(struct file *filp, const char __user *buf, struct dentry *dentry = filp->f_dentry; struct ctl_table_header *head; struct ctl_table *table; - ssize_t error, res; + ssize_t error; + size_t res; table = do_proc_sys_lookup(dentry->d_parent, &dentry->d_name, &head); /* Has the sysctl entry disappeared on us? */ @@ -405,7 +407,7 @@ static int proc_sys_permission(struct inode *inode, int mask, struct nameidata * if (!nd || !depth) goto out; - dentry = nd->dentry; + dentry = nd->path.dentry; table = do_proc_sys_lookup(dentry->d_parent, &dentry->d_name, &head); /* If the entry does not exist deny permission */ @@ -429,11 +431,8 @@ static int proc_sys_setattr(struct dentry *dentry, struct iattr *attr) return -EPERM; error = inode_change_ok(inode, attr); - if (!error) { - error = security_inode_setattr(dentry, attr); - if (!error) - error = inode_setattr(inode, attr); - } + if (!error) + error = inode_setattr(inode, attr); return error; } @@ -447,7 +446,7 @@ static const struct file_operations proc_sys_file_operations = { .readdir = proc_sys_readdir, }; -static struct inode_operations proc_sys_inode_operations = { +static const struct inode_operations proc_sys_inode_operations = { .lookup = proc_sys_lookup, .permission = proc_sys_permission, .setattr = proc_sys_setattr,