summaryrefslogtreecommitdiff
path: root/convert/source-fs.h
Commit message (Collapse)AuthorAge
* btrfs-progs: convert: add missing types headerBaruch Siach2017-11-14
| | | | | | | | | | | | | | | | | Build with musl libc needs the sys/types.h header for the dev_t type, since this header is not included indirectly. This fixes the following build failure: In file included from convert/source-fs.c:23:0: ./convert/source-fs.h:112:1: error: unknown type name ‘dev_t’ dev_t decode_dev(u32 dev); ^~~~~ convert/source-fs.c:31:1: error: unknown type name ‘dev_t’ dev_t decode_dev(u32 dev) ^~~~~ Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move and rename dev_t helpers to common fileDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move acl helper to common source fileDavid Sterba2017-09-08
| | | | | | There were 2 copies of ext2_acl_count and acl_ea_size. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move duplicated acl code to common headerDavid Sterba2017-09-08
| | | | | | The ACL types and macros are same for both source filesystem. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: Fix data race when reporting progressAdam Buchbinder2017-07-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The status display was reading the state while the task was updating it. Use a mutex to prevent the race. This race was detected using ThreadSanitizer and misc-tests/005-convert-progress-thread-crash. ================== WARNING: ThreadSanitizer: data race Write of size 8 by main thread: #0 ext2_copy_inodes btrfs-progs/convert/source-ext2.c:853 #1 copy_inodes btrfs-progs/convert/main.c:145 #2 do_convert btrfs-progs/convert/main.c:1297 #3 main btrfs-progs/convert/main.c:1924 Previous read of size 8 by thread T1: #0 print_copied_inodes btrfs-progs/convert/main.c:124 Location is stack of main thread. Thread T1 (running) created by main thread at: #0 pthread_create <null> #1 task_start btrfs-progs/task-utils.c:50 #2 do_convert btrfs-progs/convert/main.c:1295 #3 main btrfs-progs/convert/main.c:1924 SUMMARY: ThreadSanitizer: data race btrfs-progs/convert/source-ext2.c:853 in ext2_copy_inodes Signed-off-by: Adam Buchbinder <abuchbinder@google.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: Make btrfs_reserved_ranges constQu Wenruo2017-03-16
| | | | | | | | | | | | Since btrfs_reserved_ranges array is just used to store btrfs reserved ranges, no one will nor should modify them at run time, make them static and const will be better. This also eliminates the use of immediate number 3. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [ definition stays in source-fs.c ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: Introduce simple range structure for convert reserved ↵Qu Wenruo2017-03-16
| | | | | | | | | | | | | | | ranges Introduce a new strucutre, simple_range, to present one contingous range. Also, use such structure to define btrfs_reserved_ranges(), which convert and rollback will use. Suggested-by: David Sterba <dsterba@suse.com> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [ split hunks to new file structure ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: use bit field for convert flagsDavid Sterba2017-03-08
| | | | | | | Use one flag field instead of several variables. The change cascades down to the callchain and modifies several functions. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: use fixed lenght array for source fs nameDavid Sterba2017-03-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: update some forward declarationsDavid Sterba2017-03-08
| | | | | | Add missing and reorder so they come next to the structures using them. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: use wider types types for inode counts for progress ↵David Sterba2017-03-08
| | | | | | reports Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move definitions for interal conversion API to own fileDavid Sterba2017-03-08
Signed-off-by: David Sterba <dsterba@suse.com>