From 686410420207be102b775866d37d9f3c97eb9cfd Mon Sep 17 00:00:00 2001 From: Denis Mikhalkin Date: Sun, 4 Aug 2013 00:48:41 +1000 Subject: [PATCH] #22 Store size as long --- dynamofuse/records/block.py | 2 +- dynamofuse/records/file.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dynamofuse/records/block.py b/dynamofuse/records/block.py index b55e602..11fa7e8 100644 --- a/dynamofuse/records/block.py +++ b/dynamofuse/records/block.py @@ -96,7 +96,7 @@ def writeData(self, startOffset, dataSlice): @staticmethod def getBlockItem(accessor, path, getData=False, forUpdate=False): try: - blockItem = accessor.blockTable.get_item(os.path.dirname(path), int(os.path.basename(path)), + blockItem = accessor.blockTable.get_item(os.path.dirname(path), long(os.path.basename(path)), attributes_to_get=(BlockRecord.BLOCK_ALL_ATTRS if getData else BlockRecord.BLOCK_ATTRS)) except DynamoDBKeyNotFoundError: blockItem = None diff --git a/dynamofuse/records/file.py b/dynamofuse/records/file.py index 91e8d60..cb22454 100644 --- a/dynamofuse/records/file.py +++ b/dynamofuse/records/file.py @@ -51,7 +51,7 @@ def create(self, accessor, path, attrs): if not "blockId" in attrs: attrs["blockId"] = str(self.accessor.allocUniqueId()) - attrs["st_ino"] = int(attrs["blockId"]) + attrs["st_ino"] = long(attrs["blockId"]) BaseRecord.create(self, accessor, path, attrs) @@ -83,7 +83,7 @@ def link(self): def getattr(self): block = self.getFirstBlock() block["st_blocks"] = (block["st_size"] + self.record["st_blksize"] - 1) / self.record["st_blksize"] - block["st_ino"] = int(self.record["blockId"]) + block["st_ino"] = long(self.record["blockId"]) return block def delete(self, duringMove=False):