-
Notifications
You must be signed in to change notification settings - Fork 949
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: make all quota implementation logic clear
Signed-off-by: Allen Sun <[email protected]>
- Loading branch information
1 parent
3a53801
commit 6210a15
Showing
9 changed files
with
455 additions
and
323 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// +build linux | ||
|
||
package system | ||
|
||
import ( | ||
"syscall" | ||
|
||
"github.com/sirupsen/logrus" | ||
) | ||
|
||
// GetDevID returns device id via syscall according to the input directory. | ||
func GetDevID(dir string) (uint64, error) { | ||
var st syscall.Stat_t | ||
if err := syscall.Stat(dir, &st); err != nil { | ||
logrus.Warnf("failed to get device id of dir %s: %v", dir, err) | ||
return 0, err | ||
} | ||
return st.Dev, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// +build linux | ||
|
||
package system | ||
|
||
import ( | ||
|
Oops, something went wrong.