-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpfs.h
More file actions
48 lines (35 loc) · 1.3 KB
/
pfs.h
File metadata and controls
48 lines (35 loc) · 1.3 KB
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
/*
*
* Author: Pramod Kumar(veer)
*
* Description: pfs.cc
* Parallel file system declarations
*
*/
#ifndef PFS_H
#define PFS_H
#include "config.h"
#define HARVEST_TIME 30 // In second
/* Make room for new cache block */
#define FLUSH_HIGH_MARK 70 // kick flusher if is more then high mark %
#define FLUSH_LOW_MARK 30 // Keep doing it till it reach low mark %
#define FLUSHER_TIMEOUT 5 // x Seconds
using namespace std;
extern thread thread_flusher;
extern thread thread_harvester;
extern thread thread_client_server;
class meta_data_manager_client;
extern meta_data_manager_client *mdm_service;
extern string server_ip_port;
extern map<string,file_info_store*> file_dir;
extern map<uint32_t, string> fdis_to_filename_map;
extern map<string,pair<int,int>> token_map;
void initialize(int argc, char *argv[]);
int pfs_create(const char *filename, int stripe_width);
int pfs_open(const char *filename, const char mode);
size_t pfs_read(uint32_t filedes, void *buf, size_t nbyte, off_t offset, int *cache_hit);
size_t pfs_write(uint32_t filedes, const void *buf, size_t nbyte, off_t offset, int *cache_hit);
int pfs_close(uint32_t filedes);
int pfs_delete(const char *filename);
int pfs_fstat(uint32_t filedes, struct pfs_stat *buf); // Check the config file for the definition of pfs_stat structure
#endif