From: Waiman Long <waiman.long@hp.com>
To: George Spelvin <linux@horizon.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
torvalds@linux-foundation.org, viro@ZenIV.linux.org.uk
Subject: Re: [PATCH] dcache: Translating dentry into pathname without taking rename_lock
Date: Thu, 05 Sep 2013 13:06:35 -0400 [thread overview]
Message-ID: <5228BA1B.5030501@hp.com> (raw)
In-Reply-To: <20130905043033.20292.qmail@science.horizon.com>
On 09/05/2013 12:30 AM, George Spelvin wrote:
> As long as you're removing locks from prepend_name and complicating its
> innards, I notice that each and every call site follows it by prepending
> "/". How about moving that into prepend_name as well?
>
> Also, if you happen to feel like it, you can delete the slash flag
> and replace it with "bptr != *buffer".
>
> Another small tweak would be to the global_root part of the code.
> You could move the is_mounted(vfsmnt) test up, and combine the tail of
> that code path with the regular exit. All you have to do is change
> the !slash test to:
>
> if (error>= 0&& bptr == *buffer) { /* Root directory */
> if (--blen< 0)
> error = -ENAMETOOLONG;
> else
> *--bptr = '/';
> }
>
> This modified form is no more code than an inlined copy of prepend(),
> so we haven't actually slowed the fast path, but it avoids corrupting
> the return value of 0/1/2 if possible.
Thank for the suggestions. I will implement them in my v2 patch.
-Longman
next prev parent reply other threads:[~2013-09-05 17:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-05 4:30 [PATCH] dcache: Translating dentry into pathname without taking rename_lock George Spelvin
2013-09-05 17:06 ` Waiman Long [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-09-04 19:05 Waiman Long
2013-09-04 19:11 ` Al Viro
2013-09-04 19:33 ` Waiman Long
2013-09-04 19:43 ` Al Viro
2013-09-05 1:55 ` Waiman Long
2013-09-05 2:42 ` Al Viro
[not found] ` <CA+55aFwW+hWwQd8+NgukSidHbf2bnd6QO0yKK9NAgX+9rt0cOQ@mail.gmail.com>
[not found] ` <5227E321.4090008@hp.com>
2013-09-05 2:48 ` Linus Torvalds
2013-09-05 4:20 ` Al Viro
2013-09-04 19:26 ` Waiman Long
2013-09-04 20:40 ` John Stoffel
2013-09-05 2:04 ` Waiman Long
2013-09-05 13:29 ` John Stoffel
2013-09-05 17:28 ` Waiman Long
2013-09-04 21:31 ` Linus Torvalds
2013-09-05 2:17 ` Waiman Long
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=5228BA1B.5030501@hp.com \
--to=waiman.long@hp.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@horizon.com \
--cc=torvalds@linux-foundation.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.