Beispiel #1
0
// Acknowledge release of file handle by kernel
func (sc *serveConn) release(req *fuse.ReleaseRequest) {
	sc.Lock()
	defer sc.Unlock()
	h := sc.handles[req.Handle]
	if h.writer != nil {
		h.writer.Close()
		/*
			fileId, err := sc.db.FileIdForInode(uint64(h.inode))
			if err != nil {
				log.Printf("failed to lookup inode for close: %v\n", err)
				req.RespondError(fuse.EIO)
				return
			}

			l := &drive.FileLabels{Hidden: false}
			f := drive.File{Id: fileId, Labels: l}
			if _, err = sc.service.Files.Update(fileId, &f).Do(); err != nil {
				log.Printf("failed to mark inode %v not hidden: %v\n", h.inode, err)
				req.RespondError(fuse.EIO)
				return
			}
		*/
	}
	h.inode = 0
	req.Respond()
}
Beispiel #2
0
func (o openFileHandle) Release(request *fuse.ReleaseRequest, intr fs.Intr) fuse.Error {
	log.Printf("Request: %+v\nObject: %+v\n", request, o)
	if o.parent.openHandles[o.name].handleNum == 1 {
		o.parent.RemoveHandle(o.name)
	} else {
		o.parent.openHandles[o.name].handleNum--
	}
	request.Respond()
	return nil //fuse.ENOENT
}
Beispiel #3
0
func (f *fs) handleRelease(r *fuse.ReleaseRequest) {
	log.Println("Inside handleRelease")
	f.handles.removeFileHandle(r.Handle)
	r.Respond()
}