Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pyfs
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pyfs
Commits
6593c470
Commit
6593c470
authored
Aug 05, 2009
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FUSE: use raw_fi in an attempt to control caching, but I don't think it achieved anything much.
parent
8d556b25
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
11 deletions
+18
-11
fs/base.py
+1
-0
fs/expose/fuse/__init__.py
+17
-11
No files found.
fs/base.py
View file @
6593c470
...
...
@@ -382,6 +382,7 @@ class FS(object):
chunk
=
data
.
read
(
1024
*
512
)
else
:
f
.
write
(
data
)
f
.
flush
()
finally
:
if
f
is
not
None
:
f
.
close
()
...
...
fs/expose/fuse/__init__.py
View file @
6593c470
...
...
@@ -143,7 +143,7 @@ class FSOperations(Operations):
def
_get_file
(
self
,
fh
):
try
:
return
self
.
_fhmap
[
fh
]
return
self
.
_fhmap
[
fh
.
fh
]
except
KeyError
:
raise
FSError
(
"invalid file handle"
)
...
...
@@ -157,6 +157,9 @@ class FSOperations(Operations):
finally
:
self
.
_fhmap_lock
.
release
()
def
_del_file
(
self
,
fh
):
del
self
.
_fhmap
[
fh
.
fh
]
def
init
(
self
,
conn
):
if
self
.
_on_init
:
self
.
_on_init
()
...
...
@@ -174,10 +177,10 @@ class FSOperations(Operations):
raise
UnsupportedError
(
"chown"
)
@handle_fs_errors
def
create
(
self
,
path
,
mode
,
fi
=
None
):
if
fi
is
not
None
:
raise
UnsupportedError
(
"raw_fi"
)
return
self
.
_reg_file
(
self
.
fs
.
open
(
path
,
"w"
))
def
create
(
self
,
path
,
mode
,
fi
):
fh
=
self
.
_reg_file
(
self
.
fs
.
open
(
path
,
"w"
))
fi
.
fh
=
fh
fi
.
keep_cache
=
0
@handle_fs_errors
def
flush
(
self
,
path
,
fh
):
...
...
@@ -226,9 +229,11 @@ class FSOperations(Operations):
raise
UnsupportedError
(
"mknod"
)
@handle_fs_errors
def
open
(
self
,
path
,
flags
):
mode
=
flags_to_mode
(
flags
)
return
self
.
_reg_file
(
self
.
fs
.
open
(
path
,
mode
))
def
open
(
self
,
path
,
fi
):
mode
=
flags_to_mode
(
fi
.
flags
)
fi
.
fh
=
self
.
_reg_file
(
self
.
fs
.
open
(
path
,
mode
))
fi
.
keep_cache
=
0
return
0
@handle_fs_errors
def
read
(
self
,
path
,
size
,
offset
,
fh
):
...
...
@@ -236,7 +241,8 @@ class FSOperations(Operations):
lock
.
acquire
()
try
:
file
.
seek
(
offset
)
return
file
.
read
(
size
)
data
=
file
.
read
(
size
)
return
data
finally
:
lock
.
release
()
...
...
@@ -266,7 +272,7 @@ class FSOperations(Operations):
lock
.
acquire
()
try
:
file
.
close
()
del
self
.
_fhmap
[
fh
]
self
.
_del_file
(
fh
)
finally
:
lock
.
release
()
...
...
@@ -368,7 +374,7 @@ def mount(fs,path,foreground=False,ready_callback=None,unmount_callback=None,**k
"""
if
foreground
:
op
=
FSOperations
(
fs
,
on_init
=
ready_callback
,
on_destroy
=
unmount_callback
)
return
FUSE
(
op
,
path
,
foreground
=
foreground
,
**
kwds
)
return
FUSE
(
op
,
path
,
raw_fi
=
True
,
foreground
=
foreground
,
**
kwds
)
else
:
mp
=
MountProcess
(
fs
,
path
,
kwds
)
if
ready_callback
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment