From: Nathan Zimmer <nzimmer@sgi.com>
To: unlisted-recipients:; (no To-header on input)
Cc: akpm@linux-foundation.org, Nathan Zimmer <nzimmer@sgi.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Bill Pemberton <wfp5p@virginia.edu>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH linux-next] dgrp: staging: cleanup sparse warnings
Date: Wed, 13 Mar 2013 13:05:59 -0500 [thread overview]
Message-ID: <1363197959-22685-1-git-send-email-nzimmer@sgi.com> (raw)
In-Reply-To: <1361480226-13965-1-git-send-email-nzimmer@sgi.com>
A cleanup patch to remove sparse warnings caused by my other patch
"procfs: Improve Scaling in proc" since now proc_fops is protected by the rcu.
Signed-off-by: Nathan Zimmer <nzimmer@sgi.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Bill Pemberton <wfp5p@virginia.edu>
Cc: devel@driverdev.osuosl.org
Cc: linux-kernel@vger.kernel.org
---
drivers/staging/dgrp/dgrp_dpa_ops.c | 2 +-
drivers/staging/dgrp/dgrp_mon_ops.c | 2 +-
drivers/staging/dgrp/dgrp_net_ops.c | 2 +-
drivers/staging/dgrp/dgrp_ports_ops.c | 2 +-
drivers/staging/dgrp/dgrp_specproc.c | 6 ++++--
5 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/dgrp/dgrp_dpa_ops.c b/drivers/staging/dgrp/dgrp_dpa_ops.c
index 021cca4..67fb3d6 100644
--- a/drivers/staging/dgrp/dgrp_dpa_ops.c
+++ b/drivers/staging/dgrp/dgrp_dpa_ops.c
@@ -116,7 +116,7 @@ void dgrp_register_dpa_hook(struct proc_dir_entry *de)
struct nd_struct *node = de->data;
de->proc_iops = &dpa_inode_ops;
- de->proc_fops = &dpa_ops;
+ rcu_assign_pointer(de->proc_fops, &dpa_ops);
node->nd_dpa_de = de;
spin_lock_init(&node->nd_dpa_lock);
diff --git a/drivers/staging/dgrp/dgrp_mon_ops.c b/drivers/staging/dgrp/dgrp_mon_ops.c
index 4792d05..b484fcc 100644
--- a/drivers/staging/dgrp/dgrp_mon_ops.c
+++ b/drivers/staging/dgrp/dgrp_mon_ops.c
@@ -66,7 +66,7 @@ void dgrp_register_mon_hook(struct proc_dir_entry *de)
struct nd_struct *node = de->data;
de->proc_iops = &mon_inode_ops;
- de->proc_fops = &mon_ops;
+ rcu_assign_pointer(de->proc_fops, &mon_ops);
node->nd_mon_de = de;
sema_init(&node->nd_mon_semaphore, 1);
}
diff --git a/drivers/staging/dgrp/dgrp_net_ops.c b/drivers/staging/dgrp/dgrp_net_ops.c
index 2d1bbfd..7392578 100644
--- a/drivers/staging/dgrp/dgrp_net_ops.c
+++ b/drivers/staging/dgrp/dgrp_net_ops.c
@@ -90,7 +90,7 @@ void dgrp_register_net_hook(struct proc_dir_entry *de)
struct nd_struct *node = de->data;
de->proc_iops = &net_inode_ops;
- de->proc_fops = &net_ops;
+ rcu_assign_pointer(de->proc_fops, &net_ops);
node->nd_net_de = de;
sema_init(&node->nd_net_semaphore, 1);
node->nd_state = NS_CLOSED;
diff --git a/drivers/staging/dgrp/dgrp_ports_ops.c b/drivers/staging/dgrp/dgrp_ports_ops.c
index cd1fc20..f93dc1f 100644
--- a/drivers/staging/dgrp/dgrp_ports_ops.c
+++ b/drivers/staging/dgrp/dgrp_ports_ops.c
@@ -65,7 +65,7 @@ void dgrp_register_ports_hook(struct proc_dir_entry *de)
struct nd_struct *node = de->data;
de->proc_iops = &ports_inode_ops;
- de->proc_fops = &ports_ops;
+ rcu_assign_pointer(de->proc_fops, &ports_ops);
node->nd_ports_de = de;
}
diff --git a/drivers/staging/dgrp/dgrp_specproc.c b/drivers/staging/dgrp/dgrp_specproc.c
index c214078..51b2153 100644
--- a/drivers/staging/dgrp/dgrp_specproc.c
+++ b/drivers/staging/dgrp/dgrp_specproc.c
@@ -268,9 +268,11 @@ static void register_proc_table(struct dgrp_proc_entry *table,
if (!table->child) {
de->proc_iops = &proc_inode_ops;
if (table->proc_file_ops)
- de->proc_fops = table->proc_file_ops;
+ rcu_assign_pointer(de->proc_fops,
+ table->proc_file_ops);
else
- de->proc_fops = &dgrp_proc_file_ops;
+ rcu_assign_pointer(de->proc_fops,
+ &dgrp_proc_file_ops);
}
}
table->de = de;
--
1.8.1.2
prev parent reply other threads:[~2013-03-13 18:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-21 20:57 [PATCH v4] procfs: Improve Scaling in proc Nathan Zimmer
2013-03-04 19:49 ` [PATCH v5] " Nathan Zimmer
2013-03-13 18:05 ` Nathan Zimmer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1363197959-22685-1-git-send-email-nzimmer@sgi.com \
--to=nzimmer@sgi.com \
--cc=akpm@linux-foundation.org \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wfp5p@virginia.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®