mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-06 04:09:40 -06:00
10
vendor/github.com/ceph/go-ceph/cephfs/command.go
generated
vendored
10
vendor/github.com/ceph/go-ceph/cephfs/command.go
generated
vendored
@@ -19,12 +19,22 @@ func cephBufferFree(p unsafe.Pointer) {
|
||||
}
|
||||
|
||||
// MdsCommand sends commands to the specified MDS.
|
||||
//
|
||||
// The args parameter takes a slice of byte slices but typically a single
|
||||
// slice element is sufficient. The use of two slices exists to best match
|
||||
// the structure of the underlying C call which is often a legacy interface
|
||||
// in Ceph.
|
||||
func (mount *MountInfo) MdsCommand(mdsSpec string, args [][]byte) ([]byte, string, error) {
|
||||
return mount.mdsCommand(mdsSpec, args, nil)
|
||||
}
|
||||
|
||||
// MdsCommandWithInputBuffer sends commands to the specified MDS, with an input
|
||||
// buffer.
|
||||
//
|
||||
// The args parameter takes a slice of byte slices but typically a single
|
||||
// slice element is sufficient. The use of two slices exists to best match
|
||||
// the structure of the underlying C call which is often a legacy interface
|
||||
// in Ceph.
|
||||
func (mount *MountInfo) MdsCommandWithInputBuffer(mdsSpec string, args [][]byte, inputBuffer []byte) ([]byte, string, error) {
|
||||
return mount.mdsCommand(mdsSpec, args, inputBuffer)
|
||||
}
|
||||
|
||||
17
vendor/github.com/ceph/go-ceph/cephfs/file_fd.go
generated
vendored
Normal file
17
vendor/github.com/ceph/go-ceph/cephfs/file_fd.go
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
//go:build ceph_preview
|
||||
|
||||
package cephfs
|
||||
|
||||
// Fd returns the integer open file descriptor in cephfs.
|
||||
// NOTE: It doesn't make sense to consume the returned integer fd anywhere
|
||||
// outside CephFS and is recommended not to do so given the undefined behaviour.
|
||||
// Also, as seen with the Go standard library, the fd is only valid as long as
|
||||
// the corresponding File object is intact in the sense that an fd from a closed
|
||||
// File object is invalid.
|
||||
func (f *File) Fd() int {
|
||||
if f == nil || f.mount == nil {
|
||||
return -1
|
||||
}
|
||||
|
||||
return int(f.fd)
|
||||
}
|
||||
46
vendor/github.com/ceph/go-ceph/cephfs/file_futime.go
generated
vendored
Normal file
46
vendor/github.com/ceph/go-ceph/cephfs/file_futime.go
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
//go:build ceph_preview
|
||||
|
||||
package cephfs
|
||||
|
||||
// Futime changes file/directory last access and modification times.
|
||||
//
|
||||
// Implements:
|
||||
//
|
||||
// int ceph_futime(struct ceph_mount_info *cmount, int fd, struct utimbuf *buf);
|
||||
func (f *File) Futime(times *Utime) error {
|
||||
if err := f.validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return f.mount.Futime(int(f.fd), times)
|
||||
}
|
||||
|
||||
// Futimens changes file/directory last access and modification times, here times param
|
||||
// is an array of Timespec struct having length 2, where times[0] represents the access time
|
||||
// and times[1] represents the modification time.
|
||||
//
|
||||
// Implements:
|
||||
//
|
||||
// int ceph_futimens(struct ceph_mount_info *cmount, int fd, struct timespec times[2]);
|
||||
func (f *File) Futimens(times []Timespec) error {
|
||||
if err := f.validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return f.mount.Futimens(int(f.fd), times)
|
||||
}
|
||||
|
||||
// Futimes changes file/directory last access and modification times, here times param
|
||||
// is an array of Timeval struct type having length 2, where times[0] represents the access time
|
||||
// and times[1] represents the modification time.
|
||||
//
|
||||
// Implements:
|
||||
//
|
||||
// int ceph_futimes(struct ceph_mount_info *cmount, int fd, struct timeval times[2]);
|
||||
func (f *File) Futimes(times []Timeval) error {
|
||||
if err := f.validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return f.mount.Futimes(int(f.fd), times)
|
||||
}
|
||||
2
vendor/github.com/ceph/go-ceph/cephfs/fscompat.go
generated
vendored
2
vendor/github.com/ceph/go-ceph/cephfs/fscompat.go
generated
vendored
@@ -1,5 +1,3 @@
|
||||
//go:build ceph_preview
|
||||
|
||||
package cephfs
|
||||
|
||||
import (
|
||||
|
||||
48
vendor/github.com/ceph/go-ceph/rados/command.go
generated
vendored
48
vendor/github.com/ceph/go-ceph/rados/command.go
generated
vendored
@@ -43,6 +43,11 @@ func (c *Conn) MonCommandWithInputBuffer(args, inputBuffer []byte) ([]byte, stri
|
||||
|
||||
// PGCommand sends a command to one of the PGs
|
||||
//
|
||||
// The args parameter takes a slice of byte slices but typically a single
|
||||
// slice element is sufficient. The use of two slices exists to best match
|
||||
// the structure of the underlying C call which is often a legacy interface
|
||||
// in Ceph.
|
||||
//
|
||||
// Implements:
|
||||
//
|
||||
// int rados_pg_command(rados_t cluster, const char *pgstr,
|
||||
@@ -56,6 +61,11 @@ func (c *Conn) PGCommand(pgid []byte, args [][]byte) ([]byte, string, error) {
|
||||
|
||||
// PGCommandWithInputBuffer sends a command to one of the PGs, with an input buffer
|
||||
//
|
||||
// The args parameter takes a slice of byte slices but typically a single
|
||||
// slice element is sufficient. The use of two slices exists to best match
|
||||
// the structure of the underlying C call which is often a legacy interface
|
||||
// in Ceph.
|
||||
//
|
||||
// Implements:
|
||||
//
|
||||
// int rados_pg_command(rados_t cluster, const char *pgstr,
|
||||
@@ -87,19 +97,29 @@ func (c *Conn) PGCommandWithInputBuffer(pgid []byte, args [][]byte, inputBuffer
|
||||
}
|
||||
|
||||
// MgrCommand sends a command to a ceph-mgr.
|
||||
//
|
||||
// The args parameter takes a slice of byte slices but typically a single
|
||||
// slice element is sufficient. The use of two slices exists to best match
|
||||
// the structure of the underlying C call which is often a legacy interface
|
||||
// in Ceph.
|
||||
func (c *Conn) MgrCommand(args [][]byte) ([]byte, string, error) {
|
||||
return c.MgrCommandWithInputBuffer(args, nil)
|
||||
}
|
||||
|
||||
// MgrCommandWithInputBuffer sends a command, with an input buffer, to a ceph-mgr.
|
||||
//
|
||||
// The args parameter takes a slice of byte slices but typically a single
|
||||
// slice element is sufficient. The use of two slices exists to best match
|
||||
// the structure of the underlying C call which is often a legacy interface
|
||||
// in Ceph.
|
||||
//
|
||||
// Implements:
|
||||
//
|
||||
// int rados_mgr_command(rados_t cluster, const char **cmd,
|
||||
// size_t cmdlen, const char *inbuf,
|
||||
// size_t inbuflen, char **outbuf,
|
||||
// size_t *outbuflen, char **outs,
|
||||
// size_t *outslen);
|
||||
// size_t cmdlen, const char *inbuf,
|
||||
// size_t inbuflen, char **outbuf,
|
||||
// size_t *outbuflen, char **outs,
|
||||
// size_t *outslen);
|
||||
func (c *Conn) MgrCommandWithInputBuffer(args [][]byte, inputBuffer []byte) ([]byte, string, error) {
|
||||
ci := cutil.NewCommandInput(args, inputBuffer)
|
||||
defer ci.Free()
|
||||
@@ -121,6 +141,11 @@ func (c *Conn) MgrCommandWithInputBuffer(args [][]byte, inputBuffer []byte) ([]b
|
||||
}
|
||||
|
||||
// OsdCommand sends a command to the specified ceph OSD.
|
||||
//
|
||||
// The args parameter takes a slice of byte slices but typically a single
|
||||
// slice element is sufficient. The use of two slices exists to best match
|
||||
// the structure of the underlying C call which is often a legacy interface
|
||||
// in Ceph.
|
||||
func (c *Conn) OsdCommand(osd int, args [][]byte) ([]byte, string, error) {
|
||||
return c.OsdCommandWithInputBuffer(osd, args, nil)
|
||||
}
|
||||
@@ -128,6 +153,11 @@ func (c *Conn) OsdCommand(osd int, args [][]byte) ([]byte, string, error) {
|
||||
// OsdCommandWithInputBuffer sends a command, with an input buffer, to the
|
||||
// specified ceph OSD.
|
||||
//
|
||||
// The args parameter takes a slice of byte slices but typically a single
|
||||
// slice element is sufficient. The use of two slices exists to best match
|
||||
// the structure of the underlying C call which is often a legacy interface
|
||||
// in Ceph.
|
||||
//
|
||||
// Implements:
|
||||
//
|
||||
// int rados_osd_command(rados_t cluster, int osdid,
|
||||
@@ -159,12 +189,22 @@ func (c *Conn) OsdCommandWithInputBuffer(
|
||||
}
|
||||
|
||||
// MonCommandTarget sends a command to a specified monitor.
|
||||
//
|
||||
// The args parameter takes a slice of byte slices but typically a single
|
||||
// slice element is sufficient. The use of two slices exists to best match
|
||||
// the structure of the underlying C call which is often a legacy interface
|
||||
// in Ceph.
|
||||
func (c *Conn) MonCommandTarget(name string, args [][]byte) ([]byte, string, error) {
|
||||
return c.MonCommandTargetWithInputBuffer(name, args, nil)
|
||||
}
|
||||
|
||||
// MonCommandTargetWithInputBuffer sends a command, with an input buffer, to a specified monitor.
|
||||
//
|
||||
// The args parameter takes a slice of byte slices but typically a single
|
||||
// slice element is sufficient. The use of two slices exists to best match
|
||||
// the structure of the underlying C call which is often a legacy interface
|
||||
// in Ceph.
|
||||
//
|
||||
// Implements:
|
||||
//
|
||||
// int rados_mon_command_target(rados_t cluster, const char *name,
|
||||
|
||||
Reference in New Issue
Block a user