-
Notifications
You must be signed in to change notification settings - Fork 2k
/
storage_func.h
56 lines (40 loc) · 1.41 KB
/
storage_func.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
/**
* Copyright (C) 2008 Happy Fish / YuQing
*
* FastDFS may be copied only under the terms of the GNU General
* Public License V3, which may be found in the FastDFS source kit.
* Please visit the FastDFS Home Page http://www.fastken.com/ for more detail.
**/
//storage_func.h
#ifndef _STORAGE_FUNC_H_
#define _STORAGE_FUNC_H_
#include "tracker_types.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef char * (*get_filename_func)(const void *pArg, \
char *full_filename);
int storage_write_to_fd(int fd, get_filename_func filename_func, \
const void *pArg, const char *buff, const int len);
int storage_func_init(const char *filename);
int storage_func_destroy();
int storage_write_to_stat_file();
int storage_write_to_sync_ini_file();
bool storage_server_is_myself(const FDFSStorageBrief *pStorageBrief);
bool storage_id_is_myself(const char *storage_id);
int storage_set_tracker_client_ips(ConnectionInfo *conn,
const int tracker_index);
int storage_check_and_make_global_data_path();
int storage_logic_to_local_full_filename(const char *logic_filename,
const int logic_filename_len, int *store_path_index,
char *full_filename, const int filename_size);
/*
int write_serialized(int fd, const char *buff, size_t count, const bool bSync);
int fsync_serialized(int fd);
int recv_file_serialized(int sock, const char *filename, \
const int64_t file_bytes);
*/
#ifdef __cplusplus
}
#endif
#endif