Skip to content
This repository has been archived by the owner on Dec 13, 2021. It is now read-only.

improve-hookfs #12

Merged
merged 2 commits into from
Apr 23, 2019
Merged

improve-hookfs #12

merged 2 commits into from
Apr 23, 2019

Conversation

qiffang
Copy link
Contributor

@qiffang qiffang commented Apr 23, 2019

Function

  • Add rename hook
    In prometheus tsdb, it needs this scene

  • Use go module
    Use go-fuse 1.0, but interface of nodefs.File are changed

//implements nodefs,GetLk
func (h *hookFile) GetLk(owner uint64, lk *fuse.FileLock, flags uint32, out *fuse.FileLock) (code fuse.Status) {
	return h.file.GetLk(owner, lk, flags, out)
}

//implements nodefs.SetLk
func (h *hookFile) SetLk(owner uint64, lk *fuse.FileLock, flags uint32) (code fuse.Status) {
	return h.file.SetLk(owner, lk, flags)
}

//implements nodefs,SetLkw
func (h *hookFile) SetLkw(owner uint64, lk *fuse.FileLock, flags uint32) (code fuse.Status) {
	return h.file.SetLkw(owner, lk, flags)
}
  • Support test case
    Actually, we do not need to unmount mountpoint by the manual way.
    We can unmount it by this way in test case
syscall.Unmount(mountpoint, -1) //of course, it also call fusermount command

cmd/ex01/main.go Outdated
@@ -3,22 +3,20 @@ package main
import (
"flag"
"fmt"
"github.com/qiffang/hookfs/pkg/example"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

osrg/hooks ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@AkihiroSuda
Copy link
Member

thanks, could you also sign the commit with git commit -s?

Signed-off-by: qiffang <[email protected]>
@qiffang
Copy link
Contributor Author

qiffang commented Apr 23, 2019

thanks, could you also sign the commit with git commit -s?

Done and thanks

@AkihiroSuda AkihiroSuda merged commit 7d2c6ba into osrg:master Apr 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants