From: Brian Warner Date: Sat, 10 Jan 2009 02:37:36 +0000 (-0700) Subject: storage.py: announce a maximum-immutable-share-size based upon a 'df' of the disk... X-Git-Tag: allmydata-tahoe-1.3.0~217 X-Git-Url: https://git.rkrishnan.org/frontends/configuration.rst?a=commitdiff_plain;h=c7cd3f38e7b8768dc983c860ebc8d978c02da854;p=tahoe-lafs%2Ftahoe-lafs.git storage.py: announce a maximum-immutable-share-size based upon a 'df' of the disk. Fixes #569, and this should be the last requirement for #346 (remove 12GiB filesize limit) --- diff --git a/src/allmydata/storage.py b/src/allmydata/storage.py index 97be42f0..f1ce2ece 100644 --- a/src/allmydata/storage.py +++ b/src/allmydata/storage.py @@ -795,10 +795,6 @@ def create_mutable_sharefile(filename, my_nodeid, write_enabler, parent): class StorageServer(service.MultiService, Referenceable): implements(RIStorageServer, IStatsProducer) name = 'storage' - VERSION = { "http://allmydata.org/tahoe/protocols/storage/v1" : - { "maximum-immutable-share-size": 2**32 }, - "application-version": str(allmydata.__version__), - } def __init__(self, storedir, reserved_space=0, discard_storage=False, readonly_storage=False, @@ -958,7 +954,16 @@ class StorageServer(service.MultiService, Referenceable): return space def remote_get_version(self): - return self.VERSION + remaining_space = self.get_available_space() + if remaining_space is None: + # we're on a platform that doesn't have 'df', so make a vague + # guess. + remaining_space = 2**64 + version = { "http://allmydata.org/tahoe/protocols/storage/v1" : + { "maximum-immutable-share-size": remaining_space }, + "application-version": str(allmydata.__version__), + } + return version def remote_allocate_buckets(self, storage_index, renew_secret, cancel_secret,