Re: [PATCH v5 4/7] fs/fuse: support compiling out splice

2014-11-25 Thread Pieter Smith
On Tue, Nov 25, 2014 at 12:49:16PM -0800, j...@joshtriplett.org wrote:
> On Tue, Nov 25, 2014 at 08:42:42PM +0100, Pieter Smith wrote:
> > On Tue, Nov 25, 2014 at 03:17:13PM +0100, Miklos Szeredi wrote:
> > > [Trimming CC.  Please do the same for other patches.  I for one am not
> > > interested in the general tinification discussion]
> > > 
> > > On Tue, Nov 25, 2014 at 08:19:39AM +0100, Pieter Smith wrote:
> > > > To implement splice support, fs/fuse makes use of nosteal_pipe_buf_ops. 
> > > > This
> > > > struct is exported by fs/splice. The goal of the larger patch set is to
> > > > completely compile out fs/splice, so uses of the exported struct need 
> > > > to be
> > > > compiled out along with fs/splice.
> > > > 
> > > > This patch therefore compiles out splice support in fs/fuse when
> > > > CONFIG_SYSCALL_SPLICE is undefined.
> > > > 
> > > > Signed-off-by: Pieter Smith 
> > > > ---
> > > >  fs/fuse/dev.c | 9 +++--
> > > >  1 file changed, 7 insertions(+), 2 deletions(-)
> > > > 
> > > > diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
> > > > index ca88731..e984302 100644
> > > > --- a/fs/fuse/dev.c
> > > > +++ b/fs/fuse/dev.c
> > > > @@ -1191,8 +1191,9 @@ __releases(fc->lock)
> > > >   * request_end().  Otherwise add it to the processing list, and set
> > > >   * the 'sent' flag.
> > > >   */
> > > > -static ssize_t fuse_dev_do_read(struct fuse_conn *fc, struct file 
> > > > *file,
> > > > -   struct fuse_copy_state *cs, size_t 
> > > > nbytes)
> > > > +static ssize_t __maybe_unused
> > > > +fuse_dev_do_read(struct fuse_conn *fc, struct file *file,
> > > > +struct fuse_copy_state *cs, size_t nbytes)
> > > 
> > > fuse_dev_do_read() is definitely going to remain used.  So no point in 
> > > adding
> > > __maybe_unused.
> > 
> > Off course, but at least gcc now also is aware that this is intentional and
> > nicely refrains from nagging you with a warning.
> 
> GCC shouldn't be warning about an unused fuse_dev_do_read; please
> recheck.  It will always get used by fuse_dev_read, which
> unconditionally gets used in the .aio_read field of fuse_dev_operations.
> 
> - Josh Triplett

Thanks for pointing this out. I was too hasty in my response.

- Pieter Smith
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v5 4/7] fs/fuse: support compiling out splice

