9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] 9p(2) and walk1
@ 2021-02-15 17:59 pouya+lists.9fans
  2021-02-15 21:35 ` [9fans] " Anthony Martin
  0 siblings, 1 reply; 2+ messages in thread
From: pouya+lists.9fans @ 2021-02-15 17:59 UTC (permalink / raw)
  To: 9fans

9p(2) says the following about

char* (*walk1)(Fid *fid, char *name, Qid *qid);

| Because implementing the full walk message is intricate and prone to
| error, the helper routine walkandclone will handle the request given
| pointers to two functions walk1 and (optionally) clone.  [...] Walk1
| should walk fid to name, initializing fid->qid to the new path's
| qid.Both should return nil on success or an error message on error.

And later:

| If the client provides functions srv->walk1 and (optionally)
| srv->clone, the 9P service loop will call walkandclone with these
| functions to handle the request.  Unlike the walk1 above, srv->walk1
| must fill in both fid->qid and *qid with the new qid on a successful
| walk.

I think the distinction being made is that if walk1 is populated in a
struct served by srv(2) it needs to set *qid, but not if it's used
instead to construct a walk function explicitly using walkandclone.  A
quick look at the source code of lib9p seems to confirm this.

I looked at the implementation of nntpfs(4) and webfs(4), which both
set walk1.  The former sets both fid->qid and *qid and the latter only
*qid, which seems it could be ok from a quick look at the source of
lib9p, but goes against the above instructions AFAICS.

Are these subtle differences (the two in the man page and the third in
code) intentional?  It's my first time implementing a 9P file system
so apologies if I'm missing something basic.

Thanks,
Pouya



------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/Tb39d71a5497bba2d-M226ea8444212b13fc9a35ab2
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-15 21:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-15 17:59 [9fans] 9p(2) and walk1 pouya+lists.9fans
2021-02-15 21:35 ` [9fans] " Anthony Martin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).