-
Notifications
You must be signed in to change notification settings - Fork 83
/
file_scan.h
54 lines (41 loc) · 1000 Bytes
/
file_scan.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
#ifndef __FILE_SCAN_H__
#define __FILE_SCAN_H__
#include <sys/types.h>
#include <uuid/uuid.h>
#include "dbfile.h"
#include "csum.h"
#define MIN_BLOCKSIZE (4U*1024)
/* max blocksize is somewhat arbitrary. */
#define MAX_BLOCKSIZE (1024U*1024)
#define DEFAULT_BLOCKSIZE (128U*1024)
/*
* Returns nonzero on fatal errors only
*/
int scan_file(char *name, struct dbhandle *db);
void fs_get_locked_uuid(uuid_t *uuid);
/* For dbfile.c */
struct block_csum {
uint64_t loff;
unsigned char digest[DIGEST_LEN];
};
struct extent_csum {
uint64_t loff;
uint64_t poff;
uint64_t len;
unsigned char digest[DIGEST_LEN];
};
struct file_to_scan {
char *path;
int64_t fileid;
size_t filesize;
/*
* Used to record the current file position in the scan queue,
* to print the progress bar
*/
unsigned long long file_position;
};
int add_exclude_pattern(const char *pattern);
void filescan_init();
void filescan_free();
void add_file_fdupes(char *path);
#endif /* __FILE_SCAN_H__ */