2014-11-25 Thread Pieter Smith
On Tue, Nov 25, 2014 at 08:42:42PM +0100, Pieter Smith wrote:
> On Tue, Nov 25, 2014 at 03:17:13PM +0100, Miklos Szeredi wrote:
> > [Trimming CC.  Please do the same for other patches.  I for one am not
> > interested in the general tinification discussion]
> > 
> > On Tue, Nov 25, 2014 at 08:19:39AM +0100, Pieter Smith wrote:
> > > To implement splice support, fs/fuse makes use of nosteal_pipe_buf_ops. 
> > > This
> > > struct is exported by fs/splice. The goal of the larger patch set is to
> > > completely compile out fs/splice, so uses of the exported struct need to 
> > > be
> > > compiled out along with fs/splice.
> > > 
> > > This patch therefore compiles out splice support in fs/fuse when
> > > CONFIG_SYSCALL_SPLICE is undefined.
> > > 
> > > Signed-off-by: Pieter Smith 
> > > ---
> > >  fs/fuse/dev.c | 9 +++--
> > >  1 file changed, 7 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
> > > index ca88731..e984302 100644
> > > --- a/fs/fuse/dev.c
> > > +++ b/fs/fuse/dev.c
> > > @@ -1191,8 +1191,9 @@ __releases(fc->lock)
> > >   * request_end().  Otherwise add it to the processing list, and set
> > >   * the 'sent' flag.
> > >   */
> > > -static ssize_t fuse_dev_do_read(struct fuse_conn *fc, struct file *file,
> > > - struct fuse_copy_state *cs, size_t nbytes)
> > > +static ssize_t __maybe_unused
> > > +fuse_dev_do_read(struct fuse_conn *fc, struct file *file,
> > > +  struct fuse_copy_state *cs, size_t nbytes)
> > 
> > fuse_dev_do_read() is definitely going to remain used.  So no point in 
> > adding
> > __maybe_unused.
> 
> Off course, but at least gcc now also is aware that this is intentional and
> nicely refrains from nagging you with a warning.
> 
My apologies. My response was too hasty. You are right. This should not be
needed. I will revert this piece in v6 of this patch.
> > >  {
> > >   int err;
> > >   struct fuse_req *req;
> > > @@ -1291,6 +1292,7 @@ static ssize_t fuse_dev_read(struct kiocb *iocb, 
> > > const struct iovec *iov,
> > >   return fuse_dev_do_read(fc, file, , iov_length(iov, nr_segs));
> > >  }
> > >  
> > > +#ifdef CONFIG_SYSCALL_SPLICE
> > >  static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos,
> > >   struct pipe_inode_info *pipe,
> > >   size_t len, unsigned int flags)
> > > @@ -1368,6 +1370,9 @@ out:
> > >   kfree(bufs);
> > >   return ret;
> > >  }
> > > +#else /* CONFIG_SYSCALL_SPLICE */
> > > +#define fuse_dev_splice_read NULL
> > > +#endif
> > 
> > This looks fine.
> > 
> > Thanks,
> > Miklos
> > 
> > >  
> > >  static int fuse_notify_poll(struct fuse_conn *fc, unsigned int size,
> > >   struct fuse_copy_state *cs)
> > > -- 
> > > 2.1.0
> > > 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v5 4/7] fs/fuse: support compiling out splice

2014-11-25 Thread josh
On Tue, Nov 25, 2014 at 08:42:42PM +0100, Pieter Smith wrote:
> On Tue, Nov 25, 2014 at 03:17:13PM +0100, Miklos Szeredi wrote:
> > [Trimming CC.  Please do the same for other patches.  I for one am not
> > interested in the general tinification discussion]
> > 
> > On Tue, Nov 25, 2014 at 08:19:39AM +0100, Pieter Smith wrote:
> > > To implement splice support, fs/fuse makes use of nosteal_pipe_buf_ops. 
> > > This
> > > struct is exported by fs/splice. The goal of the larger patch set is to
> > > completely compile out fs/splice, so uses of the exported struct need to 
> > > be
> > > compiled out along with fs/splice.
> > > 
> > > This patch therefore compiles out splice support in fs/fuse when
> > > CONFIG_SYSCALL_SPLICE is undefined.
> > > 
> > > Signed-off-by: Pieter Smith 
> > > ---
> > >  fs/fuse/dev.c | 9 +++--
> > >  1 file changed, 7 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
> > > index ca88731..e984302 100644
> > > --- a/fs/fuse/dev.c
> > > +++ b/fs/fuse/dev.c
> > > @@ -1191,8 +1191,9 @@ __releases(fc->lock)
> > >   * request_end().  Otherwise add it to the processing list, and set
> > >   * the 'sent' flag.
> > >   */
> > > -static ssize_t fuse_dev_do_read(struct fuse_conn *fc, struct file *file,
> > > - struct fuse_copy_state *cs, size_t nbytes)
> > > +static ssize_t __maybe_unused
> > > +fuse_dev_do_read(struct fuse_conn *fc, struct file *file,
> > > +  struct fuse_copy_state *cs, size_t nbytes)
> > 
> > fuse_dev_do_read() is definitely going to remain used.  So no point in 
> > adding
> > __maybe_unused.
> 
> Off course, but at least gcc now also is aware that this is intentional and
> nicely refrains from nagging you with a warning.

GCC shouldn't be warning about an unused fuse_dev_do_read; please
recheck.  It will always get used by fuse_dev_read, which
unconditionally gets used in the .aio_read field of fuse_dev_operations.

- Josh Triplett
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v5 4/7] fs/fuse: support compiling out splice

