mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-20 21:43:09 +00:00
fuse/impl_c: UNDO --auto-fsid option
rolling back: Thu Sep 25 14:42:23 BST 2008 robk-tahoe@allmydata.com * fuse/impl_c: add --auto-fsid option this was inspired by reading the fuse docs and discovering the 'fsid' option to fuse_main, and was _intended_ to support a sort of 'stability' to the filesystem (specifically derived from the root-uri mounted, whether directly or via an alias) to support mac aliases across unmount/remount etc. some experimentation shows that that doesn't actually work, and that, at least for mac aliases in my testing, they're tied to path-to-mountpoint and not to the fsid - which seems to have no bearing. perhaps the 'local' flag is causing weirdness therein. at any rate, I'm recording it simply for posterity, in case it turns out to be useful after all somewhere down the road. M ./contrib/fuse/impl_c/blackmatch.py +13
This commit is contained in:
parent
d79001543b
commit
6763df16f1
@ -17,7 +17,6 @@ import os
|
||||
#import pprint
|
||||
import errno
|
||||
import stat
|
||||
import struct
|
||||
# pull in some spaghetti to make this stuff work without fuse-py being installed
|
||||
try:
|
||||
import _find_fuse_parts
|
||||
@ -63,12 +62,6 @@ class TahoeFuseOptions(usage.Options):
|
||||
["cache-timeout", None, 20,
|
||||
"Time, in seconds, to cache directory data."],
|
||||
]
|
||||
optFlags = [
|
||||
["auto-fsid", None,
|
||||
"Set the volume fsid to be a hash of the mounted root_cap. This provides "
|
||||
"a stable identity to the filesystem upon remount, which is useful e.g. "
|
||||
"in support of aliases to files within the filesystem."],
|
||||
]
|
||||
|
||||
def __init__(self):
|
||||
usage.Options.__init__(self)
|
||||
@ -911,12 +904,6 @@ def main(argv):
|
||||
logfile = file(fname, 'ab')
|
||||
log('\n'+(24*'_')+'init'+(24*'_')+'\n')
|
||||
|
||||
if config['auto-fsid']:
|
||||
# note, macfuse docs state '32bit int' implementation says '< 0xFFFFFF'
|
||||
h = 0xFFFFFF & struct.unpack('i', sha.new(root_uri).digest()[:4])[0]
|
||||
log('using auto-allocated fsid: %d' % h)
|
||||
config.fuse_options.append('fsid=%d'%h)
|
||||
|
||||
if not os.path.exists(config.mountpoint):
|
||||
raise OSError(2, 'No such file or directory: "%s"' % (config.mountpoint,))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user