-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfile.h
66 lines (53 loc) · 1.51 KB
/
file.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
#ifndef __spdk_fs_file_h__
#define __spdk_fs_file_h__
#include"spdkfs/fs.h"
/**
* Modifying the given file's offset
*
* \param file file structure to modify
* \param offset offset to set
* \param mode offset posistion, now support SEEK_CUR SEEK_SET
*/
void simple_fs_lseek(struct spdkfs_file *file, loff_t offset, int mode);
/**
* Read the data from the given file
*
* \param file file structure to read
* \param size size of the writing
* \param buffer buffer for data
\
*/
ssize_t simple_fs_read(struct spdkfs_file *file, size_t size, void * buffer);
/**
* Write the data to the given file
*
* \param file file structure to write, as well as to modify metadata
* \param size size of the writing
* \param buffer buffer for data
\
*/
ssize_t simple_fs_write(struct spdkfs_file *file, size_t size, void * buffer);
/**
* Filling the file persistent structure with the give blob
* Note that before calling ,file->fs and file->_blob must be properly set
* \param file file structure to fill
*
*/
void simple_fs_open(struct spdkfs_file *file);
/**
* Filling the file persistent structure with the give blob
* Note that before calling ,file->fs and file->_blob must be properly set
* \param file file structure to fill
*
*/
void simple_fs_create(struct spdkfs_file *file);
/**
* Remove the file's resource
*
* \param file file structure to fill
*
*/
void simple_fs_release(struct spdkfs_file *file);
void simple_fs_close(struct spdkfs_file *file);
void bind_file_ops(struct spdkfs_file *file);
# endif