2014-11-25 Thread Pieter Smith
On Tue, Nov 25, 2014 at 03:17:13PM +0100, Miklos Szeredi wrote:
> [Trimming CC.  Please do the same for other patches.  I for one am not
> interested in the general tinification discussion]
> 
> On Tue, Nov 25, 2014 at 08:19:39AM +0100, Pieter Smith wrote:
> > To implement splice support, fs/fuse makes use of nosteal_pipe_buf_ops. This
> > struct is exported by fs/splice. The goal of the larger patch set is to
> > completely compile out fs/splice, so uses of the exported struct need to be
> > compiled out along with fs/splice.
> > 
> > This patch therefore compiles out splice support in fs/fuse when
> > CONFIG_SYSCALL_SPLICE is undefined.
> > 
> > Signed-off-by: Pieter Smith 
> > ---
> >  fs/fuse/dev.c | 9 +++--
> >  1 file changed, 7 insertions(+), 2 deletions(-)
> > 
> > diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
> > index ca88731..e984302 100644
> > --- a/fs/fuse/dev.c
> > +++ b/fs/fuse/dev.c
> > @@ -1191,8 +1191,9 @@ __releases(fc->lock)
> >   * request_end().  Otherwise add it to the processing list, and set
> >   * the 'sent' flag.
> >   */
> > -static ssize_t fuse_dev_do_read(struct fuse_conn *fc, struct file *file,
> > -   struct fuse_copy_state *cs, size_t nbytes)
> > +static ssize_t __maybe_unused
> > +fuse_dev_do_read(struct fuse_conn *fc, struct file *file,
> > +struct fuse_copy_state *cs, size_t nbytes)
> 
> fuse_dev_do_read() is definitely going to remain used.  So no point in adding
> __maybe_unused.

Off course, but at least gcc now also is aware that this is intentional and
nicely refrains from nagging you with a warning.

> >  {
> > int err;
> > struct fuse_req *req;
> > @@ -1291,6 +1292,7 @@ static ssize_t fuse_dev_read(struct kiocb *iocb, 
> > const struct iovec *iov,
> > return fuse_dev_do_read(fc, file, , iov_length(iov, nr_segs));
> >  }
> >  
> > +#ifdef CONFIG_SYSCALL_SPLICE
> >  static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos,
> > struct pipe_inode_info *pipe,
> > size_t len, unsigned int flags)
> > @@ -1368,6 +1370,9 @@ out:
> > kfree(bufs);
> > return ret;
> >  }
> > +#else /* CONFIG_SYSCALL_SPLICE */
> > +#define fuse_dev_splice_read NULL
> > +#endif
> 
> This looks fine.
> 
> Thanks,
> Miklos
> 
> >  
> >  static int fuse_notify_poll(struct fuse_conn *fc, unsigned int size,
> > struct fuse_copy_state *cs)
> > -- 
> > 2.1.0
> > 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v5 4/7] fs/fuse: support compiling out splice

2014-11-25 Thread Miklos Szeredi
[Trimming CC.  Please do the same for other patches.  I for one am not
interested in the general tinification discussion]

On Tue, Nov 25, 2014 at 08:19:39AM +0100, Pieter Smith wrote:
> To implement splice support, fs/fuse makes use of nosteal_pipe_buf_ops. This
> struct is exported by fs/splice. The goal of the larger patch set is to
> completely compile out fs/splice, so uses of the exported struct need to be
> compiled out along with fs/splice.
> 
> This patch therefore compiles out splice support in fs/fuse when
> CONFIG_SYSCALL_SPLICE is undefined.
> 
> Signed-off-by: Pieter Smith 
> ---
>  fs/fuse/dev.c | 9 +++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
> index ca88731..e984302 100644
> --- a/fs/fuse/dev.c
> +++ b/fs/fuse/dev.c
> @@ -1191,8 +1191,9 @@ __releases(fc->lock)
>   * request_end().  Otherwise add it to the processing list, and set
>   * the 'sent' flag.
>   */
> -static ssize_t fuse_dev_do_read(struct fuse_conn *fc, struct file *file,
> - struct fuse_copy_state *cs, size_t nbytes)
> +static ssize_t __maybe_unused
> +fuse_dev_do_read(struct fuse_conn *fc, struct file *file,
> +  struct fuse_copy_state *cs, size_t nbytes)

fuse_dev_do_read() is definitely going to remain used.  So no point in adding
__maybe_unused.

