Commit Graph

96 Commits

Author SHA1 Message Date
Jaegeuk Kim
7026a73750 f2fs-tools: Remove deprecated f2fstat
Let's remove this.

Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2024-04-15 11:31:46 +08:00
Bart Van Assche
f3344cf6db Remove sg_write_buffer
Remove the sg_write_buffer source code and build rules now that the
sg3_utils project has been imported.

Signed-off-by: Bart Van Assche <bvanassche@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2024-04-15 11:31:46 +08:00
Daeho Jeong
4c2d71c5b6 f2fs-tools: support F2FS_IOC_START_ATOMIC_REPLACE
Added options in f2fs_io write command to support
F2FS_IOC_START_ATOMIC_REPLACE.

Signed-off-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2024-04-15 11:31:46 +08:00
Chao Yu
aaf8c8720b f2fs_io: support triggering filesystem GC via ioctl
Support 'gc' sub command to trigger filesystem GC via ioctl in f2fs.

Signed-off-by: Chao Yu <chao.yu@oppo.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2024-04-15 11:31:46 +08:00
Ben Chang
eddad4a194 f2fs-tools: fix cannot get bdev information
Some device like android phone doesn't show the dev number path in
/dev/block/, for example:

$ ls /dev/block/
bootdevice  dm-6    loop24  loop43    ram13  sda5  sdd4   sde24  sde43  sde62  sdf1
by-name     dm-7    loop25  loop44    ram14  sda6  sdd5   sde25  sde44  sde63  sdf10
dm-0        dm-8    loop26  loop45    ram15  sda7  sdd6   sde26  sde45  sde64  sdf11
dm-1        dm-9    loop27  loop46    ram2   sda8  sdd7   sde27  sde46  sde65  sdf12
dm-10       loop0   loop28  loop47    ram3   sda9  sde    sde28  sde47  sde66  sdf13
dm-11       loop1   loop29  loop48    ram4   sdb   sde1   sde29  sde48  sde67  sdf14
dm-12       loop10  loop3   loop49    ram5   sdb1  sde10  sde3   sde49  sde68  sdf15
dm-13       loop11  loop30  loop5     ram6   sdb2  sde11  sde30  sde5   sde69  sdf16
dm-14       loop12  loop31  loop50    ram7   sdb3  sde12  sde31  sde50  sde7   sdf17
dm-15       loop13  loop32  loop51    ram8   sdb4  sde13  sde32  sde51  sde70  sdf18
dm-16       loop14  loop33  loop6     ram9   sdb5  sde14  sde33  sde52  sde71  sdf19
dm-17       loop15  loop34  loop7     sda    sdc   sde15  sde34  sde53  sde72  sdf2
dm-18       loop16  loop35  loop8     sda1   sdc1  sde16  sde35  sde54  sde73  sdf3
dm-19       loop17  loop36  loop9     sda10  sdc2  sde17  sde36  sde55  sde74  sdf4
dm-2        loop18  loop37  mapper    sda11  sdc3  sde18  sde37  sde56  sde75  sdf5
dm-20       loop19  loop38  platform  sda12  sdc4  sde19  sde38  sde57  sde76  sdf6
dm-21       loop2   loop39  ram0      sda13  sdc5  sde2   sde39  sde58  sde77  sdf7
dm-3        loop20  loop4   ram1      sda14  sdd   sde20  sde4   sde59  sde78  sdf8
dm-4        loop21  loop40  ram10     sda2   sdd1  sde21  sde40  sde6   sde8   sdf9
dm-5        loop22  loop41  ram11     sda3   sdd2  sde22  sde41  sde60  sde9   vold
dm-53       loop23  loop42  ram12     sda4   sdd3  sde23  sde42  sde61  sdf    zram0

this will cause stat_bdev cannot show bdev information.

But most of devices (include android) show dev number path in /sys/dev/block, for example:

