* [PATCH] proc: fix single_open usage
@ 2010-12-07 4:21 bookjovi
2010-12-08 21:13 ` David Rientjes
2010-12-10 10:17 ` KOSAKI Motohiro
0 siblings, 2 replies; 3+ messages in thread
From: bookjovi @ 2010-12-07 4:21 UTC (permalink / raw)
To: akpm, viro, rientjes, hch, kosaki.motohiro, linux-kernel; +Cc: Jovi Zhang
fix some single_open function usage, use private_data as parameter
Signed-off-by: Jovi Zhang <bookjovi@gmail.com>
fs/proc/base.c | 29 +++--------------------------
1 files changed, 3 insertions(+), 26 deletions(-)
diff --git a/fs/proc/base.c b/fs/proc/base.c
index f3d02ca..74a7d92 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -751,14 +751,7 @@ static int proc_single_show(struct seq_file *m, void *v)
static int proc_single_open(struct inode *inode, struct file *filp)
{
- int ret;
- ret = single_open(filp, proc_single_show, NULL);
- if (!ret) {
- struct seq_file *m = filp->private_data;
-
- m->private = inode;
- }
- return ret;
+ return single_open(filp, proc_single_show, inode);
}
static const struct file_operations proc_single_file_operations = {
@@ -1386,15 +1379,7 @@ sched_write(struct file *file, const char __user *buf,
static int sched_open(struct inode *inode, struct file *filp)
{
- int ret;
-
- ret = single_open(filp, sched_show, NULL);
- if (!ret) {
- struct seq_file *m = filp->private_data;
-
- m->private = inode;
- }
- return ret;
+ return single_open(filp, sched_show, inode);
}
static const struct file_operations proc_pid_sched_operations = {
@@ -1454,15 +1439,7 @@ static int comm_show(struct seq_file *m, void *v)
static int comm_open(struct inode *inode, struct file *filp)
{
- int ret;
-
- ret = single_open(filp, comm_show, NULL);
- if (!ret) {
- struct seq_file *m = filp->private_data;
-
- m->private = inode;
- }
- return ret;
+ return single_open(filp, comm_show, inode);
}
static const struct file_operations proc_pid_set_comm_operations = {
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] proc: fix single_open usage
2010-12-07 4:21 [PATCH] proc: fix single_open usage bookjovi
@ 2010-12-08 21:13 ` David Rientjes
2010-12-10 10:17 ` KOSAKI Motohiro
1 sibling, 0 replies; 3+ messages in thread
From: David Rientjes @ 2010-12-08 21:13 UTC (permalink / raw)
To: Jovi Zhang
Cc: Andrew Morton, Al Viro, Christoph Hellwig, KOSAKI Motohiro, linux-kernel
On Mon, 6 Dec 2010, bookjovi@gmail.com wrote:
> fix some single_open function usage, use private_data as parameter
>
> Signed-off-by: Jovi Zhang <bookjovi@gmail.com>
Acked-by: David Rientjes <rientjes@google.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] proc: fix single_open usage
2010-12-07 4:21 [PATCH] proc: fix single_open usage bookjovi
2010-12-08 21:13 ` David Rientjes
@ 2010-12-10 10:17 ` KOSAKI Motohiro
1 sibling, 0 replies; 3+ messages in thread
From: KOSAKI Motohiro @ 2010-12-10 10:17 UTC (permalink / raw)
To: bookjovi; +Cc: kosaki.motohiro, akpm, viro, rientjes, hch, linux-kernel
> fix some single_open function usage, use private_data as parameter
>
> Signed-off-by: Jovi Zhang <bookjovi@gmail.com>
>
> fs/proc/base.c | 29 +++--------------------------
> 1 files changed, 3 insertions(+), 26 deletions(-)
Looks good to me.
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
>
> diff --git a/fs/proc/base.c b/fs/proc/base.c
> index f3d02ca..74a7d92 100644
> --- a/fs/proc/base.c
> +++ b/fs/proc/base.c
> @@ -751,14 +751,7 @@ static int proc_single_show(struct seq_file *m, void *v)
>
> static int proc_single_open(struct inode *inode, struct file *filp)
> {
> - int ret;
> - ret = single_open(filp, proc_single_show, NULL);
> - if (!ret) {
> - struct seq_file *m = filp->private_data;
> -
> - m->private = inode;
> - }
> - return ret;
> + return single_open(filp, proc_single_show, inode);
> }
>
> static const struct file_operations proc_single_file_operations = {
> @@ -1386,15 +1379,7 @@ sched_write(struct file *file, const char __user *buf,
>
> static int sched_open(struct inode *inode, struct file *filp)
> {
> - int ret;
> -
> - ret = single_open(filp, sched_show, NULL);
> - if (!ret) {
> - struct seq_file *m = filp->private_data;
> -
> - m->private = inode;
> - }
> - return ret;
> + return single_open(filp, sched_show, inode);
> }
>
> static const struct file_operations proc_pid_sched_operations = {
> @@ -1454,15 +1439,7 @@ static int comm_show(struct seq_file *m, void *v)
>
> static int comm_open(struct inode *inode, struct file *filp)
> {
> - int ret;
> -
> - ret = single_open(filp, comm_show, NULL);
> - if (!ret) {
> - struct seq_file *m = filp->private_data;
> -
> - m->private = inode;
> - }
> - return ret;
> + return single_open(filp, comm_show, inode);
> }
>
> static const struct file_operations proc_pid_set_comm_operations = {
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-12-10 10:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-07 4:21 [PATCH] proc: fix single_open usage bookjovi
2010-12-08 21:13 ` David Rientjes
2010-12-10 10:17 ` KOSAKI Motohiro
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®