summaryrefslogtreecommitdiff
path: root/obnamlib/plugins/fuse_plugin.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2014-02-23 19:28:58 +0000
committerLars Wirzenius <liw@liw.fi>2014-02-23 19:28:58 +0000
commit52a9116177181608c936da7c71aa5a9ac9a63b04 (patch)
tree87894ca3d67505f07de4f5ea1c2d620fed7d038a /obnamlib/plugins/fuse_plugin.py
parent3723aceece805e764c93c8fe11f3fb0663496f7b (diff)
downloadobnam-52a9116177181608c936da7c71aa5a9ac9a63b04.tar.gz
Rename ObnamFile.fs to .fuse_fs
This way it's clearer that we refer to ObnamFuse, not an instance of obnamlib.VFS.
Diffstat (limited to 'obnamlib/plugins/fuse_plugin.py')
-rw-r--r--obnamlib/plugins/fuse_plugin.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/obnamlib/plugins/fuse_plugin.py b/obnamlib/plugins/fuse_plugin.py
index 5a073ec6..7a965cb7 100644
--- a/obnamlib/plugins/fuse_plugin.py
+++ b/obnamlib/plugins/fuse_plugin.py
@@ -68,7 +68,7 @@ class ObnamFuseOptParse(object):
class ObnamFuseFile(object):
- fs = None # points to active ObnamFuse object
+ fuse_fs = None # points to active ObnamFuse object
direct_io = False # do not use direct I/O on this file.
keep_cache = True # cached file data need not to be invalidated.
@@ -95,7 +95,7 @@ class ObnamFuseFile(object):
return
try:
- self.metadata = self.fs.get_metadata_in_generation(path)
+ self.metadata = self.fuse_fs.get_metadata_in_generation(path)
except:
logging.error('Unexpected exception', exc_info=True)
raise
@@ -114,12 +114,12 @@ class ObnamFuseFile(object):
return pid
def release_pid(self, flags):
- self.fs.root_refresh()
+ self.fuse_fs.root_refresh()
return 0
def fgetattr(self):
tracing.trace('called')
- return self.fs.getattr(self.path)
+ return self.fuse_fs.getattr(self.path)
def read(self, length, offset):
tracing.trace('self.path=%r', self.path)
@@ -129,11 +129,11 @@ class ObnamFuseFile(object):
if length == 0 or offset >= self.metadata.st_size:
return ''
- gen, repopath = self.fs.get_gen_path(self.path)
+ gen, repopath = self.fuse_fs.get_gen_path(self.path)
# The file's data content may be stored in the per-client B-tree.
# If so, we retrieve the data from there.
- contents = self.fs.obnam.repo.get_file_data(gen, repopath)
+ contents = self.fuse_fs.obnam.repo.get_file_data(gen, repopath)
if contents is not None:
return contents[offset:offset+length]
@@ -151,12 +151,12 @@ class ObnamFuseFile(object):
# the chunk size was fixed, except for the last chunk for any
# file.
- chunkids = self.fs.obnam.repo.get_file_chunks(gen, repopath)
+ chunkids = self.fuse_fs.obnam.repo.get_file_chunks(gen, repopath)
output = []
output_length = 0
chunk_pos_in_file = 0
for chunkid in chunkids:
- contents = self.fs.obnam.repo.get_chunk(chunkid)
+ contents = self.fuse_fs.obnam.repo.get_chunk(chunkid)
if chunk_pos_in_file + len(contents) >= offset:
start = offset - chunk_pos_in_file
n = length - output_length
@@ -199,7 +199,7 @@ class ObnamFuse(fuse.Fuse):
def __init__(self, *args, **kw):
self.obnam = kw['obnam']
- ObnamFuseFile.fs = self
+ ObnamFuseFile.fuse_fs = self
self.file_class = ObnamFuseFile
self.init_root()
fuse.Fuse.__init__(self, *args, **kw)