mirror of
https://gitee.com/juicedata/JuiceFS.git
synced 2025-12-06 17:49:22 +08:00
@@ -1601,24 +1601,6 @@ func jfs_clone(pid int64, h int64, _src *C.char, _dst *C.char, preserve bool) in
|
||||
return errno(err)
|
||||
}
|
||||
|
||||
//export jfs_status
|
||||
func jfs_status(pid int64, h int64, trash bool, session uint64, p_buf **byte) int32 {
|
||||
w := F(h)
|
||||
if w == nil {
|
||||
return EINVAL
|
||||
}
|
||||
ctx := w.withPid(pid)
|
||||
res, err := w.Status(ctx, trash, session)
|
||||
if err != nil {
|
||||
logger.Errorf("status %s: %s", ctx, err)
|
||||
}
|
||||
|
||||
*p_buf = (*byte)(C.malloc(C.size_t(len(res))))
|
||||
buf := unsafe.Slice(*p_buf, len(res))
|
||||
|
||||
return int32(copy(buf, res))
|
||||
}
|
||||
|
||||
//export jfs_lseek
|
||||
func jfs_lseek(pid int64, fd int32, offset int64, whence int64) int64 {
|
||||
filesLock.Lock()
|
||||
|
||||
@@ -390,13 +390,6 @@ class Client(object):
|
||||
return res
|
||||
|
||||
|
||||
def status(self, trash = False, session = 0):
|
||||
buf = c_void_p()
|
||||
n = self.lib.jfs_status(c_int64(_tid()), c_int64(self.h), c_bool(trash), c_bool(session), byref(buf))
|
||||
res = json.loads(str(string_at(buf, n), encoding='utf-8'))
|
||||
self.lib.free(buf)
|
||||
return res
|
||||
|
||||
class File(object):
|
||||
"""A JuiceFS file."""
|
||||
def __init__(self, lib, fd, path, mode, flag, length, buffering, encoding, errors):
|
||||
|
||||
Reference in New Issue
Block a user