>  {
>   int err;
>   struct fuse_req *req;
> @@ -1291,6 +1292,7 @@ static ssize_t fuse_dev_read(struct kiocb *iocb, const 
> struct iovec *iov,
>   return fuse_dev_do_read(fc, file, , iov_length(iov, nr_segs));
>  }
>  
> +#ifdef CONFIG_SYSCALL_SPLICE
>  static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos,
>   struct pipe_inode_info *pipe,
>   size_t len, unsigned int flags)
> @@ -1368,6 +1370,9 @@ out:
>   kfree(bufs);
>   return ret;
>  }
> +#else /* CONFIG_SYSCALL_SPLICE */
> +#define fuse_dev_splice_read NULL
> +#endif

This looks fine.

Thanks,
Miklos

>  
>  static int fuse_notify_poll(struct fuse_conn *fc, unsigned int size,
>   struct fuse_copy_state *cs)
> -- 
> 2.1.0
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v5 4/7] fs/fuse: support compiling out splice

2014-11-25 Thread Miklos Szeredi
[Trimming CC.  Please do the same for other patches.  I for one am not
interested in the general tinification discussion]

On Tue, Nov 25, 2014 at 08:19:39AM +0100, Pieter Smith wrote:
 To implement splice support, fs/fuse makes use of nosteal_pipe_buf_ops. This
 struct is exported by fs/splice. The goal of the larger patch set is to
 completely compile out fs/splice, so uses of the exported struct need to be
 compiled out along with fs/splice.
 
 This patch therefore compiles out splice support in fs/fuse when
 CONFIG_SYSCALL_SPLICE is undefined.
 
 Signed-off-by: Pieter Smith pie...@boesman.nl
 ---
  fs/fuse/dev.c | 9 +++--
  1 file changed, 7 insertions(+), 2 deletions(-)
 
 diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
 index ca88731..e984302 100644
 --- a/fs/fuse/dev.c
 +++ b/fs/fuse/dev.c
 @@ -1191,8 +1191,9 @@ __releases(fc-lock)
   * request_end().  Otherwise add it to the processing list, and set
   * the 'sent' flag.
   */
 -static ssize_t fuse_dev_do_read(struct fuse_conn *fc, struct file *file,
 - struct fuse_copy_state *cs, size_t nbytes)
 +static ssize_t __maybe_unused
 +fuse_dev_do_read(struct fuse_conn *fc, struct file *file,
 +  struct fuse_copy_state *cs, size_t nbytes)

fuse_dev_do_read() is definitely going to remain used.  So no point in adding
__maybe_unused.

  {
   int err;
   struct fuse_req *req;
 @@ -1291,6 +1292,7 @@ static ssize_t fuse_dev_read(struct kiocb *iocb, const 
 struct iovec *iov,
   return fuse_dev_do_read(fc, file, cs, iov_length(iov, nr_segs));
  }
  
 +#ifdef CONFIG_SYSCALL_SPLICE
  static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos,
   struct pipe_inode_info *pipe,
   size_t len, unsigned int flags)
 @@ -1368,6 +1370,9 @@ out:
   kfree(bufs);
   return ret;
  }
 +#else /* CONFIG_SYSCALL_SPLICE */
 +#define fuse_dev_splice_read NULL
 +#endif

This looks fine.

Thanks,
Miklos

  
  static int fuse_notify_poll(struct fuse_conn *fc, unsigned int size,
   struct fuse_copy_state *cs)
 -- 
 2.1.0
 
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v5 4/7] fs/fuse: support compiling out splice

2014-11-25 Thread Pieter Smith
On Tue, Nov 25, 2014 at 03:17:13PM +0100, Miklos Szeredi wrote:
 [Trimming CC.  Please do the same for other patches.  I for one am not
 interested in the general tinification discussion]
 
 On Tue, Nov 25, 2014 at 08:19:39AM +0100, Pieter Smith wrote:
  To implement splice support, fs/fuse makes use of nosteal_pipe_buf_ops. This
  struct is exported by fs/splice. The goal of the larger patch set is to
  completely compile out fs/splice, so uses of the exported struct need to be
  compiled out along with fs/splice.
  
  This patch therefore compiles out splice support in fs/fuse when
  CONFIG_SYSCALL_SPLICE is undefined.
  
  Signed-off-by: Pieter Smith pie...@boesman.nl
  ---
   fs/fuse/dev.c | 9 +++--
   1 file changed, 7 insertions(+), 2 deletions(-)
  
  diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
  index ca88731..e984302 100644
  --- a/fs/fuse/dev.c
  +++ b/fs/fuse/dev.c
  @@ -1191,8 +1191,9 @@ __releases(fc-lock)
