On Fri, Sep 6, 2013 at 9:08 AM, Waiman Long<Waiman.Long@xxxxxx> wrote:This patch will replace the writer's write_seqlock/write_sequnlockOk, this actually looks really good.
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.
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.