Skip to content

cephfs quota set #826

Closed Answered by phlogistonjohn
QZB349549482 asked this question in Q&A
Feb 3, 2023 · 3 comments · 3 replies
Discussion options

You must be logged in to vote

So, the setfattr tool will end up calling linux syscalls like setxattr & lsetxattr. As you've determined the cephfs api calls are similarly named. The tool's -n option corresponds to the name argument. The tool's -v argument corresponds to the value argument. Since no special arguments are being passed for the value or encoding, you simply want to convert the value (
100000000, 10000) directly as a string, and convert that to a byte slice. Roughly, that'd be:

path := "/your/path/here"
name := "ceph.quota.max_bytes"
value := []byte("10000")
err := mount.LsetXattr(path, name, value, XattrDefault)
// ...handle errors...

You can also pass flags if you need them, but generally the default (0) …

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@QZB349549482
Comment options

@phlogistonjohn
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@QZB349549482
Comment options

Answer selected by anoopcs9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants