public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Tejun Heo <tj@kernel.org>
Cc: kay@vrfy.org, linux-kernel@vger.kernel.org,
	ebiederm@xmission.com, bhelgaas@google.com
Subject: Re: [PATCHSET v2] sysfs: use seq_file and unify regular and bin file handling
Date: Sat, 5 Oct 2013 17:40:32 -0700	[thread overview]
Message-ID: <20131006004032.GA3601@kroah.com> (raw)
In-Reply-To: <1380663729-18243-1-git-send-email-tj@kernel.org>

On Tue, Oct 01, 2013 at 05:41:54PM -0400, Tejun Heo wrote:
> Hello,
> 
> Changes from the last take[L] are,
> 
> * bin file reads no longer go through seq_file.  It goes through a
>   separate read path implemented in sysfs_bin_read().  bin files
>   shouldn't see any behavior difference now.
> 
> * bin files now use a separate file_operations struct -
>   sysfs_bin_operations.  Open and write paths are still shared but
>   read path is separate and mmap exists only for the bin files.  While
>   this is less uniform than before, it should still render itself well
>   to extracting the core functionality.
> 
> * 0001-0008 are the same as before.

Nice, I've applied all of these now.

> Patchset description follows.
> 
> Currently, sysfs's file handling is a bit weird.
> 
> * Regular and bin file paths are similar but implemented completely
>   separately duplicating some hairy logics.
> 
> * Read path implements custom buffering which is essentially
>   degenerate seq_file.
> 
> In addition, sysfs core implementation is planned to be separated out
> so that it can be shared by other subsystems and the current file
> handling is too restrictive and quirky to spread further to other
> parts of the kernel.  It'd be a lot more desirable to have read path
> completely handled by seq_file which is a lot more versatile and would
> also increase overall behavior consistency.
> 
> This patchset updates file handling such that read is handled by
> seq_file and then merges bin file handling into regular file path.
> While some changes introduces behavior changes in extreme corner
> cases, they are highly unlikely to be noticeable (please refer to the
> description of each patch for details) and generally bring sysfs's
> behavior closer to those of procfs or any pseudo filesystem which
> makes use of seq_file.
> 
> After the conversion, LOC is reduced by ~150 lines and read path is
> fully handled by seq_file, which allows defining a new seq_file based
> core interface which will enable sharing sysfs from other subsystems.

I'm glad to see the sysfs cleanups, thanks for doing all of this, it's
much needed.

How are you going to use sysfs from another kernel subsystem?  Is this
for another filesystem, or do you want to use kobjects for some other
subsystem that doesn't export them using sysfs?

thanks,

greg k-h

  parent reply	other threads:[~2013-10-06  6:11 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-01 21:41 [PATCHSET v2] sysfs: use seq_file and unify regular and bin file handling Tejun Heo
2013-10-01 21:41 ` [PATCH 01/15] sysfs: remove unused sysfs_buffer->pos Tejun Heo
2013-10-01 21:41 ` [PATCH 02/15] sysfs: remove sysfs_buffer->needs_read_fill Tejun Heo
2013-10-01 21:41 ` [PATCH 03/15] sysfs: remove sysfs_buffer->ops Tejun Heo
2013-10-01 21:41 ` [PATCH 04/15] sysfs: add sysfs_open_file_mutex Tejun Heo
2013-10-01 21:41 ` [PATCH 05/15] sysfs: rename sysfs_buffer to sysfs_open_file Tejun Heo
2013-10-01 21:42 ` [PATCH 06/15] sysfs: add sysfs_open_file->sd and ->file Tejun Heo
2013-10-01 21:42 ` [PATCH 07/15] sysfs: use transient write buffer Tejun Heo
2013-10-01 21:42 ` [PATCH 08/15] sysfs: use seq_file when reading regular files Tejun Heo
2013-10-01 21:42 ` [PATCH 09/15] sysfs: skip bin_buffer->buffer while reading Tejun Heo
2013-10-01 21:42 ` [PATCH 10/15] sysfs: collapse fs/sysfs/bin.c::fill_read() into read() Tejun Heo
2013-10-01 21:42 ` [PATCH 11/15] sysfs: prepare path write for unified regular / bin file handling Tejun Heo
2013-10-01 21:42 ` [PATCH 12/15] sysfs: add sysfs_bin_read() Tejun Heo
2013-10-01 21:42 ` [PATCH 13/15] sysfs: copy bin mmap support from fs/sysfs/bin.c to fs/sysfs/file.c Tejun Heo
2013-10-01 21:42 ` [PATCH 14/15] sysfs: prepare open path for unified regular / bin file handling Tejun Heo
2013-10-01 21:42 ` [PATCH 15/15] sysfs: merge regular and " Tejun Heo
2013-10-06  0:40 ` Greg KH [this message]
2013-10-07 17:00   ` [PATCHSET v2] sysfs: use seq_file and unify " Tejun Heo
2013-10-07 23:11     ` Greg KH
2013-10-11 19:11       ` Yinghai Lu
2013-10-11 20:49         ` Greg KH
2013-10-14 13:27           ` [PATCH driver-core-next] sysfs: make sysfs_file_ops() follow ignore_lockdep flag Tejun Heo
2013-10-14 18:41             ` Yinghai Lu
2013-10-14 12:47         ` [PATCHSET v2] sysfs: use seq_file and unify regular and bin file handling Tejun Heo

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=20131006004032.GA3601@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=bhelgaas@google.com \
    --cc=ebiederm@xmission.com \
    --cc=kay@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@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