$ ls  /sys/dev/block
1:0    254:1   254:6   259:21  259:38  259:54  7:104  7:24   7:368  8:11  8:4   8:70  8:87
1:1    254:10  254:7   259:22  259:39  259:55  7:112  7:240  7:376  8:12  8:48  8:71  8:88
1:10   254:11  254:8   259:23  259:4   259:56  7:120  7:248  7:384  8:13  8:49  8:72  8:89
1:11   254:12  254:9   259:24  259:40  259:57  7:128  7:256  7:392  8:14  8:5   8:73  8:9
1:12   254:13  259:0   259:25  259:41  259:58  7:136  7:264  7:40   8:16  8:50  8:74  8:90
1:13   254:14  259:1   259:26  259:42  259:59  7:144  7:272  7:400  8:17  8:51  8:75  8:91
1:14   254:15  259:10  259:27  259:43  259:6   7:152  7:280  7:408  8:18  8:52  8:76  8:92
1:15   254:16  259:11  259:28  259:44  259:60  7:16   7:288  7:48   8:19  8:53  8:77  8:93
1:2    254:17  259:12  259:29  259:45  259:61  7:160  7:296  7:56   8:2   8:54  8:78  8:94
1:3    254:18  259:13  259:3   259:46  259:62  7:168  7:304  7:64   8:20  8:55  8:79  8:95
1:4    254:19  259:14  259:30  259:47  259:63  7:176  7:312  7:72   8:21  8:6   8:8
1:5    254:2   259:15  259:31  259:48  259:64  7:184  7:32   7:8    8:3   8:64  8:80
1:6    254:20  259:16  259:32  259:49  259:65  7:192  7:320  7:80   8:32  8:65  8:81
1:7    254:21  259:17  259:33  259:5   259:66  7:200  7:328  7:88   8:33  8:66  8:82
1:8    254:3   259:18  259:34  259:50  259:7   7:208  7:336  7:96   8:34  8:67  8:83
1:9    254:4   259:19  259:35  259:51  259:8   7:216  7:344  8:0    8:35  8:68  8:84
253:0  254:5   259:2   259:36  259:52  259:9   7:224  7:352  8:1    8:36  8:69  8:85
254:0  254:53  259:20  259:37  259:53  7:0     7:232  7:360  8:10   8:37  8:7   8:86

so change the access path from /dev/block to /sys/dev/block
(same method of libudev)

Before:

$./f2fs.fibmap testfile_4k

----------------file info-------------------
testfile_4k :
--------------------------------------------
dev       [254:53]
ino       [0x    3dda : 15834]
mode      [0x    81b6 : 33206]
nlink     [0x       1 : 1]
uid       [0x       0 : 0]
gid       [0x       0 : 0]
size      [0x   40000 : 262144]
blksize   [0x    1000 : 4096]
blocks    [0x     200 : 512]
--------------------------------------------

file_pos   start_blk     end_blk        blks
       0     2256926     2256987          62
  253952     2150337     2150338           2

Patched:
$./f2fs.fibmap testfile_4k
----------------bdev info-------------------
devname = 254:53
start_lba = 0

----------------file info-------------------
testfile_4k :
--------------------------------------------
dev       [254:53]
ino       [0x    3dda : 15834]
mode      [0x    81b6 : 33206]
nlink     [0x       1 : 1]
uid       [0x       0 : 0]
gid       [0x       0 : 0]
size      [0x   40000 : 262144]
blksize   [0x    1000 : 4096]
blocks    [0x     200 : 512]
--------------------------------------------

file_pos   start_blk     end_blk        blks
       0     2256926     2256987          62
  253952     2150337     2150338           2

Signed-off-by: Ben Chang <ben.chang@sonicsky.net>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2024-04-15 11:29:16 +08:00
Jaegeuk Kim
2399f56a8f f2fs_io: add dsync option for write
This adds a write option having O_DIRECT | O_DSYNC.

Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2024-04-15 11:29:16 +08:00
Dylan Chang
a84478b3a4 tools: fix file too large causing overflow
fibmap: Fix file too large causing file_pos overflow

fibmap show file_pos with incorrectly value when passing a large file.

Before:

----------------file info-------------------
/data/media/0/data1 :
--------------------------------------------
dev       [254:18]
ino       [0x    4db1 : 19889]
mode      [0x    81b0 : 33200]
nlink     [0x       1 : 1]
uid       [0x    280e : 10254]
gid       [0x     3ff : 1023]
size      [0x1b3dca314 : 7312548628]
blksize   [0x    1000 : 4096]
blocks    [0x  da2530 : 14296368]
--------------------------------------------

