Revert "pysdk: add command status (#5856)" (#5916)

This commit is contained in:
Frice Xu
2025-04-03 14:04:16 +08:00
committed by GitHub
parent 8e51eab3f1
commit 0bb980b27b
5 changed files with 92 additions and 199 deletions

View File

@@ -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()

View File

@@ -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):