Revision 6872ae79
b/snf-pithos-backend/pithos/backends/lib/hashfiler/radosblocker.py | ||
---|---|---|
78 | 78 |
def _pad(self, block): |
79 | 79 |
return block + ('\x00' * (self.blocksize - len(block))) |
80 | 80 |
|
81 |
def _get_rear_block(self, blkhash, create=0):
|
|
81 |
def _get_rear_block(self, blkhash): |
|
82 | 82 |
name = hexlify(blkhash) |
83 |
return RadosObject(name, self.ioctx, create)
|
|
83 |
return RadosObject(name, self.ioctx) |
|
84 | 84 |
|
85 | 85 |
def _check_rear_block(self, blkhash): |
86 | 86 |
filename = hexlify(blkhash) |
b/snf-pithos-backend/pithos/backends/lib/hashfiler/radosmapper.py | ||
---|---|---|
60 | 60 |
self.rados = rados |
61 | 61 |
self.ioctx = ioctx |
62 | 62 |
|
63 |
def _get_rear_map(self, maphash, create=0):
|
|
63 |
def _get_rear_map(self, maphash): |
|
64 | 64 |
name = hexlify(maphash) |
65 |
return RadosObject(name, self.ioctx, create)
|
|
65 |
return RadosObject(name, self.ioctx) |
|
66 | 66 |
|
67 | 67 |
def _check_rear_map(self, maphash): |
68 | 68 |
name = hexlify(maphash) |
... | ... | |
85 | 85 |
hashes = list(rmap.sync_read_chunks(namelen, nr, blkoff)) |
86 | 86 |
return hashes |
87 | 87 |
|
88 |
def map_stor(self, maphash, hashes=(), blkoff=0, create=1):
|
|
88 |
def map_stor(self, maphash, hashes=(), blkoff=0): |
|
89 | 89 |
"""Store hashes in the given hashes map.""" |
90 | 90 |
namelen = self.namelen |
91 | 91 |
if self._check_rear_map(maphash): |
92 | 92 |
return |
93 |
with self._get_rear_map(maphash, 1) as rmap:
|
|
93 |
with self._get_rear_map(maphash) as rmap: |
|
94 | 94 |
rmap.sync_write_chunks(namelen, blkoff, hashes, None) |
Also available in: Unified diff