file_pos   start_blk     end_blk        blks
       0     3197602     3198463         862
 3530752     3197509     3197509           1
 3534848     3197557     3197578          22
 3624960     3198464     3396701      198238
815607808     3396703     3632480      235778
1781354496     3632482     3652095       19614
1861693440     3396702     3396702           1
1861697536     3632481     3632481           1
1861701632     1514948     1514948           1
1861705728     1518774     1518774           1
1861709824     2543104     2543125          22
...
1862111232     2457813     2457813           1
1862115328     3652096     3878168      226073
-1506856960     3878170     4133725      255556
-460099584     1510048     1510052           5

Patched:
----------------file info-------------------
/data/media/0/data1 :
--------------------------------------------
dev       [254:18]
ino       [0x    4db1 : 19889]
mode      [0x    81b0 : 33200]
nlink     [0x       1 : 1]
uid       [0x    280e : 10254]
gid       [0x     3ff : 1023]
size      [0x1b3dca314 : 7312548628]
blksize   [0x    1000 : 4096]
blocks    [0x  da2530 : 14296368]
--------------------------------------------

file_pos   start_blk     end_blk        blks
       0     3197602     3198463         862
 3530752     3197509     3197509           1
 3534848     3197557     3197578          22
 3624960     3198464     3396701      198238
815607808     3396703     3632480      235778
1781354496     3632482     3652095       19614
1861693440     3396702     3396702           1
1861697536     3632481     3632481           1
1861701632     1514948     1514948           1
1861705728     1518774     1518774           1
1861709824     2543104     2543125          22
...
1862111232     2457813     2457813           1
1862115328     3652096     3878168      226073
2788110336     3878170     4133725      255556
3834867712     1510048     1510052           5

Signed-off-by: Dylan Chang <dylan.chang@oneplus.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2024-04-15 11:29:16 +08:00
Jaegeuk Kim
77aa322fb7 Remove unnecessary config.h
Instead, we should use <config.h> generated by configure.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2024-04-15 11:29:16 +08:00
Jaegeuk Kim
90a36f3918 f2fs-tools: move android_config before defining them
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2024-04-15 11:29:16 +08:00
Jaegeuk Kim
4b9ae54c2f f2fscrypt: adjust config file first
We need to get the definitions first.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2024-04-15 11:29:16 +08:00
nieben
f505165a60 f2fs_do_mount-dfx
Signed-off-by: nieben <nieben1@huawei.com>
2024-03-21 10:39:24 +08:00
y30045862
2ba6b2b207 f2fs-tools构建规范化整改
Signed-off-by: yangjingbo10 <yangjingbo10@huawei.com>

Change-Id: I1aae1cb27162594dae1e395f46fcf0833750e6d0
2023-06-21 09:25:04 +08:00
张文迪
9fef819eb4 fix e2fsprogs
Signed-off-by: 张文迪 <zhangwendi3@huawei.com>
2023-06-03 17:03:53 +08:00
张文迪
b08c917ed4 fix compile
Signed-off-by: 张文迪 <zhangwendi3@huawei.com>
2023-06-01 20:39:25 +08:00
张文迪
461b8536e1 adapt the modification of e2fsprog switching to OpenEuler
Signed-off-by: 张文迪 <zhangwendi3@huawei.com>
2023-05-20 16:59:34 +08:00
Jaegeuk Kim
fbbd3511f3 mkfs.f2fs: check uuid library
commit eee3969d7dcf3be9c3b831d993fcf49f55855a35
category: bugfix
issue: #I6VAS0
CVE: NA

Signed-off-by: DongSenhao <dongsenhao2@huawei.com>
---------------------------------------

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
2023-04-13 14:13:51 +08:00
Bart Van Assche
25d83da964 Fix PowerPC format string warnings
commit c491657c0eb68d01dee5cc66ee3909dba5523540
category: bugfix
issue: #I6VAS0
CVE: NA

Signed-off-by: DongSenhao <dongsenhao2@huawei.com>
---------------------------------------

__SANE_USERSPACE_TYPES__ must be defined before <linux/types.h> is
included. Hence this patch that moves the definition of that macro into
the source files that need it.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
2023-04-13 14:13:50 +08:00
Bart Van Assche
094b306b3b Annotate switch/case fallthrough
commit 7a1206adf33595a50b669d4027b72ad0786fb12f
category: bugfix
issue: #I6VAS0
CVE: NA

