Commit Graph

12 Commits

Author SHA1 Message Date
David Sterba
3c8200302b btrfs-progs: rename btrfs_open_fd2() to btrfs_open_path()
Use a more descriptive name, the interface is generic so it should use
the generic term for file/directory.

Signed-off-by: David Sterba <dsterba@suse.com>
2024-02-20 12:59:29 +01:00
David Sterba
7b9a3669e1 btrfs-progs: drop _fd from btrfs_open_file_or_dir_fd()
Signed-off-by: David Sterba <dsterba@suse.com>
2024-02-20 12:58:27 +01:00
David Sterba
1669446fd9 btrfs-progs: drop _fd from btrfs_open_mnt_fd()
Signed-off-by: David Sterba <dsterba@suse.com>
2024-02-20 12:57:50 +01:00
David Sterba
590bcf20bf btrfs-progs: drop _fd from btrfs_open_dir_fd()
Signed-off-by: David Sterba <dsterba@suse.com>
2024-02-20 12:56:24 +01:00
David Sterba
221114c36f btrfs-progs: drop verbosity parameter from btrfs_open_fd2()
All calls now pass true, drop the parameter.

Signed-off-by: David Sterba <dsterba@suse.com>
2024-02-20 12:47:46 +01:00
David Sterba
3fbcce4544 btrfs-progs: drop verbosity parameter from btrfs_open_mnt_fd()
All calls now pass true, drop the parameter.

Signed-off-by: David Sterba <dsterba@suse.com>
2024-02-20 12:47:35 +01:00
Goffredo Baroncelli
67a0cfd914 btrfs-progs: remove unused opening functions
Remove the following unused functions:

- btrfs_open_dir()
- open_file_or_dir()
- btrfs_open_file_or_dir()
- btrfs_open()
- open_path_or_dev_mnt()
- open_file_or_dir3()
- close_file_or_dir()

Signed-off-by: Goffredo Baroncelli <kreijack@libero.it>
Signed-off-by: David Sterba <dsterba@suse.com>
2024-02-20 12:19:14 +01:00
Goffredo Baroncelli
efbe4ab8e2 btrfs-progs: add path opening helpers without dirstream
For historical reasons the helpers [btrfs_]open_dir... return also
the 'DIR *dirstream' value when a directory is opened.

However this is never used. So avoid calling diropen() and return only
the fd.  This is a preparatory patch.

Signed-off-by: Goffredo Baroncelli <kreijack@libero.it>
Signed-off-by: David Sterba <dsterba@suse.com>
2024-02-20 11:40:08 +01:00
David Sterba
21aa6777b2 btrfs-progs: clean up includes, using include-what-you-use
Signed-off-by: David Sterba <dsterba@suse.com>
2023-10-03 01:11:57 +02:00
Anand Jain
77f366c9da btrfs-progs: add noscan parameter to check_where_mounted
The function check_where_mounted() scans the system for all other btrfs
devices, which is necessary for its operation.  However, in certain
cases, devices remaining in the scanned state is undesirable.  Introduce
the 'noscan' argument to make devices unscanned before return.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-07-26 15:00:48 +02:00
David Sterba
b5aac254c7 btrfs-progs: common: update include lists, part 1
The tool IWYU (include what you use) suggests to remove and add some
includes. This is only partial to avoid accidental build breakage, the
includes are entangled and will have to be cleaned in the future again.

Signed-off-by: David Sterba <dsterba@suse.com>
2022-10-11 09:08:07 +02:00
David Sterba
7fa07e2abb btrfs-progs: split open/close helpers from utils.c
There's a group of functions that are related to opening filesystem in
various modes, this can be moved to a separate file.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-05-06 16:41:47 +02:00