?

Log in

No account? Create an account
MetaFS and Creativity - The Desian Universe
Links Home / GitHub January 2017
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
 
 
 
deskitty
deskitty
Des
Thu, Aug. 11th, 2005 05:54 pm
MetaFS and Creativity

Heh ... it's funny how some random thoughts can have a huge accident in your brain and then suddenly ... POP! Creativity out of nowhere!

I was thinking about how to implement services in MetaFS. Services are sort of like sub-directories/files of inodes (any inode) that provide a more useful way to interact with them. (The canonical example is chdir()ing into a tarball and poking around.)

But, all of MetaFS has the strict invariant that locking must happen starting at the root of the tree and going down. So I'm thinking "OK, if the file and its service both need to be locked, the file has to be locked first, since the service is the child of the file.".

But that's not how it appears to the end user. If you hypothetically do an ls on a file and its service, you'd see something like:

-rw-------  1 condor condor  26K Feb 26  2004 myfile.tar
drwx------  2 condor condor  176 Jun 14 21:07 myfile.tar#tar/


Both the file and service are children of the parent directory.

The locking problem had a head-on collision with this fact just now. So instead of having locking the service be dependent on locking the file (to preserve the locking invariant), I've decided I can, in fact, do it the other way around, which makes more sense anyway.

The user's going to perform some operation (say, a readdir()) on the service, so we need to lock it. OK, now the service needs to look into the tarball for the information, so we need to lock that. And since they're both children of the directory (instead of trying to make the service a child of the file, which logically makes sense but doesn't work), we can still safely preserve the invariant.

All this, of course, requires that MetaFS be able to handle silly things like "mv myfile.tar myfile.tar#tar/" without locking both of them, but that should be fairly trivial. Ordinarily, "myfile.tar" would get locked first, followed by "myfile.tar#tar", which is exactly backwards and thus causes deadlocks.

I'm sure you're all thoroughly confused now.

-- Des

Current Mood: geeky geeky

4CommentReplyShare

moment_of_me
moment_of_me
moment_of_me
Fri, Aug. 12th, 2005 11:28 am (UTC)

Confused? Ehm, yeah.
Horny? Definitely. RRRAAAAAAAAAWWWWWWWWWWWWWRRRRRRRR


ReplyThread
deskitty
deskitty
Des
Fri, Aug. 12th, 2005 02:33 pm (UTC)

::snort:: You would be. :)

Isn't that what you have a husband for now? Go get him to talk to you about networking protocols or something. ;P


ReplyThread Parent
moment_of_me
moment_of_me
moment_of_me
Fri, Aug. 12th, 2005 02:39 pm (UTC)

Yes, but he's at work. *pouts* And they frown on him getting his wife off while he's at work. He has threatened to send me recordings of him reading his Cisco study guides. Perhaps that's a viable option if you're going to be that way about it... *grins*

*wibbles* don't you love me anymore?


ReplyThread Parent
deskitty
deskitty
Des
Fri, Aug. 12th, 2005 03:50 pm (UTC)

Perhaps that's a viable option if you're going to be that way about it... *grins*

Heeeee.

*wibbles* don't you love me anymore?

Of course I love you, silly. ::pets:: I just don't want your husband vaporizing me with that death ray of his. ;P

Now, the riding crop, that's another matter... >:D


ReplyThread Parent