Exemple #1
0
func (me *workerFuseFs) update(attrs []*attr.FileAttr) {
	updates := map[string]*fs.Result{}
	for _, attr := range attrs {
		path := strings.TrimLeft(attr.Path, "/")
		if !strings.HasPrefix(path, me.writableRoot) {
			me.rpcNodeFs.Notify(path)
			continue
		}
		path = strings.TrimLeft(path[len(me.writableRoot):], "/")

		if attr.Deletion() {
			updates[path] = &fs.Result{}
		} else {
			r := fs.Result{
				Original: "",
				Backing:  "",
				Link:     attr.Link,
				Attr:     &fuse.Attr{},
			}
			a := *attr.Attr
			r.Attr = &a
			updates[path] = &r
		}
	}
	me.unionFs.Update(updates)
}
Exemple #2
0
func (fs *workerFS) update(attrs []*attr.FileAttr) {
	updates := map[string]*termitefs.Result{}
	for _, attr := range attrs {
		path := strings.TrimLeft(attr.Path, "/")
		if !strings.HasPrefix(path, fs.fuseFS.writableRoot) {
			dir, name := filepath.Split(path)

			// As file contents are immutable, we must
			// invalidate the entry instead
			fs.fuseFS.rpcNodeFS.EntryNotify(filepath.Join(fs.id, dir), name)
			continue
		}
		path = strings.TrimLeft(path[len(fs.fuseFS.writableRoot):], "/")

		if attr.Deletion() {
			updates[path] = &termitefs.Result{}
		} else {
			r := termitefs.Result{
				Original: "",
				Backing:  "",
				Link:     attr.Link,
				Attr:     &fuse.Attr{},
			}
			a := *attr.Attr
			r.Attr = &a
			updates[path] = &r
		}
	}
	fs.unionFs.Update(updates)
}