Bump reva to 85468735db
To get new GetUserNoGroups() helper
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
||||
//go:build !(octopus || pacific || quincy || reef || squid) && ceph_preview
|
||||
|
||||
package admin
|
||||
|
||||
// SubVolumeSnapshotPath returns the path for a snapshot from the source subvolume.
|
||||
//
|
||||
// Similar To:
|
||||
//
|
||||
// ceph fs subvolume snapshot getpath <volume> --group-name=<group> <source> <name>
|
||||
func (fsa *FSAdmin) SubVolumeSnapshotPath(volume, group, source, name string) (string, error) {
|
||||
m := map[string]string{
|
||||
"prefix": "fs subvolume snapshot getpath",
|
||||
"vol_name": volume,
|
||||
"sub_name": source,
|
||||
"snap_name": name,
|
||||
"format": "json",
|
||||
}
|
||||
if group != NoGroup {
|
||||
m["group_name"] = group
|
||||
}
|
||||
return parsePathResponse(fsa.marshalMgrCommand(m))
|
||||
}
|
||||
+6
-2
@@ -7,6 +7,10 @@ package cephfs
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <cephfs/libcephfs.h>
|
||||
|
||||
int _go_ceph_fchown(struct ceph_mount_info *cmount, int fd, uid_t uid, gid_t gid) {
|
||||
return ceph_fchown(cmount, fd, uid, gid);
|
||||
}
|
||||
*/
|
||||
import "C"
|
||||
|
||||
@@ -278,13 +282,13 @@ func (f *File) Fchmod(mode uint32) error {
|
||||
//
|
||||
// Implements:
|
||||
//
|
||||
// int ceph_fchown(struct ceph_mount_info *cmount, int fd, int uid, int gid);
|
||||
// int ceph_fchown(struct ceph_mount_info *cmount, int fd, uid_t uid, gid_t gid);
|
||||
func (f *File) Fchown(user uint32, group uint32) error {
|
||||
if err := f.validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
ret := C.ceph_fchown(f.mount.mount, f.fd, C.int(user), C.int(group))
|
||||
ret := C._go_ceph_fchown(f.mount.mount, f.fd, C.uid_t(user), C.gid_t(group))
|
||||
return getError(ret)
|
||||
}
|
||||
|
||||
|
||||
+10
-2
@@ -5,6 +5,14 @@ package cephfs
|
||||
#cgo CPPFLAGS: -D_FILE_OFFSET_BITS=64
|
||||
#include <stdlib.h>
|
||||
#include <cephfs/libcephfs.h>
|
||||
|
||||
int _go_ceph_chown(struct ceph_mount_info *cmount, const char *path, uid_t uid, gid_t gid) {
|
||||
return ceph_chown(cmount, path, uid, gid);
|
||||
}
|
||||
|
||||
int _go_ceph_lchown(struct ceph_mount_info *cmount, const char *path, uid_t uid, gid_t gid) {
|
||||
return ceph_lchown(cmount, path, uid, gid);
|
||||
}
|
||||
*/
|
||||
import "C"
|
||||
|
||||
@@ -26,7 +34,7 @@ func (mount *MountInfo) Chown(path string, user uint32, group uint32) error {
|
||||
cPath := C.CString(path)
|
||||
defer C.free(unsafe.Pointer(cPath))
|
||||
|
||||
ret := C.ceph_chown(mount.mount, cPath, C.int(user), C.int(group))
|
||||
ret := C._go_ceph_chown(mount.mount, cPath, C.uid_t(user), C.gid_t(group))
|
||||
return getError(ret)
|
||||
}
|
||||
|
||||
@@ -35,6 +43,6 @@ func (mount *MountInfo) Lchown(path string, user uint32, group uint32) error {
|
||||
cPath := C.CString(path)
|
||||
defer C.free(unsafe.Pointer(cPath))
|
||||
|
||||
ret := C.ceph_lchown(mount.mount, cPath, C.int(user), C.int(group))
|
||||
ret := C._go_ceph_lchown(mount.mount, cPath, C.uid_t(user), C.gid_t(group))
|
||||
return getError(ret)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user