From a4d3cd584bccec696d3296fcfe6aa8f1b78955aa Mon Sep 17 00:00:00 2001 From: Naga Chumbalkar Date: Wed, 9 Mar 2011 14:02:49 +0000 Subject: [PATCH] --- yaml --- r: 234002 b: refs/heads/master c: 1f858ef2fbabdc5e645644010a31a40c32e397c9 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c | 2 +- trunk/drivers/mmc/core/core.c | 2 +- trunk/fs/namei.c | 14 +++----------- trunk/fs/proc/inode.c | 8 ++------ trunk/fs/proc/proc_sysctl.c | 7 ++----- trunk/include/linux/sysctl.h | 14 ++++---------- trunk/kernel/sysctl.c | 15 +++++---------- 8 files changed, 19 insertions(+), 45 deletions(-) diff --git a/[refs] b/[refs] index c268b6b138ad..4f35f25cafe5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 687530b44de7e0fe70fabb4200d4cabce3af1a0c +refs/heads/master: 1f858ef2fbabdc5e645644010a31a40c32e397c9 diff --git a/trunk/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c b/trunk/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c index 4f6f679f2799..4a5a42b842ad 100644 --- a/trunk/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c +++ b/trunk/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c @@ -195,7 +195,7 @@ static unsigned int pcc_get_freq(unsigned int cpu) cmd_incomplete: iowrite16(0, &pcch_hdr->status); spin_unlock(&pcc_lock); - return -EINVAL; + return 0; } static int pcc_cpufreq_target(struct cpufreq_policy *policy, diff --git a/trunk/drivers/mmc/core/core.c b/trunk/drivers/mmc/core/core.c index 150b5f3cd401..6625c057be05 100644 --- a/trunk/drivers/mmc/core/core.c +++ b/trunk/drivers/mmc/core/core.c @@ -1529,7 +1529,7 @@ void mmc_rescan(struct work_struct *work) * still present */ if (host->bus_ops && host->bus_ops->detect && !host->bus_dead - && !(host->caps & MMC_CAP_NONREMOVABLE)) + && mmc_card_is_removable(host)) host->bus_ops->detect(host); /* diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index a4689eb2df28..0087cf9c2c6b 100644 --- a/trunk/fs/namei.c +++ b/trunk/fs/namei.c @@ -1546,7 +1546,6 @@ static int path_walk(const char *name, struct nameidata *nd) /* nd->path had been dropped */ current->total_link_count = 0; nd->path = save; - nd->inode = save.dentry->d_inode; path_get(&nd->path); nd->flags |= LOOKUP_REVAL; result = link_path_walk(name, nd); @@ -2456,29 +2455,22 @@ struct file *do_filp_open(int dfd, const char *pathname, /* !O_CREAT, simple open */ error = do_path_lookup(dfd, pathname, flags, &nd); if (unlikely(error)) - goto out_filp2; + goto out_filp; error = -ELOOP; if (!(nd.flags & LOOKUP_FOLLOW)) { if (nd.inode->i_op->follow_link) - goto out_path2; + goto out_path; } error = -ENOTDIR; if (nd.flags & LOOKUP_DIRECTORY) { if (!nd.inode->i_op->lookup) - goto out_path2; + goto out_path; } audit_inode(pathname, nd.path.dentry); filp = finish_open(&nd, open_flag, acc_mode); -out2: release_open_intent(&nd); return filp; -out_path2: - path_put(&nd.path); -out_filp2: - filp = ERR_PTR(error); - goto out2; - creat: /* OK, have to create the file. Find the parent. */ error = path_init_rcu(dfd, pathname, diff --git a/trunk/fs/proc/inode.c b/trunk/fs/proc/inode.c index d6a7ca1fdac5..176ce4cda68a 100644 --- a/trunk/fs/proc/inode.c +++ b/trunk/fs/proc/inode.c @@ -27,7 +27,6 @@ static void proc_evict_inode(struct inode *inode) { struct proc_dir_entry *de; - struct ctl_table_header *head; truncate_inode_pages(&inode->i_data, 0); end_writeback(inode); @@ -39,11 +38,8 @@ static void proc_evict_inode(struct inode *inode) de = PROC_I(inode)->pde; if (de) pde_put(de); - head = PROC_I(inode)->sysctl; - if (head) { - rcu_assign_pointer(PROC_I(inode)->sysctl, NULL); - sysctl_head_put(head); - } + if (PROC_I(inode)->sysctl) + sysctl_head_put(PROC_I(inode)->sysctl); } struct vfsmount *proc_mnt; diff --git a/trunk/fs/proc/proc_sysctl.c b/trunk/fs/proc/proc_sysctl.c index 8eb2522111c5..09a1f92a34ef 100644 --- a/trunk/fs/proc/proc_sysctl.c +++ b/trunk/fs/proc/proc_sysctl.c @@ -408,18 +408,15 @@ static int proc_sys_compare(const struct dentry *parent, const struct dentry *dentry, const struct inode *inode, unsigned int len, const char *str, const struct qstr *name) { - struct ctl_table_header *head; /* Although proc doesn't have negative dentries, rcu-walk means * that inode here can be NULL */ - /* AV: can it, indeed? */ if (!inode) - return 1; + return 0; if (name->len != len) return 1; if (memcmp(name->name, str, len)) return 1; - head = rcu_dereference(PROC_I(inode)->sysctl); - return !head || !sysctl_is_seen(head); + return !sysctl_is_seen(PROC_I(inode)->sysctl); } static const struct dentry_operations proc_sys_dentry_operations = { diff --git a/trunk/include/linux/sysctl.h b/trunk/include/linux/sysctl.h index bb7c2b086fa4..7bb5cb64f3b8 100644 --- a/trunk/include/linux/sysctl.h +++ b/trunk/include/linux/sysctl.h @@ -25,7 +25,6 @@ #include #include #include -#include struct completion; @@ -1038,15 +1037,10 @@ struct ctl_table_root { struct ctl_table trees. */ struct ctl_table_header { - union { - struct { - struct ctl_table *ctl_table; - struct list_head ctl_entry; - int used; - int count; - }; - struct rcu_head rcu; - }; + struct ctl_table *ctl_table; + struct list_head ctl_entry; + int used; + int count; struct completion *unregistering; struct ctl_table *ctl_table_arg; struct ctl_table_root *root; diff --git a/trunk/kernel/sysctl.c b/trunk/kernel/sysctl.c index 4eed0af5d144..0f1bd83db985 100644 --- a/trunk/kernel/sysctl.c +++ b/trunk/kernel/sysctl.c @@ -194,9 +194,9 @@ static int sysrq_sysctl_handler(ctl_table *table, int write, static struct ctl_table root_table[]; static struct ctl_table_root sysctl_table_root; static struct ctl_table_header root_table_header = { - {{.count = 1, + .count = 1, .ctl_table = root_table, - .ctl_entry = LIST_HEAD_INIT(sysctl_table_root.default_set.list),}}, + .ctl_entry = LIST_HEAD_INIT(sysctl_table_root.default_set.list), .root = &sysctl_table_root, .set = &sysctl_table_root.default_set, }; @@ -1567,16 +1567,11 @@ void sysctl_head_get(struct ctl_table_header *head) spin_unlock(&sysctl_lock); } -static void free_head(struct rcu_head *rcu) -{ - kfree(container_of(rcu, struct ctl_table_header, rcu)); -} - void sysctl_head_put(struct ctl_table_header *head) { spin_lock(&sysctl_lock); if (!--head->count) - call_rcu(&head->rcu, free_head); + kfree(head); spin_unlock(&sysctl_lock); } @@ -1953,10 +1948,10 @@ void unregister_sysctl_table(struct ctl_table_header * header) start_unregistering(header); if (!--header->parent->count) { WARN_ON(1); - call_rcu(&header->parent->rcu, free_head); + kfree(header->parent); } if (!--header->count) - call_rcu(&header->rcu, free_head); + kfree(header); spin_unlock(&sysctl_lock); }