All of lore.kernel.org
 help / color / mirror / Atom feed
From: hujianyang <hujianyang@huawei.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-unionfs@vger.kernel.org
Subject: Cursor in readdir
Date: Sat, 29 Nov 2014 18:11:40 +0800	[thread overview]
Message-ID: <54799BDC.5030201@huawei.com> (raw)

Hi Miklos,

Sorry for disturb you. I'm confused with *cursor* in struct
ovl_dir_file. I know this struct ovl_cache_entry *cursor* is
presented to indicate current pos when performing readdir at
a MERGE type directory.

Why this additional entry is needed? Can't we use a pointer
to record which entry is read or is ready for reading? After
finish reading lower and upper directories, entries in struct
ovl_dir_cache is stabilized. Changing of directories will
cause the later .readdir() to create a new ovl_dir_cache but
the old cache will not be released until all the holders of
it call .release().

So I think a pointer points to an entry in the entry list of
ovl_dir_cache is enough to each process sharing the access
of the same cache. We don't need to keep and move an special
entry, *cursor*. That's my thought.

I've considered a lot and googled some key words but found
nothing. Did I miss something important?

It will be fine if you'd like to explain the requirement of
*cursor* in readdir. Thanks a lot~!


Hu



             reply	other threads:[~2014-11-29 10:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-29 10:11 hujianyang [this message]
2014-12-01 15:26 ` Cursor in readdir Miklos Szeredi
2014-12-05  9:47   ` hujianyang
2014-12-05 10:50     ` Miklos Szeredi

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=54799BDC.5030201@huawei.com \
    --to=hujianyang@huawei.com \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /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.