All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 12/31] proc: move rest of /proc/locks to fs/locks.c
Date: Sun, 19 Oct 2008 21:31:33 -0400	[thread overview]
Message-ID: <20081020013133.GA12741@fieldses.org> (raw)
In-Reply-To: <20081017124540.GM22653@x200.localdomain>

Thanks.  Looks like good clean up to me; I've queued it up for 2.6.29.

--b.

On Fri, Oct 17, 2008 at 04:45:40PM +0400, Alexey Dobriyan wrote:
> 
> >From 09a3878c4ba92dc906e6573245fb18bef5d760ff Mon Sep 17 00:00:00 2001
> From: Alexey Dobriyan <adobriyan@gmail.com>
> Date: Sat, 4 Oct 2008 22:34:18 +0400
> Subject: [PATCH 12/31] proc: move rest of /proc/locks to fs/locks.c
> 
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> ---
>  fs/locks.c          |   22 +++++++++++++++++++++-
>  fs/proc/proc_misc.c |   17 -----------------
>  include/linux/fs.h  |    1 -
>  3 files changed, 21 insertions(+), 19 deletions(-)
> 
> diff --git a/fs/locks.c b/fs/locks.c
> index 5eb259e..90e87f5 100644
> --- a/fs/locks.c
> +++ b/fs/locks.c
> @@ -2078,6 +2078,7 @@ int vfs_cancel_lock(struct file *filp, struct file_lock *fl)
>  EXPORT_SYMBOL_GPL(vfs_cancel_lock);
>  
>  #ifdef CONFIG_PROC_FS
> +#include <linux/proc_fs.h>
>  #include <linux/seq_file.h>
>  
>  static void lock_get_status(struct seq_file *f, struct file_lock *fl,
> @@ -2183,12 +2184,31 @@ static void locks_stop(struct seq_file *f, void *v)
>  	unlock_kernel();
>  }
>  
> -struct seq_operations locks_seq_operations = {
> +static const struct seq_operations locks_seq_operations = {
>  	.start	= locks_start,
>  	.next	= locks_next,
>  	.stop	= locks_stop,
>  	.show	= locks_show,
>  };
> +
> +static int locks_open(struct inode *inode, struct file *filp)
> +{
> +	return seq_open(filp, &locks_seq_operations);
> +}
> +
> +static const struct file_operations proc_locks_operations = {
> +	.open		= locks_open,
> +	.read		= seq_read,
> +	.llseek		= seq_lseek,
> +	.release	= seq_release,
> +};
> +
> +static int __init proc_locks_init(void)
> +{
> +	proc_create("locks", 0, NULL, &proc_locks_operations);
> +	return 0;
> +}
> +module_init(proc_locks_init);
>  #endif
>  
>  /**
> diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
> index 8ae7d38..19cf7a0 100644
> --- a/fs/proc/proc_misc.c
> +++ b/fs/proc/proc_misc.c
> @@ -455,20 +455,6 @@ static const struct file_operations proc_interrupts_operations = {
>  	.release	= seq_release,
>  };
>  
> -#ifdef CONFIG_FILE_LOCKING
> -static int locks_open(struct inode *inode, struct file *filp)
> -{
> -	return seq_open(filp, &locks_seq_operations);
> -}
> -
> -static const struct file_operations proc_locks_operations = {
> -	.open		= locks_open,
> -	.read		= seq_read,
> -	.llseek		= seq_lseek,
> -	.release	= seq_release,
> -};
> -#endif /* CONFIG_FILE_LOCKING */
> -
>  #ifdef CONFIG_PROC_PAGE_MONITOR
>  #define KPMSIZE sizeof(u64)
>  #define KPMMASK (KPMSIZE - 1)
> @@ -607,9 +593,6 @@ void __init proc_misc_init(void)
>  	proc_symlink("mounts", NULL, "self/mounts");
>  
>  	/* And now for trickier ones */
> -#ifdef CONFIG_FILE_LOCKING
> -	proc_create("locks", 0, NULL, &proc_locks_operations);
> -#endif
>  	proc_create("devices", 0, NULL, &proc_devinfo_operations);
>  	proc_create("cpuinfo", 0, NULL, &proc_cpuinfo_operations);
>  #ifdef CONFIG_BLOCK
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index a6a625b..0240495 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -1037,7 +1037,6 @@ extern int vfs_setlease(struct file *, long, struct file_lock **);
>  extern int lease_modify(struct file_lock **, int);
>  extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
>  extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
> -extern struct seq_operations locks_seq_operations;
>  #else /* !CONFIG_FILE_LOCKING */
>  #define fcntl_getlk(a, b) ({ -EINVAL; })
>  #define fcntl_setlk(a, b, c, d) ({ -EACCES; })
> -- 
> 1.5.6.5
> 

      reply	other threads:[~2008-10-20  1:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-17 12:45 [PATCH 12/31] proc: move rest of /proc/locks to fs/locks.c Alexey Dobriyan
2008-10-20  1:31 ` J. Bruce Fields [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=20081020013133.GA12741@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=adobriyan@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.