[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFw8UuEmKsSdGZPUmcekZheNimEt4U81i7Bz0LipGzsFmg@mail.gmail.com>
Date: Fri, 6 Sep 2013 13:52:49 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Waiman Long <Waiman.Long@...com>
Cc: Alexander Viro <viro@...iv.linux.org.uk>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"Chandramouleeswaran, Aswin" <aswin@...com>,
"Norton, Scott J" <scott.norton@...com>,
George Spelvin <linux@...izon.com>,
John Stoffel <john@...ffel.org>
Subject: Re: [PATCH v3 1/1] dcache: Translating dentry into pathname without
taking rename_lock
On Fri, Sep 6, 2013 at 9:08 AM, Waiman Long <Waiman.Long@...com> wrote:
>
> This patch will replace the writer's write_seqlock/write_sequnlock
> sequence of the rename_lock of the callers of the prepend_path() and
> __dentry_path() functions with the reader's read_seqbegin/read_seqretry
> sequence within these 2 functions.
Ok, this actually looks really good.
I do have one comment, from just reading the patch:
I would really like the stuff inside the
restart:
bptr = *buffer;
blen = *buflen;
if (retry_cnt) {
seq = read_seqbegin(&rename_lock);
rcu_read_lock();
} else
write_seqlock(&rename_lock);
... guts of path generation ...
if (retry_cnt) {
retry_cnt--;
rcu_read_unlock();
if (read_seqretry(&rename_lock, seq))
goto restart;
} else
write_sequnlock(&rename_lock);
could possible be done as a separate function?
Alternatively (or perhaps additionally), maybe the locking could be
done as an inline function too (taking the retry count as an argument)
to make things a bit more easy to understand.
Right now there is a lot of fairly subtle things going on in that
__dentry_path() function. It's not a huge function, but I think that
"while()" loop inside that locking could be done as its own function
and make it even more readable.
But I could already apply this as-is, so it's not a big deal.
Al - do you have comments? Do you want to take this through your tree,
or are you working on other things? I can take this directly too..
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists