forked from opencurve/curve
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibcurvefs.h
73 lines (60 loc) · 2.25 KB
/
libcurvefs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
* Copyright (c) 2020 NetEase Inc.
*
* 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.
*/
/*
* Project: curve
* File Created: Tuesday, 25th September 2018 2:07:05 pm
* Author:
*/
#ifndef CURVE_LIBCURVE_INTERFACE_H //NOLINT
#define CURVE_LIBCURVE_INTERFACE_H
#include <unistd.h>
#include <stdint.h>
#include <vector>
#include <map>
#include "curvefs_python/curve_type.h"
#ifdef __cplusplus
extern "C" {
#endif
int Init(const char* path);
int Open4Qemu(const char* filename);
int Open(const char* filename, UserInfo_t* info);
int Create(const char* filename, UserInfo_t* info, size_t size);
// 同步读写
int Read(int fd, char* buf, unsigned long offset, unsigned long length); //NOLINT
int Write(int fd, const char* buf, unsigned long offset, unsigned long length); //NOLINT
// 异步读写
int AioRead(int fd, AioContext* aioctx);
int AioWrite(int fd, AioContext* aioctx);
// 获取文件的基本信息
int StatFile4Qemu(const char* filename, FileInfo_t* finfo);
int StatFile(const char* filename, UserInfo_t* info, FileInfo_t* finfo);
int ChangeOwner(const char* filename, const char* owner, UserInfo_t* info);
int Close(int fd);
int Rename(UserInfo_t* info, const char* oldpath, const char* newpath);
int Extend(const char* filename, UserInfo_t* info, uint64_t size);
int Unlink(const char* filename, UserInfo_t* info);
int DeleteForce(const char* filename, UserInfo_t* info);
DirInfos_t* OpenDir(const char* dirpath, UserInfo_t* userinfo);
void CloseDir(DirInfos_t* dirinfo);
int Listdir(DirInfos_t *dirinfo);
int Mkdir(const char* dirpath, UserInfo_t* info);
int Rmdir(const char* dirpath, UserInfo_t* info);
void UnInit();
int GetClusterId(char* buf = nullptr, int len = 0);
#ifdef __cplusplus
}
#endif
#endif // !CURVE_LIBCURVE_INTERFACE_H //NOLINT