mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pekka Enberg <penberg@cs.helsinki.fi>
To: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH mmotm 4/6] nilfs2: use unlocked_ioctl
Date: Tue, 17 Feb 2009 13:26:13 +0200	[thread overview]
Message-ID: <1234869973.21383.1.camel@penberg-laptop> (raw)
In-Reply-To: <1234856526-1947-5-git-send-email-konishi.ryusuke@lab.ntt.co.jp>

Hi Ryusuke,

On Tue, 2009-02-17 at 16:42 +0900, Ryusuke Konishi wrote:
> Pekka Enberg suggested converting ->ioctl operations to use
> ->unlocked_ioctl to avoid BKL.
> 
> The conversion was verified to be safe, so I will take it on this
> occasion.
> 
> Cc: Pekka Enberg <penberg@cs.helsinki.fi>
> Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
> ---
>  fs/nilfs2/dir.c   |    2 +-
>  fs/nilfs2/file.c  |    2 +-
>  fs/nilfs2/ioctl.c |    4 ++--
>  fs/nilfs2/nilfs.h |    2 +-
>  4 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/nilfs2/dir.c b/fs/nilfs2/dir.c
> index 393316c..54100ac 100644
> --- a/fs/nilfs2/dir.c
> +++ b/fs/nilfs2/dir.c
> @@ -702,7 +702,7 @@ struct file_operations nilfs_dir_operations = {
>  	.llseek		= generic_file_llseek,
>  	.read		= generic_read_dir,
>  	.readdir	= nilfs_readdir,
> -	.ioctl		= nilfs_ioctl,
> +	.unlocked_ioctl	= nilfs_ioctl,
>  #ifdef CONFIG_COMPAT
>  	.compat_ioctl	= nilfs_ioctl,
>  #endif	/* CONFIG_COMPAT */
> diff --git a/fs/nilfs2/file.c b/fs/nilfs2/file.c
> index 1670038..df74577 100644
> --- a/fs/nilfs2/file.c
> +++ b/fs/nilfs2/file.c
> @@ -138,7 +138,7 @@ struct file_operations nilfs_file_operations = {
>  	.write		= do_sync_write,
>  	.aio_read	= generic_file_aio_read,
>  	.aio_write	= generic_file_aio_write,
> -	.ioctl		= nilfs_ioctl,
> +	.unlocked_ioctl	= nilfs_ioctl,
>  #ifdef CONFIG_COMPAT
>  	.compat_ioctl	= nilfs_ioctl,
>  #endif	/* CONFIG_COMPAT */
> diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c
> index 33aff88..cfb2789 100644
> --- a/fs/nilfs2/ioctl.c
> +++ b/fs/nilfs2/ioctl.c
> @@ -600,9 +600,9 @@ static int nilfs_ioctl_sync(struct inode *inode, struct file *filp,
>  	return 0;
>  }
>  
> -int nilfs_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
> -		unsigned long arg)
> +long nilfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
>  {
> +	struct inode *inode = filp->f_dentry->d_inode;
>  	void __user *argp = (void * __user *)arg;
>  
>  	switch (cmd) {
> diff --git a/fs/nilfs2/nilfs.h b/fs/nilfs2/nilfs.h
> index ad17fa9..f865ecb 100644
> --- a/fs/nilfs2/nilfs.h
> +++ b/fs/nilfs2/nilfs.h
> @@ -242,7 +242,7 @@ extern void nilfs_set_link(struct inode *, struct nilfs_dir_entry *,
>  extern int nilfs_sync_file(struct file *, struct dentry *, int);
>  
>  /* ioctl.c */
> -int nilfs_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
> +long nilfs_ioctl(struct file *, unsigned int, unsigned long);
>  int nilfs_ioctl_prepare_clean_segments(struct the_nilfs *, void __user *);
>  
>  /* inode.c */

Maybe I'm looking at an old version of nilfs but don't you need to
remove nilfs_compat_locked_ioctl() and the lock_kernel()/unlock_kernel()
from nilfs_ioctl_timedwait() as well?

			Pekka


  reply	other threads:[~2009-02-17 11:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-17  7:42 [PATCH mmotm 0/6] nilfs2 ioctl cleanups (change ioctl API) Ryusuke Konishi
2009-02-17  7:42 ` [PATCH mmotm 1/6] nilfs2: remove timedwait ioctl command Ryusuke Konishi
2009-02-17  7:42 ` [PATCH mmotm 2/6] nilfs2: use fixed sized types for ioctl structures Ryusuke Konishi
2009-02-17  7:42 ` [PATCH mmotm 3/6] nilfs2: remove compat ioctl code Ryusuke Konishi
2009-02-17  7:42 ` [PATCH mmotm 4/6] nilfs2: use unlocked_ioctl Ryusuke Konishi
2009-02-17 11:26   ` Pekka Enberg [this message]
2009-02-17 15:43     ` Ryusuke Konishi
2009-02-17 15:49       ` Pekka Enberg
2009-02-17  7:42 ` [PATCH mmotm 5/6] nilfs2: extend nilfs_sustat ioctl struct Ryusuke Konishi
2009-02-17  7:42 ` [PATCH mmotm 6/6] nilfs2: replace BUG_ON and BUG calls triggerable from ioctl Ryusuke Konishi
2009-02-17 11:28   ` Pekka Enberg

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=1234869973.21383.1.camel@penberg-laptop \
    --to=penberg@cs.helsinki.fi \
    --cc=akpm@linux-foundation.org \
    --cc=konishi.ryusuke@lab.ntt.co.jp \
    --cc=linux-fsdevel@vger.kernel.org \
    --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 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®