Signed-off-by: DongSenhao <dongsenhao2@huawei.com>
---------------------------------------

Just like in the Linux kernel source code, annotate switch/case
fallthrough.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
2023-04-13 14:13:50 +08:00
Bart Van Assche
1fa72eed97 tools/f2fs_io: Fix the type of 'ret'
commit 28de4d1334d4519c1a64659245dfd84cc2ddfa6c
category: bugfix
issue: #I6VAS0
CVE: NA

Signed-off-by: DongSenhao <dongsenhao2@huawei.com>
---------------------------------------

Make it possible to check whether the return value of ioctl() is negative.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
2023-04-13 14:13:50 +08:00
Bart Van Assche
989594261b tools/f2fscrypt.c: Fix build without uuid/uuid.h header file
commit 93c6483b85141551e6a5fea339ab4c6cc1f9cc8c
category: bugfix
issue: #I6VAS0
CVE: NA

Signed-off-by: DongSenhao <dongsenhao2@huawei.com>
---------------------------------------

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
2023-04-13 14:13:50 +08:00
Bart Van Assche
1d9cbf3c83 Fix the MinGW build
commit 1790203deed19a93c60813f75956f2788ac96c95
category: bugfix
issue: #I6VAS0
CVE: NA

Signed-off-by: DongSenhao <dongsenhao2@huawei.com>
---------------------------------------

Fix multiple compiler warnings and build errors reported by the MinGW
cross-compiler.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
2023-04-13 14:13:49 +08:00
Bart Van Assche
ed86f575e9 Remove unnecessary __attribute__((packed)) annotations
commit 1612bf99de322e2554a90dced7337ff2d8d1ded6
category: bugfix
issue: #I6VAS0
CVE: NA

Signed-off-by: DongSenhao <dongsenhao2@huawei.com>
---------------------------------------

Applying the __attribute__((packed)) annotation to members that do not
need it impacts performance negatively on architectures that do not
support efficient unaligned accesses (e.g. ARMv7). Hence minimize the
__attribute__((packed)) annotations.

See also CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS in the Linux kernel.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
2023-04-13 14:13:49 +08:00
Bart Van Assche
a86f797930 Verify structure sizes at compile time
commit 9425b47b897e690c71a337c0c93477bfd6fa1997
category: bugfix
issue: #I6VAS0
CVE: NA

Signed-off-by: DongSenhao <dongsenhao2@huawei.com>
---------------------------------------

Before modifying the __attribute__((packed)) annotations, let the
compiler verify the sizes of on-disk data structures.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
2023-04-13 14:13:48 +08:00
Bart Van Assche
a8c6a6d93f Switch from the u_int to the uint types
commit 87d7a95e3134b668e9f1e8519a19f390509fac60
category: bugfix
issue: #I6VAS0
CVE: NA

Signed-off-by: DongSenhao <dongsenhao2@huawei.com>
---------------------------------------

Many format strings use one of the PRI* macros. These macros are compatible
with the uint types but not with the u_int types. Hence this patch
that switches from the u_int to the uint types.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
2023-04-13 14:13:48 +08:00
Bart Van Assche
d29305ee15 configure.ac: Enable cross-compilation
commit c48335416a09b881d2309b8f88c9b3d1441f4a9c
category: bugfix
issue: #I6VAS0
CVE: NA

Signed-off-by: DongSenhao <dongsenhao2@huawei.com>
---------------------------------------

Stop using PKG_CHECK_MODULES() since that macro is not compatible with
cross-compilation.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
2023-04-13 14:13:48 +08:00
Daeho Jeong
2ecd0c220f f2fs-tools: add atomic write related options to f2fs_io write command
commit 1de1db84d2a4a0ddfe90362d07dbec1dbc423323
category: bugfix
issue: #I6VAS0
CVE: NA

Signed-off-by: DongSenhao <dongsenhao2@huawei.com>
---------------------------------------

Added two option to f2fs_io "write" command.
 - atomic_commit : atomic write & commit
 - atomic_abort  : atomic write & abort
Also, added an optional option {delay}, which is in ms unit and optional
only for atomic_commit and atomic_abort.

