Trouble Retrieving Directory Size and Quota Using go-ceph/cephfs #948
-
Hello everyone, I am trying to use go-ceph/cephfs to get the size of a specific directory on cephfs and the quota set for it. I tried using entry.Statx(), but the Size I got is 0, and Blocks is also 0. Here's my code:
Can anyone help me understand what might be going wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
In the past, I obtained the directory size and quota by mounting ceph-fuse to the device and then using the commands |
Beta Was this translation helpful? Give feedback.
-
The Alternatively you could use the extended attribute method with https://pkg.go.dev/github.com/ceph/[email protected]/cephfs#File.GetXattr |
Beta Was this translation helpful? Give feedback.
The
dir.ReadDirPlus(0, 0)
that you do, passes0
forStatxMask
. You will need to pass a mask of values likeStatxMode
as defined on https://pkg.go.dev/github.com/ceph/[email protected]/cephfs#pkg-constants.Alternatively you could use the extended attribute method with https://pkg.go.dev/github.com/ceph/[email protected]/cephfs#File.GetXattr