Debian Codegraph @

f2fs.c

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
•1 /*
2 * f2fs.c
3 * Detection of f2fs file system
4 *
5 * Superblock details are from Github project f2fs-tools,
6 * file f2fs-tools-1.11.0\include\f2fs_fs.h
7 */
8
9 #include "global.h"
10
11 void detect_f2fs(SECTION *section, int level)
12 {
13 // Superblock in sector 2
14 //
15 unsigned char *buf;
16 if (get_buffer(section, 1024, 512, (void **)&buf) < 512)
17 return;
18
19 if (get_le_long(buf+0) != 0xF2F52010)
20 return;
21
22 u2 major = get_le_short(buf+4);
23 u2 minor = get_le_short(buf+6);
24
25 print_line(level, "F2FS file system (version %d.%d)", major, minor);
26
27
28 char volume_name[512];
29 format_utf16_le(buf+124, 512, volume_name);
30 print_line(level, "Volume name: %s", volume_name);
31
32
33 char uuid[40];
34 format_uuid(buf+108, uuid);
35 print_line(level, "Volume uuid: %s", uuid);
36 }