Signed-off-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
2023-04-13 14:13:46 +08:00
Daeho Jeong
4f5e79faa8 f2fs-tools: change fiemap print out format
commit 49159df049
category: bugfix
issue: #I6VAS0
CVE: NA

Signed-off-by: DongSenhao <dongsenhao2@huawei.com>
---------------------------------------

Given fiemap way to print out extents in the kernel, we can correctly
print the layout of each file in a unit of extent, not block. So, I
changed fiemap print out way like below.

Fiemap: offset = 0 len = 60
        logical addr.    physical addr.   length           flags
0       0000000000000000 00000020032df000 0000000000004000 00001008
1       0000000000004000 00000020032e0000 0000000000004000 00001008
2       0000000000008000 00000020032e1000 0000000000004000 00001008
3       000000000000c000 00000020032e2000 0000000000004000 00001008

Signed-off-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
2023-04-13 14:13:46 +08:00
Jaegeuk Kim
c7ee479e92 f2fs_io: add rename w/ fsync option
commit 8bcb58ec90
category: bugfix
issue: #I6VAS0
CVE: NA

Signed-off-by: DongSenhao <dongsenhao2@huawei.com>
---------------------------------------

e.g., f2fs_io rename source dest 1
      1. open(source)
      2. rename(source, dest)
      3. fsync(source)
      4. close(source)

Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
2023-04-13 14:13:46 +08:00
Daeho Jeong
025371e721 f2fs-tools: make fiemap command in accordance with uapi
commit 529967eac0
category: bugfix
issue: #I6VAS0
CVE: NA

Signed-off-by: DongSenhao <dongsenhao2@huawei.com>
---------------------------------------

Made "fiemap" command in accordance with user api manual. So, eliminated
NEW_ADDR print out and made it ends in the last extent.

Signed-off-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
2023-04-13 14:13:46 +08:00
Jaegeuk Kim
9e137d7f15 f2fs_io: add to show immutable bit
commit 38e3115c7f
category: bugfix
issue: #I6VAS0
CVE: NA

Signed-off-by: DongSenhao <dongsenhao2@huawei.com>
---------------------------------------

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
2023-04-13 14:13:45 +08:00
Jaegeuk Kim
024521aefb f2fs_io: split definition check for crypto ioctl
commit 870915f282
category: bugfix
issue: #I6VAS0
CVE: NA

Signed-off-by: DongSenhao <dongsenhao2@huawei.com>
---------------------------------------

This patch fixes undefined FSCRYPT_POLICY_V1 in old distribution.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
2023-04-13 14:13:45 +08:00
Robin Hsu
8d2dfb7edd f2fs_io: Add get file name encryption mode
commit 1531853eb7
category: bugfix
issue: #I6VAS0
CVE: NA

Signed-off-by: DongSenhao <dongsenhao2@huawei.com>
---------------------------------------

This patch add an ioctl to get filename encryption mode.

Signed-off-by: Robin Hsu <robinhsu@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
2023-04-13 14:13:44 +08:00
Daeho Jeong
a1879e5af8 f2fs_io: add compress/decompress commands
commit 7b63f7b399
category: bugfix
issue: #I6VAS0
CVE: NA

Signed-off-by: DongSenhao <dongsenhao2@huawei.com>
---------------------------------------

Added new commands, compress and decompress, to support
F2FS_IOC_COMPRESS_FILE and F2FS_IOC_DECOMPRESS_FILE.

Signed-off-by: Daeho Jeong <daehojeong@google.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
2023-04-13 14:13:44 +08:00
Victor Westerhuis
e67b93cdc9 f2fs-tools: fix a few spelling errors in f2fs-tools
commit d322d47fa4
category: bugfix
issue: #I6VAS0
CVE: NA

Signed-off-by: DongSenhao <dongsenhao2@huawei.com>
---------------------------------------

typo fix.

Signed-off-by: Victor Westerhuis <victor@westerhu.is>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
2023-04-13 14:13:44 +08:00
Daeho Jeong
2b7016042a f2fs_io: add get/set compression option
commit 1d4c7e7ce5
category: bugfix
issue: #I6VAS0
CVE: NA

Signed-off-by: DongSenhao <dongsenhao2@huawei.com>
---------------------------------------

