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):
...
@@ -382,6 +382,7 @@ class FS(object):
chunk
=
data
.
read
(
1024
*
512
)
chunk
=
data
.
read
(
1024
*
512
)
else
:
else
:
f
.
write
(
data
)
f
.
write
(
data
)
f
.
flush
()
finally
:
finally
:
if
f
is
not
None
:
if
f
is
not
None
:
f
.
close
()
f
.
close
()
...
...
fs/expose/fuse/__init__.py
View file @
6593c470
...
@@ -143,7 +143,7 @@ class FSOperations(Operations):
...
@@ -143,7 +143,7 @@ class FSOperations(Operations):
def
_get_file
(
self
,
fh
):
def
_get_file
(
self
,
fh
):
try
:
try
:
return
self
.
_fhmap
[
fh
]
return
self
.
_fhmap
[
fh
.
fh
]
except
KeyError
:
except
KeyError
:
raise
FSError
(
"invalid file handle"
)
raise
FSError
(
"invalid file handle"
)
...
@@ -157,6 +157,9 @@ class FSOperations(Operations):
...
@@ -157,6 +157,9 @@ class FSOperations(Operations):
finally
:
finally
:
self
.
_fhmap_lock
.
release
()
self
.
_fhmap_lock
.
release
()
def
_del_file
(
self
,
fh
):
del
self
.
_fhmap
[
fh
.
fh
]
def
init
(
self
,
conn
):
def
init
(
self
,
conn
):
if
self
.
_on_init
:
if
self
.
_on_init
:
self
.
_on_init
()
self
.
_on_init
()
...
@@ -174,10 +177,10 @@ class FSOperations(Operations):
...
@@ -174,10 +177,10 @@ class FSOperations(Operations):
raise
UnsupportedError
(
"chown"
)
raise
UnsupportedError
(
"chown"
)
@handle_fs_errors
@handle_fs_errors
def
create
(
self
,
path
,
mode
,
fi
=
None
):
def
create
(
self
,
path
,
mode
,
fi
):
if
fi
is
not
None
:
fh
=
self
.
_reg_file
(
self
.
fs
.
open
(
path
,
"w"
))
raise
UnsupportedError
(
"raw_fi"
)
fi
.
fh
=
fh
return
self
.
_reg_file
(
self
.
fs
.
open
(
path
,
"w"
))
fi
.
keep_cache
=
0
@handle_fs_errors
@handle_fs_errors
def
flush
(
self
,
path
,
fh
):
def
flush
(
self
,
path
,
fh
):
...
@@ -226,9 +229,11 @@ class FSOperations(Operations):
...
@@ -226,9 +229,11 @@ class FSOperations(Operations):
raise
UnsupportedError
(
"mknod"
)
raise
UnsupportedError
(
"mknod"
)
@handle_fs_errors
@handle_fs_errors
def
open
(
self
,
path
,
flags
):
def
open
(
self
,
path
,
fi
):
mode
=
flags_to_mode
(
flags
)
mode
=
flags_to_mode
(
fi
.
flags
)
return
self
.
_reg_file
(
self
.
fs
.
open
(
path
,
mode
))
fi
.
fh
=
self
.
_reg_file
(
self
.
fs
.
open
(
path
,
mode
))
fi
.
keep_cache
=
0
return
0
@handle_fs_errors
@handle_fs_errors
def
read
(
self
,
path
,
size
,
offset
,
fh
):
def
read
(
self
,
path
,
size
,
offset
,
fh
):
...
@@ -236,7 +241,8 @@ class FSOperations(Operations):
...
@@ -236,7 +241,8 @@ class FSOperations(Operations):
lock
.
acquire
()
lock
.
acquire
()
try
:
try
:
file
.
seek
(
offset
)
file
.
seek
(
offset
)
return
file
.
read
(
size
)
data
=
file
.
read
(
size
)
return
data
finally
:
finally
:
lock
.
release
()
lock
.
release
()
...
@@ -266,7 +272,7 @@ class FSOperations(Operations):
...
@@ -266,7 +272,7 @@ class FSOperations(Operations):
lock
.
acquire
()
lock
.
acquire
()
try
:
try
:
file
.
close
()
file
.
close
()
del
self
.
_fhmap
[
fh
]
self
.
_del_file
(
fh
)
finally
:
finally
:
lock
.
release
()
lock
.
release
()
...
@@ -368,7 +374,7 @@ def mount(fs,path,foreground=False,ready_callback=None,unmount_callback=None,**k
...
@@ -368,7 +374,7 @@ def mount(fs,path,foreground=False,ready_callback=None,unmount_callback=None,**k
"""
"""
if
foreground
:
if
foreground
:
op
=
FSOperations
(
fs
,
on_init
=
ready_callback
,
on_destroy
=
unmount_callback
)
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
:
else
:
mp
=
MountProcess
(
fs
,
path
,
kwds
)
mp
=
MountProcess
(
fs
,
path
,
kwds
)
if
ready_callback
:
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