* request_end().  Otherwise add it to the processing list, and set
* the 'sent' flag.
*/
  -static ssize_t fuse_dev_do_read(struct fuse_conn *fc, struct file *file,
  -   struct fuse_copy_state *cs, size_t nbytes)
  +static ssize_t __maybe_unused
  +fuse_dev_do_read(struct fuse_conn *fc, struct file *file,
  +struct fuse_copy_state *cs, size_t nbytes)
 
 fuse_dev_do_read() is definitely going to remain used.  So no point in adding
 __maybe_unused.

Off course, but at least gcc now also is aware that this is intentional and
nicely refrains from nagging you with a warning.

   {
  int err;
  struct fuse_req *req;
  @@ -1291,6 +1292,7 @@ static ssize_t fuse_dev_read(struct kiocb *iocb, 
  const struct iovec *iov,
  return fuse_dev_do_read(fc, file, cs, iov_length(iov, nr_segs));
   }
   
  +#ifdef CONFIG_SYSCALL_SPLICE
   static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos,
  struct pipe_inode_info *pipe,
  size_t len, unsigned int flags)
  @@ -1368,6 +1370,9 @@ out:
  kfree(bufs);
  return ret;
   }
  +#else /* CONFIG_SYSCALL_SPLICE */
  +#define fuse_dev_splice_read NULL
  +#endif
 
 This looks fine.
 
 Thanks,
 Miklos
 
   
   static int fuse_notify_poll(struct fuse_conn *fc, unsigned int size,
  struct fuse_copy_state *cs)
  -- 
  2.1.0
  
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v5 4/7] fs/fuse: support compiling out splice

2014-11-25 Thread josh
On Tue, Nov 25, 2014 at 08:42:42PM +0100, Pieter Smith wrote:
 On Tue, Nov 25, 2014 at 03:17:13PM +0100, Miklos Szeredi wrote:
  [Trimming CC.  Please do the same for other patches.  I for one am not
  interested in the general tinification discussion]
  
  On Tue, Nov 25, 2014 at 08:19:39AM +0100, Pieter Smith wrote:
   To implement splice support, fs/fuse makes use of nosteal_pipe_buf_ops. 
   This
   struct is exported by fs/splice. The goal of the larger patch set is to
   completely compile out fs/splice, so uses of the exported struct need to 
   be
   compiled out along with fs/splice.
   
   This patch therefore compiles out splice support in fs/fuse when
   CONFIG_SYSCALL_SPLICE is undefined.
   
   Signed-off-by: Pieter Smith pie...@boesman.nl
   ---
fs/fuse/dev.c | 9 +++--
1 file changed, 7 insertions(+), 2 deletions(-)
   
   diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
   index ca88731..e984302 100644
   --- a/fs/fuse/dev.c
   +++ b/fs/fuse/dev.c
   @@ -1191,8 +1191,9 @@ __releases(fc-lock)
 * request_end().  Otherwise add it to the processing list, and set
 * the 'sent' flag.
 */
   -static ssize_t fuse_dev_do_read(struct fuse_conn *fc, struct file *file,
   - struct fuse_copy_state *cs, size_t nbytes)
   +static ssize_t __maybe_unused
   +fuse_dev_do_read(struct fuse_conn *fc, struct file *file,
   +  struct fuse_copy_state *cs, size_t nbytes)
  
  fuse_dev_do_read() is definitely going to remain used.  So no point in 
  adding
  __maybe_unused.
 
 Off course, but at least gcc now also is aware that this is intentional and
 nicely refrains from nagging you with a warning.

GCC shouldn't be warning about an unused fuse_dev_do_read; please
recheck.  It will always get used by fuse_dev_read, which
unconditionally gets used in the .aio_read field of fuse_dev_operations.

- Josh Triplett
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v5 4/7] fs/fuse: support compiling out splice

2014-11-25 Thread Pieter Smith
On Tue, Nov 25, 2014 at 08:42:42PM +0100, Pieter Smith wrote:
 On Tue, Nov 25, 2014 at 03:17:13PM +0100, Miklos Szeredi wrote:
  [Trimming CC.  Please do the same for other patches.  I for one am not
  interested in the general tinification discussion]
  
  On Tue, Nov 25, 2014 at 08:19:39AM +0100, Pieter Smith wrote:
   To implement splice support, fs/fuse makes use of nosteal_pipe_buf_ops. 
   This
   struct is exported by fs/splice. The goal of the larger patch set is to
   completely compile out fs/splice, so uses of the exported struct need to 
   be
   compiled out along with fs/splice.
   
   This patch therefore compiles out splice support in fs/fuse when
   CONFIG_SYSCALL_SPLICE is undefined.
   
   Signed-off-by: Pieter Smith pie...@boesman.nl
   ---
fs/fuse/dev.c | 9 +++--
1 file changed, 7 insertions(+), 2 deletions(-)
   
   diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
   index ca88731..e984302 100644
   --- a/fs/fuse/dev.c
   +++ b/fs/fuse/dev.c
   @@ -1191,8 +1191,9 @@ __releases(fc-lock)
 * request_end().  Otherwise add it to the processing list, and set
 * the 'sent' flag.
 */
   -static ssize_t fuse_dev_do_read(struct fuse_conn *fc, struct file *file,
   - struct fuse_copy_state *cs, size_t nbytes)
   +static ssize_t __maybe_unused
   +fuse_dev_do_read(struct fuse_conn *fc, struct file *file,
   +  struct fuse_copy_state *cs, size_t nbytes)
  
  fuse_dev_do_read() is definitely going to remain used.  So no point in 
  adding
  __maybe_unused.
 
 Off course, but at least gcc now also is aware that this is intentional and
 nicely refrains from nagging you with a warning.
 
My apologies. My response was too hasty. You are right. This should not be
needed. I will revert this piece in v6 of this patch.
{
 int err;
 struct fuse_req *req;
   @@ -1291,6 +1292,7 @@ static ssize_t fuse_dev_read(struct kiocb *iocb, 
   const struct iovec *iov,
 return fuse_dev_do_read(fc, file, cs, iov_length(iov, nr_segs));
}

   +#ifdef CONFIG_SYSCALL_SPLICE
static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos,
 struct pipe_inode_info *pipe,
 size_t len, unsigned int flags)
   @@ -1368,6 +1370,9 @@ out:
 kfree(bufs);
 return ret;
}
   +#else /* CONFIG_SYSCALL_SPLICE */
   +#define fuse_dev_splice_read NULL
   +#endif
  
  This looks fine.
  
  Thanks,
  Miklos
  

static int fuse_notify_poll(struct fuse_conn *fc, unsigned int size,
 struct fuse_copy_state *cs)
   -- 
   2.1.0
   
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v5 4/7] fs/fuse: support compiling out splice

2014-11-25 Thread Pieter Smith
On Tue, Nov 25, 2014 at 12:49:16PM -0800, j...@joshtriplett.org wrote:
 On Tue, Nov 25, 2014 at 08:42:42PM +0100, Pieter Smith wrote:
  On Tue, Nov 25, 2014 at 03:17:13PM +0100, Miklos Szeredi wrote:
   [Trimming CC.  Please do the same for other patches.  I for one am not
   interested in the general tinification discussion]
   
   On Tue, Nov 25, 2014 at 08:19:39AM +0100, Pieter Smith wrote:
To implement splice support, fs/fuse makes use of nosteal_pipe_buf_ops. 
This
struct is exported by fs/splice. The goal of the larger patch set is to
completely compile out fs/splice, so uses of the exported struct need 
to be
compiled out along with fs/splice.

This patch therefore compiles out splice support in fs/fuse when
CONFIG_SYSCALL_SPLICE is undefined.

Signed-off-by: Pieter Smith pie...@boesman.nl
---
 fs/fuse/dev.c | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index ca88731..e984302 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -1191,8 +1191,9 @@ __releases(fc-lock)
  * request_end().  Otherwise add it to the processing list, and set
  * the 'sent' flag.
  */