Added new commands, get_coption and set_coption, to support
F2FS_IOC_GET_COMPRESS_OPTION and F2FS_IOC_SET_COMPRESS_OPTION.

Signed-off-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
2023-04-13 14:13:44 +08:00
Ocean Chen
2fc80b9e32 f2fs_io: add erase option
commit 1bfc17340d
category: bugfix
issue: #I6VAS0
CVE: NA

Signed-off-by: DongSenhao <dongsenhao2@huawei.com>
---------------------------------------

f2fs_io erase [block_device_path]

Signed-off-by: Ocean Chen <oceanchen@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
2023-04-13 14:13:44 +08:00
Daeho Jeong
851e19eb16 f2fs_io: change fibmap to fiemap
commit 717d70db60
category: bugfix
issue: #I6VAS0
CVE: NA

Signed-off-by: DongSenhao <dongsenhao2@huawei.com>
---------------------------------------

Currently we support fiemap command using fibmap. It's simple and
easy to use, but we cannot use this for compressed file. To support
more different types of files, we need to change this to use fiemap.

Signed-off-by: Daeho Jeong <daehojeong@google.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
[Jaegeuk Kim: add Android build]
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
2023-04-13 14:13:43 +08:00
张文迪
f8224a8bdc f2fs_tools部件化
Signed-off-by: 张文迪 <zhangwendi3@huawei.com>
2022-08-23 10:40:59 +08:00
jiahaoluo
567e0db420 change part name to storage_service
Signed-off-by: jiahaoluo <luojiahao5@huawei.com>
2022-02-09 15:01:50 +08:00
xlfeng
a48316a6e8 BUILD,gn文件中subsystem_name的值改为filemanagement,路径/e2fsprogs/f2fs-tools-1.14.0改为/f2fs-tools/,config名称e2fsprogs-defaults改为f2fs-defaults。fsck/BUILD.gn增加symlink_target_name。
Signed-off-by: xlfeng <xulifeng7@huawei.com>
2022-01-12 17:11:18 +08:00
xlfeng
a2b0c9daf5 BUILD.gn delete comment lines and uncompiled items.
Signed-off-by: xlfeng <xulifeng7@huawei.com>
2021-12-21 15:27:01 +08:00
xlfeng
059d1b3f4c BUILD.gn and config.h modify Huawei license to GPL-2.0 license.Add #ifndef CONFIG_H #define CONFIG_H on the head of file and #endif on the end of config.h. Modify the value of Name in README.OpenSource.
Signed-off-by: xlfeng <xulifeng7@huawei.com>
2021-12-20 21:44:20 +08:00
xlfeng
81c31712a5 Build successful,add one config.h and four BUILD.gn, modify seven files to relsove macro redefined,.Delete two Android.bp files.Add OAT related files,OAT.xml,README.OpenSource and README.md.
Signed-off-by: xlfeng <xulifeng7@huawei.com>
2021-12-15 10:45:47 +08:00
Jaegeuk Kim
1e3dd7ae5d f2fs_io: measure performance of write()
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-08-20 09:08:31 -07:00
Jaegeuk Kim
334047bdca f2fs_io: add OSYNC option
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-08-20 09:08:07 -07:00
Daeho Jeong
5c92399f8f f2fs_io: open file in read only mode for pinning file
To use "pinfile" command even with read only file, changed open
mode for it.

Signed-off-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-08-04 17:52:56 -07:00
Jaegeuk Kim
17463f9c42 f2fs_io: add mmap read operation
This patch adds an option, mmap, when reading data.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-07-20 17:39:02 -07:00
Rolf Eike Beer
4b55c43828 lib: use ${libuuid_LIBS} instead of -luuid everywhere
Otherwise linking will fail if the library is in an uncommon location or has a
non-standard name.

Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-06-18 12:34:23 -07:00
Rolf Eike Beer
59a37413f8 lib: fix include path for uuid.h
$ pkg-config --cflags uuid
-I/usr/include/uuid

The "uuid/" directory is actually part of the include path. This usually still
works because most people have the path one level up in their default include
path.

Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-06-18 12:34:03 -07:00
Daeho Jeong
b23b2b97a6 f2fs_io: add randread
I've added a new command to evaluate random read.

Signed-off-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-05-27 13:59:25 -07:00