Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
bdd6be33
Commit
bdd6be33
authored
Dec 25, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
a974edc9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
10 deletions
+19
-10
wcfs/wcfs.go
wcfs/wcfs.go
+19
-10
No files found.
wcfs/wcfs.go
View file @
bdd6be33
...
...
@@ -631,13 +631,22 @@ func (f *BigFile) invalidateBlk(ctx context.Context, blk int64) error {
// /(head/<rev>)/bigfile/ -> Lookup receives client request to create (head|<rev>)/bigfile/<bigfileX>.
func
(
bfdir
*
BigFileDir
)
Lookup
(
out
*
fuse
.
Attr
,
name
string
,
fctx
*
fuse
.
Context
)
(
*
nodefs
.
Inode
,
fuse
.
Status
)
{
inode
,
err
:=
bfdir
.
lookup
(
out
,
name
,
fctx
)
// XXX reorder out?
f
,
err
:=
bfdir
.
lookup
(
out
,
name
,
fctx
)
// XXX reorder out?
var
inode
*
nodefs
.
Inode
if
f
!=
nil
{
inode
=
f
.
Inode
()
}
return
inode
,
err2LogStatus
(
err
)
}
func
(
bfdir
*
BigFileDir
)
lookup
(
out
*
fuse
.
Attr
,
name
string
,
fctx
*
fuse
.
Context
)
(
_
*
nodefs
.
Inod
e
,
err
error
)
{
func
(
bfdir
*
BigFileDir
)
lookup
(
out
*
fuse
.
Attr
,
name
string
,
fctx
*
fuse
.
Context
)
(
f
*
BigFil
e
,
err
error
)
{
defer
xerr
.
Contextf
(
&
err
,
"/bigfile: lookup %q"
,
name
)
defer
func
()
{
if
f
!=
nil
{
f
.
getattr
(
out
)
}
}()
oid
,
err
:=
zodb
.
ParseOid
(
name
)
if
err
!=
nil
{
...
...
@@ -650,8 +659,7 @@ func (bfdir *BigFileDir) lookup(out *fuse.Attr, name string, fctx *fuse.Context)
bfdir
.
mu
.
Unlock
()
if
already
{
// XXX fill out
return
f
.
Inode
(),
nil
return
f
,
nil
}
// not there - without bfdir lock proceed to open BigFile from ZODB
...
...
@@ -667,7 +675,7 @@ func (bfdir *BigFileDir) lookup(out *fuse.Attr, name string, fctx *fuse.Context)
if
already
{
bfdir
.
mu
.
Unlock
()
f
.
Close
()
return
f2
.
Inode
(),
nil
// XXX fill out
return
f2
,
nil
}
bfdir
.
tab
[
oid
]
=
f
...
...
@@ -676,8 +684,7 @@ func (bfdir *BigFileDir) lookup(out *fuse.Attr, name string, fctx *fuse.Context)
// mkfile takes filesystem treeLock - do it outside bfdir.mu
mkfile
(
bfdir
,
name
,
f
)
// XXX fill out
return
f
.
Inode
(),
nil
return
f
,
nil
}
// XXX do we need to support unlink? (probably no)
...
...
@@ -812,9 +819,13 @@ func (f *BigFile) Close() error {
}
// /(head|<rev>)/bigfile/<bigfileX> -> Getattr serves stat.
func
(
f
*
BigFile
)
GetAttr
(
out
*
fuse
.
Attr
,
_
nodefs
.
File
,
fctx
*
fuse
.
Context
)
fuse
.
Status
{
func
(
f
*
BigFile
)
GetAttr
(
out
*
fuse
.
Attr
,
_
nodefs
.
File
,
_
*
fuse
.
Context
)
fuse
.
Status
{
// XXX locking
f
.
getattr
(
out
)
return
fuse
.
OK
}
func
(
f
*
BigFile
)
getattr
(
out
*
fuse
.
Attr
)
{
out
.
Mode
=
fuse
.
S_IFREG
|
0444
out
.
Size
=
uint64
(
f
.
zbfSize
)
// .Blocks
...
...
@@ -826,8 +837,6 @@ func (f *BigFile) GetAttr(out *fuse.Attr, _ nodefs.File, fctx *fuse.Context) fus
mtime
:=
lastChange
.
Time
()
.
Time
out
.
SetTimes
(
/*atime=*/
nil
,
/*mtime=*/
&
mtime
,
/*ctime=*/
&
mtime
)
return
fuse
.
OK
}
...
...
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