9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Quintile <steve@quintile.net>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] wstat and atomic directory change
Date: Tue,  3 Feb 2015 09:04:59 +0000	[thread overview]
Message-ID: <CF87C213-4BBF-44E6-93EB-0EEA9FEE477A@quintile.net> (raw)
In-Reply-To: <CAHL7psFhMUJa+Sjt5zYS7NfxuN+G8A-tVM79ZDXn4gaV6HzZ-g@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2780 bytes --]

the control file idea is a neat way of doing atomic moves.

this has been discussed before, my summary is its not something you need often to justify the pain of trying to implement it correctly - the directory locking has to be done with care to ensure it is all deadlock free.

I do, very rarely, move directories around, generally I just take more care when creating them - knowing it will be a hassle to change later.

I also, run fossil and venti, so the copies take no more disk space, only the directory entries.

just my 2 cents worth.

-Steve





> On 3 Feb 2015, at 08:53, Giacomo Tesio <giacomo@tesio.it> wrote:
> 
> Ok, got it.
> 
> This annoing thread (sorry) was due to the fact that the only messages that actually contains the "/" marker are Tauth and Tattach (in the aname). I still think that using wstat with such marker to atomically move files among accessible folders would not violate the protocol specification, but actually it would break existing servers and that's is probably enough to define it as an extension to the protocol (say 9P2000.a) so that clients can know if the server supports this semantic or not.
> However, as I previously said, I don't think that the world need a new 9p variant :-D
> 
> Now, what's the proper 9p way that a client could use to tell a syntetic server to atomically move a syntetic file between syntetic folders?
> I bet that the answer is a control file receiving rc like commands (or any other custom, human readable protocol). Would it be correct?
> 
> Something like this:
> 
> Given
> mountpoint/
> + first/
>   + moveme.txt
> + second/
> + atomically
> 
> Doing
> echo mv /first/moveme.txt /second/ > mountpoint/atomically
> 
> We optain either the following or a Rerror:
> mountpoint/
> + first/
> + second/
>   + moveme.txt
> + atomically
> 
> 
> Is it the proper way to achieve such kind of operations?
> 
> 
> Thanks for your patience... :-)
> 
> 
> Giacomo
> 
> 2015-01-30 23:49 GMT+01:00 Anthony Sorace <a@9srv.net>:
>> 
>> > On Jan 30, 2015, at 10:59 , Giacomo Tesio <giacomo@tesio.it> wrote:
>> >
>> > It surely would not be conformant to Plan 9 systems, but to the protocol?
>> 
>> No. Joel has it right. Writing a server which allows / in names would mean that the "/" you're slipping into a name wouldn't always be a directory indicator or name separator. Think of it as the protocol accommodating systems which use some other marker.
>> 
>> The relevant point is that the "name" in question (which, as you noticed, the protocol allows to contain / even though plan9 doesn't) is the name *within a directory*, not a full path name. walk(5) probably gives the best explanation of this, or perhaps the discussion of create in open(5).
> 

[-- Attachment #2: Type: text/html, Size: 4438 bytes --]

  reply	other threads:[~2015-02-03  9:04 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-30 11:21 Giacomo Tesio
2015-01-30 14:13 ` erik quanstrom
2015-01-30 15:59   ` Giacomo Tesio
2015-01-30 20:19     ` Joel C. Salomon
2015-01-30 22:49     ` Anthony Sorace
2015-02-03  8:53       ` Giacomo Tesio
2015-02-03  9:04         ` Quintile [this message]
2015-02-04  3:51           ` erik quanstrom
2015-02-04  8:28             ` Giacomo Tesio
2015-02-04 14:06               ` erik quanstrom
2015-02-04 14:29                 ` Giacomo Tesio
2015-02-04 16:30                   ` Skip Tavakkolian
2015-02-04 19:23                     ` erik quanstrom
2015-02-04 21:24                       ` Giacomo Tesio
2015-02-05  4:13                         ` lucio
2015-02-05  8:21                           ` Giacomo Tesio
2015-02-05  8:37                             ` Giacomo Tesio
2015-02-05  8:59                               ` lucio
2015-02-05  8:54                             ` lucio
2015-02-05 16:13                               ` erik quanstrom
2015-02-05  4:15                         ` lucio
2015-02-05 16:20                         ` erik quanstrom
2015-02-05 16:46                           ` Giacomo Tesio
2015-02-05 17:22                             ` Skip Tavakkolian
2015-02-05 17:20                           ` Bakul Shah
2015-02-05  4:26 sl
2015-02-05  4:26 sl
2015-02-05  8:08 ` Giacomo Tesio

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=CF87C213-4BBF-44E6-93EB-0EEA9FEE477A@quintile.net \
    --to=steve@quintile.net \
    --cc=9fans@9fans.net \
    /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 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).