From: Rob Jones <rob.jones@codethink.co.uk>
To: Kees Cook <keescook@chromium.org>
Cc: Randy Dunlap <rdunlap@infradead.org>,
Al Viro <viro@zeniv.linux.org.uk>,
"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-kernel@codethink.co.uk,
Andrew Morton <akpm@linux-foundation.org>,
Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Subject: Re: [PATCH RESUBMIT 0/2] fs/seq_file: Add seq_open_init()
Date: Thu, 25 Sep 2014 18:36:22 +0100 [thread overview]
Message-ID: <54245296.5070604@codethink.co.uk> (raw)
In-Reply-To: <CAGXu5j+tv6_kJy7HNTsCa_kB4Q+8khS1TpWWiRwTM7QeMWF9Zg@mail.gmail.com>
On 25/09/14 17:09, Kees Cook wrote:
> On Thu, Sep 25, 2014 at 1:57 AM, Rob Jones <rob.jones@codethink.co.uk> wrote:
>>
>>
>> On 24/09/14 19:06, Kees Cook wrote:
>>>
>>> On Wed, Sep 24, 2014 at 4:15 AM, Rob Jones <rob.jones@codethink.co.uk>
>>> wrote:
>>>>
>>>> Series resubmitted due to a typo in an email address.
>>>>
>>>> This patch series implements and documents a new interface function for
>>>> seq_file.
>>>>
>>>> The existing set of open functions: seq_open(), seq_open_private() and
>>>> __seq_open_private() satisfy the majority of use cases however there is
>>>> one more use case that is also very common that this new function
>>>> addresses.
>>>>
>>>> This case is where the iterator needs information that is available only
>>>> at
>>>> the time the seq_file is opened but does not need any space allocated,
>>>> e.g.
>>>> access to the inode structure. This type of open occurs, by my best
>>>> estimate,
>>>> in well over 40 places.
>>>>
>>>> Using the new function saves at least two lines of boilerplate code per
>>>> instance as well as making the code easier to follow. The additional code
>>>> in seq_file.c to implement the function is minimal as the first place
>>>> that
>>>> code can be removed is within seq_file.c itself.
>>>>
>>>> Once this patch is accepted, the instances of boilerplate code can be
>>>> addressed.
>>>
>>>
>>> Would it be possible to write a coccinelle patch for the replacements?
>>
>>
>> I'm afraid I don't know what that means.
>
> It's a very flexible tool that should be able to find all the places
> where this pattern is being used, and you can replace it with the new
> function call:
>
> http://lwn.net/Articles/315686/
I suspect that the learning curve would exceed the utility but I'll have
a look at it. Unless there's a coccinelle expert available to do it, in
which case I could point them in the right direction.
My gut reaction would be that by the time I had analysed enough cases
to come up with a viable set of SmPL scripts I would have done most of
the work required, especially if I had to learn a new syntax and tool
to do it.
But first impressions aren't always right.
>
> -Kees
>
>
--
Rob Jones
Codethink Ltd
mailto:rob.jones@codethink.co.uk
tel:+44 161 236 5575
next prev parent reply other threads:[~2014-09-25 17:36 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-24 11:15 [PATCH RESUBMIT 0/2] fs/seq_file: Add seq_open_init() Rob Jones
2014-09-24 11:15 ` [PATCH RESUBMIT 1/2] fs/seq_file: Create new function seq_open_init() Rob Jones
2014-09-24 21:39 ` Andrew Morton
2014-09-25 9:10 ` Rob Jones
2014-09-25 14:49 ` Randy Dunlap
2014-09-25 17:39 ` Rob Jones
2014-09-25 17:50 ` Andrew Morton
2014-09-25 17:54 ` Rob Jones
2014-09-25 18:07 ` Andrew Morton
2014-09-24 11:15 ` [PATCH RESUBMIT 2/2] Documentation/filesystem/seq_file: document seq_open_init() Rob Jones
2014-09-24 18:06 ` [PATCH RESUBMIT 0/2] fs/seq_file: Add seq_open_init() Kees Cook
2014-09-25 8:57 ` Rob Jones
2014-09-25 16:09 ` Kees Cook
2014-09-25 17:36 ` Rob Jones [this message]
2014-09-25 17:40 ` Kees Cook
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=54245296.5070604@codethink.co.uk \
--to=rob.jones@codethink.co.uk \
--cc=akpm@linux-foundation.org \
--cc=keescook@chromium.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@codethink.co.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=penguin-kernel@i-love.sakura.ne.jp \
--cc=rdunlap@infradead.org \
--cc=viro@zeniv.linux.org.uk \
/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.