-static ssize_t fuse_dev_do_read(struct fuse_conn *fc, struct file 
*file,
-   struct fuse_copy_state *cs, size_t 
nbytes)
+static ssize_t __maybe_unused
+fuse_dev_do_read(struct fuse_conn *fc, struct file *file,
+struct fuse_copy_state *cs, size_t nbytes)
   
   fuse_dev_do_read() is definitely going to remain used.  So no point in 
   adding
   __maybe_unused.
  
  Off course, but at least gcc now also is aware that this is intentional and
  nicely refrains from nagging you with a warning.
 
 GCC shouldn't be warning about an unused fuse_dev_do_read; please
 recheck.  It will always get used by fuse_dev_read, which
 unconditionally gets used in the .aio_read field of fuse_dev_operations.
 
 - Josh Triplett

Thanks for pointing this out. I was too hasty in my response.

- Pieter Smith
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v5 4/7] fs/fuse: support compiling out splice

2014-11-24 Thread Pieter Smith
To implement splice support, fs/fuse makes use of nosteal_pipe_buf_ops. This
struct is exported by fs/splice. The goal of the larger patch set is to
completely compile out fs/splice, so uses of the exported struct need to be
compiled out along with fs/splice.

This patch therefore compiles out splice support in fs/fuse when
CONFIG_SYSCALL_SPLICE is undefined.

Signed-off-by: Pieter Smith 
---
 fs/fuse/dev.c | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index ca88731..e984302 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -1191,8 +1191,9 @@ __releases(fc->lock)
  * request_end().  Otherwise add it to the processing list, and set
  * the 'sent' flag.
  */
-static ssize_t fuse_dev_do_read(struct fuse_conn *fc, struct file *file,
-   struct fuse_copy_state *cs, size_t nbytes)
+static ssize_t __maybe_unused
+fuse_dev_do_read(struct fuse_conn *fc, struct file *file,
+struct fuse_copy_state *cs, size_t nbytes)
 {
int err;
struct fuse_req *req;
@@ -1291,6 +1292,7 @@ static ssize_t fuse_dev_read(struct kiocb *iocb, const 
struct iovec *iov,
return fuse_dev_do_read(fc, file, , iov_length(iov, nr_segs));
 }
 
+#ifdef CONFIG_SYSCALL_SPLICE
 static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos,
struct pipe_inode_info *pipe,
size_t len, unsigned int flags)
@@ -1368,6 +1370,9 @@ out:
kfree(bufs);
return ret;
 }
+#else /* CONFIG_SYSCALL_SPLICE */
+#define fuse_dev_splice_read NULL
+#endif
 
 static int fuse_notify_poll(struct fuse_conn *fc, unsigned int size,
struct fuse_copy_state *cs)
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v5 4/7] fs/fuse: support compiling out splice

2014-11-24 Thread Pieter Smith
To implement splice support, fs/fuse makes use of nosteal_pipe_buf_ops. This
struct is exported by fs/splice. The goal of the larger patch set is to
completely compile out fs/splice, so uses of the exported struct need to be
compiled out along with fs/splice.

This patch therefore compiles out splice support in fs/fuse when
CONFIG_SYSCALL_SPLICE is undefined.

Signed-off-by: Pieter Smith pie...@boesman.nl
---
 fs/fuse/dev.c | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index ca88731..e984302 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -1191,8 +1191,9 @@ __releases(fc-lock)
  * request_end().  Otherwise add it to the processing list, and set
  * the 'sent' flag.
  */
-static ssize_t fuse_dev_do_read(struct fuse_conn *fc, struct file *file,
-   struct fuse_copy_state *cs, size_t nbytes)
+static ssize_t __maybe_unused
+fuse_dev_do_read(struct fuse_conn *fc, struct file *file,
+struct fuse_copy_state *cs, size_t nbytes)
 {
int err;
struct fuse_req *req;
@@ -1291,6 +1292,7 @@ static ssize_t fuse_dev_read(struct kiocb *iocb, const 
struct iovec *iov,
return fuse_dev_do_read(fc, file, cs, iov_length(iov, nr_segs));
 }
 
+#ifdef CONFIG_SYSCALL_SPLICE
 static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos,
struct pipe_inode_info *pipe,
size_t len, unsigned int flags)
@@ -1368,6 +1370,9 @@ out:
kfree(bufs);
return ret;
 }
+#else /* CONFIG_SYSCALL_SPLICE */
+#define fuse_dev_splice_read NULL
+#endif
 
 static int fuse_notify_poll(struct fuse_conn *fc, unsigned int size,
struct fuse_copy_state *cs)
-- 
2.1.0

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/