2024-07-02 18:37:53 +08:00
|
|
|
// Copyright 2015 gRPC authors.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package lws_vfs;
|
|
|
|
|
|
|
|
service LwsVfs {
|
|
|
|
// Sends a greeting
|
|
|
|
rpc SayHello(HelloRequest) returns (HelloReply) {}
|
|
|
|
|
|
|
|
rpc fgetattr(getattr) returns (getattr) {}
|
|
|
|
rpc fsetxattr(setxattr) returns (setxattr) {}
|
|
|
|
rpc faccess(access) returns (access) {}
|
|
|
|
rpc freaddir(readdir) returns (readdir) {}
|
|
|
|
rpc fread(read) returns (read) {}
|
|
|
|
rpc fopen(open) returns (open) {}
|
|
|
|
rpc fwrite(write) returns (write) {}
|
|
|
|
rpc fgetxattr(getxattr) returns (getxattr) {}
|
|
|
|
rpc ftruncate(truncate) returns (truncate) {}
|
|
|
|
rpc futimens(utimens) returns (utimens) {}
|
|
|
|
rpc fchown(chown) returns (chown) {}
|
|
|
|
rpc frelease(release) returns (release) {}
|
|
|
|
rpc fmkdir(mkdir) returns (mkdir) {}
|
2024-07-07 14:35:53 +08:00
|
|
|
rpc frmdir(rmdir) returns (rmdir) {}
|
|
|
|
rpc fflush(flush) returns (flush) {}
|
|
|
|
rpc fopendir(opendir) returns (opendir) {}
|
|
|
|
rpc freleasedir(releasedir) returns (releasedir) {}
|
2024-07-16 08:00:29 +08:00
|
|
|
rpc fcreate(create) returns (create) {}
|
2024-07-07 14:35:53 +08:00
|
|
|
rpc funlink(unlink) returns (unlink) {}
|
2024-07-16 08:00:29 +08:00
|
|
|
rpc frename(rename) returns (rename) {}
|
2024-07-02 18:37:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// The request message containing the user's name.
|
|
|
|
message HelloRequest { string name = 1; }
|
|
|
|
|
|
|
|
// The response message containing the greetings
|
|
|
|
message HelloReply { string message = 1; }
|
|
|
|
|
|
|
|
message file_info {
|
2024-07-23 08:51:09 +08:00
|
|
|
uint32 flags = 1;
|
2024-07-02 18:37:53 +08:00
|
|
|
uint32 fh_old = 2;
|
|
|
|
bool direct_io = 3;
|
|
|
|
uint64 fh = 10;
|
|
|
|
uint64 lock_owner = 11;
|
|
|
|
}
|
|
|
|
|
|
|
|
message fstat {
|
|
|
|
uint64 fst_mode = 1;
|
|
|
|
uint64 fst_ino = 2;
|
|
|
|
uint64 fst_dev = 3;
|
|
|
|
uint64 fst_rdev = 4;
|
|
|
|
uint64 fst_nlink = 5;
|
|
|
|
uint64 fst_uid = 6;
|
|
|
|
uint64 fst_gid = 7;
|
|
|
|
uint64 fst_size = 8;
|
|
|
|
uint64 fst_atime = 9;
|
|
|
|
uint64 fst_mtime = 10;
|
|
|
|
uint64 fst_ctime = 11;
|
|
|
|
uint64 fst_blksize = 12;
|
|
|
|
uint64 fst_blocks = 13;
|
|
|
|
}
|
|
|
|
|
|
|
|
// fuse api function message define:
|
|
|
|
message getattr {
|
|
|
|
string path = 1;
|
|
|
|
fstat stat = 2;
|
2024-07-23 08:51:09 +08:00
|
|
|
file_info fi = 3;
|
2024-07-02 18:37:53 +08:00
|
|
|
int32 ret = 15;
|
|
|
|
}
|
|
|
|
|
|
|
|
message setxattr {
|
|
|
|
string path = 1;
|
|
|
|
string name = 2;
|
|
|
|
bytes value = 3;
|
|
|
|
int64 size = 4;
|
|
|
|
uint32 flags = 5;
|
|
|
|
int32 ret = 15;
|
|
|
|
}
|
|
|
|
message getxattr {
|
|
|
|
string path = 1;
|
|
|
|
string name = 2;
|
|
|
|
bytes value = 3;
|
|
|
|
int64 size = 4;
|
|
|
|
int32 ret = 15;
|
|
|
|
}
|
|
|
|
|
|
|
|
message access {
|
|
|
|
string path = 1;
|
|
|
|
uint32 mask = 2;
|
|
|
|
int32 ret = 15;
|
|
|
|
}
|
|
|
|
|
2024-07-23 08:51:09 +08:00
|
|
|
message direntry {
|
|
|
|
string name = 1;
|
|
|
|
uint32 kind = 2;
|
|
|
|
}
|
|
|
|
|
2024-07-02 18:37:53 +08:00
|
|
|
message readdir {
|
|
|
|
string path = 1;
|
2024-07-23 08:51:09 +08:00
|
|
|
repeated direntry dirs = 2;
|
2024-07-02 18:37:53 +08:00
|
|
|
uint32 offset = 3;
|
|
|
|
file_info fi = 4;
|
|
|
|
int32 ret = 15;
|
|
|
|
}
|
|
|
|
|
|
|
|
message open {
|
|
|
|
string path = 1;
|
|
|
|
file_info fi = 2;
|
|
|
|
int32 ret = 15;
|
|
|
|
}
|
|
|
|
|
|
|
|
message read {
|
|
|
|
string path = 1;
|
|
|
|
bytes buff = 2;
|
|
|
|
int64 size = 3;
|
2024-07-23 08:51:09 +08:00
|
|
|
uint64 offset = 4;
|
2024-07-02 18:37:53 +08:00
|
|
|
file_info fi = 5;
|
|
|
|
int32 ret = 15;
|
|
|
|
}
|
|
|
|
|
|
|
|
message write {
|
|
|
|
string path = 1;
|
|
|
|
bytes buff = 2;
|
2024-07-23 08:51:09 +08:00
|
|
|
uint64 size = 3;
|
|
|
|
uint64 offset = 4;
|
2024-07-02 18:37:53 +08:00
|
|
|
file_info fi = 5;
|
|
|
|
int32 ret = 15;
|
|
|
|
}
|
|
|
|
|
|
|
|
message truncate {
|
|
|
|
string path = 1;
|
|
|
|
int64 size = 3;
|
|
|
|
int32 ret = 15;
|
|
|
|
}
|
|
|
|
|
|
|
|
message timespec {
|
|
|
|
int32 tv_sec = 1;
|
|
|
|
int64 tv_nsec = 2;
|
|
|
|
}
|
|
|
|
message utimens {
|
|
|
|
string path = 1;
|
|
|
|
repeated timespec ts = 2; // const struct timespec ts[2]
|
|
|
|
int32 ret = 15;
|
|
|
|
}
|
|
|
|
|
|
|
|
message chown {
|
|
|
|
string path = 1;
|
|
|
|
int32 uid = 2;
|
|
|
|
int32 gid = 3;
|
|
|
|
int32 ret = 15;
|
|
|
|
}
|
|
|
|
|
|
|
|
message release {
|
|
|
|
string path = 1;
|
|
|
|
file_info fi = 2;
|
2024-07-23 08:51:09 +08:00
|
|
|
uint32 flush = 3;
|
2024-07-02 18:37:53 +08:00
|
|
|
int32 ret = 15;
|
|
|
|
}
|
|
|
|
|
|
|
|
message mkdir {
|
|
|
|
string path = 1;
|
|
|
|
file_info fi = 2;
|
|
|
|
uint32 mode = 3;
|
|
|
|
int32 ret = 15;
|
|
|
|
}
|
2024-07-07 14:35:53 +08:00
|
|
|
|
|
|
|
message rmdir {
|
|
|
|
string path = 1;
|
|
|
|
int32 ret = 15;
|
|
|
|
}
|
|
|
|
|
|
|
|
message flush {
|
|
|
|
string path = 1;
|
|
|
|
file_info fi = 2;
|
|
|
|
int32 ret = 15;
|
|
|
|
}
|
|
|
|
|
2024-07-16 08:00:29 +08:00
|
|
|
message opendir {
|
2024-07-07 14:35:53 +08:00
|
|
|
string path = 1;
|
|
|
|
file_info fi = 2;
|
|
|
|
int32 ret = 15;
|
|
|
|
}
|
|
|
|
|
2024-07-16 08:00:29 +08:00
|
|
|
message releasedir {
|
2024-07-07 14:35:53 +08:00
|
|
|
string path = 1;
|
|
|
|
file_info fi = 2;
|
|
|
|
int32 ret = 15;
|
|
|
|
}
|
|
|
|
|
2024-07-16 08:00:29 +08:00
|
|
|
message create {
|
2024-07-07 14:35:53 +08:00
|
|
|
string path = 1;
|
|
|
|
uint32 mode = 2;
|
|
|
|
file_info fi = 3;
|
|
|
|
int32 ret = 15;
|
|
|
|
}
|
|
|
|
|
2024-07-16 08:00:29 +08:00
|
|
|
message unlink {
|
2024-07-07 14:35:53 +08:00
|
|
|
string path = 1;
|
|
|
|
int32 ret = 15;
|
2024-07-16 08:00:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
message rename {
|
|
|
|
string path = 1;
|
|
|
|
string new = 2;
|
|
|
|
int32 ret = 15;
|
2024-07-07 14:35:53 +08:00
|
|
|
}
|