#include <linux/blkdev.h>
#include <linux/module.h>
-#include <linux/buffer_head.h>
#include <linux/fs.h>
#include <linux/pagemap.h>
#include <linux/highmem.h>
#include <linux/string.h>
#include <linux/backing-dev.h>
#include <linux/mount.h>
-#include <linux/mpage.h>
-#include <linux/swap.h>
#include <linux/writeback.h>
#include <linux/statfs.h>
#include <linux/compat.h>
case Opt_recovery:
btrfs_warn(info,
"'recovery' is deprecated, use 'usebackuproot' instead");
+ /* fall through */
case Opt_usebackuproot:
btrfs_info(info,
"trying to use backup root at mount time");
char *device_name, *opts, *orig, *p;
int error = 0;
+ lockdep_assert_held(&uuid_mutex);
+
if (!options)
return 0;
*
* The value is later passed to mount_subvol()
*/
-static int btrfs_parse_subvol_options(const char *options, fmode_t flags,
- char **subvol_name, u64 *subvol_objectid)
+static int btrfs_parse_subvol_options(const char *options, char **subvol_name,
+ u64 *subvol_objectid)
{
substring_t args[MAX_OPT_ARGS];
char *opts, *orig, *p;
if (!(flags & SB_RDONLY))
mode |= FMODE_WRITE;
+ mutex_lock(&uuid_mutex);
error = btrfs_parse_early_options(data, mode, fs_type,
&fs_devices);
+ mutex_unlock(&uuid_mutex);
if (error) {
return ERR_PTR(error);
}
return ERR_PTR(error);
}
+ mutex_lock(&uuid_mutex);
error = btrfs_scan_one_device(device_name, mode, fs_type, &fs_devices);
+ mutex_unlock(&uuid_mutex);
if (error)
goto error_sec_opts;
goto error_fs_info;
}
+ mutex_lock(&uuid_mutex);
error = btrfs_open_devices(fs_devices, mode, fs_type);
+ mutex_unlock(&uuid_mutex);
if (error)
goto error_fs_info;
if (!(flags & SB_RDONLY))
mode |= FMODE_WRITE;
- error = btrfs_parse_subvol_options(data, mode,
- &subvol_name, &subvol_objectid);
+ error = btrfs_parse_subvol_options(data, &subvol_name,
+ &subvol_objectid);
if (error) {
kfree(subvol_name);
return ERR_PTR(error);
switch (cmd) {
case BTRFS_IOC_SCAN_DEV:
+ mutex_lock(&uuid_mutex);
ret = btrfs_scan_one_device(vol->name, FMODE_READ,
&btrfs_root_fs_type, &fs_devices);
+ mutex_unlock(&uuid_mutex);
break;
case BTRFS_IOC_DEVICES_READY:
+ mutex_lock(&uuid_mutex);
ret = btrfs_scan_one_device(vol->name, FMODE_READ,
&btrfs_root_fs_type, &fs_devices);
- if (ret)
+ if (ret) {
+ mutex_unlock(&uuid_mutex);
break;
+ }
ret = !(fs_devices->num_devices == fs_devices->total_devices);
+ mutex_unlock(&uuid_mutex);
break;
case BTRFS_IOC_GET_SUPPORTED_FEATURES:
ret = btrfs_ioctl_get_supported_features((void __user*)arg);
static void __init btrfs_print_mod_info(void)
{
- pr_info("Btrfs loaded, crc32c=%s"
+ static const char options[] = ""
#ifdef CONFIG_BTRFS_DEBUG
", debug=on"
#endif
#ifdef CONFIG_BTRFS_FS_REF_VERIFY
", ref-verify=on"
#endif
- "\n",
- crc32c_impl());
+ ;
+ pr_info("Btrfs loaded, crc32c=%s%s\n", crc32c_impl(), options);
}
static int __init init_btrfs_fs(void)