Commit 92582b33 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 5dfa6050
......@@ -918,6 +918,8 @@ func (f *BigFile) invalidateBlk(ctx context.Context, blk int64) (err error) {
}
// invalidateAttr invalidates file attributes in kernel cache.
//
// Complements invalidateBlk and is used to invalidate file size.
func (f *BigFile) invalidateAttr() (err error) {
defer xerr.Contextf(&err, "%s: invalidate attr", f.path())
fsconn := gfsconn
......@@ -950,6 +952,8 @@ func (root *Root) mkrevfile(rev zodb.Tid, fid zodb.Oid) (_ *BigFile, release fun
xfrev := fsconn.LookupNode(root.Inode(), frevpath)
if xfrev != nil {
// FIXME checking for "node{0}" is fragile, but currently no other way
// XXX the node could be still forgotten since we are not holding open on it
// XXX -> always os.open unconditionally? or it is ok since it is just a cache?
if xfrev.String() != "node{0}" {
return xfrev.Node().(*BigFile), func(){}, nil
}
......@@ -969,6 +973,10 @@ func (root *Root) mkrevfile(rev zodb.Tid, fid zodb.Oid) (_ *BigFile, release fun
// ----------------------------------------
// XXX Move Read here
// ----------------------------------------
// /(head|<rev>)/at -> readAt serves read.
func (h *Head) readAt() []byte {
h.zconnMu.RLock()
......@@ -1039,8 +1047,6 @@ func (bfdir *BigFileDir) lookup(out *fuse.Attr, name string, fctx *fuse.Context)
return f, nil
}
// XXX do we need to support unlink? -> no, @<revX>/ are automatically garbage-collected.
// / -> Lookup receives client request to create @<rev>/.
func (root *Root) Lookup(out *fuse.Attr, name string, fctx *fuse.Context) (*nodefs.Inode, fuse.Status) {
revd, err := root.lookup(name, fctx)
......@@ -1604,6 +1610,8 @@ func main() {
// TODO -> teach go-fuse to handle Init.MaxPages (Linux 4.20+).
MaxWrite: 2*1024*1024,
// XXX tune MaxReadAhead? MaxBackground?
// OS cache that we populate with bigfile data is precious;
// we precisely propagate ZODB invalidations into file invalidations.
PreciseDataCacheControl: true,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment