summaryrefslogtreecommitdiff
path: root/libfstools/common.h
blob: b5cc692261a2e751a1cf41902e637967f4282844 (plain)
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
// SPDX-License-Identifier: GPL-2.0-or-later

#define _FILE_OFFSET_BITS 64

#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/mount.h>
#include <glob.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dirent.h>
#include <fcntl.h>
#include <unistd.h>
#include <libgen.h>

#include "libfstools.h"
#include "volume.h"

#define F2FS_MINSIZE		(100ULL * 1024ULL * 1024ULL)

int read_uint_from_file(char *dirname, char *filename, unsigned int *i);
char *read_string_from_file(const char *dirname, const char *filename, char *buf, size_t bufsz);
int block_file_identify(FILE *f, uint64_t offset);
int block_volume_format(struct volume *v, uint64_t offset, const char *bdev);