• Home
  • Raw
  • Download

Lines Matching refs:bdev

499 		      int flush, struct block_device **bdev,  in btrfs_get_bdev_and_sb()  argument
504 *bdev = blkdev_get_by_path(device_path, flags, holder); in btrfs_get_bdev_and_sb()
506 if (IS_ERR(*bdev)) { in btrfs_get_bdev_and_sb()
507 ret = PTR_ERR(*bdev); in btrfs_get_bdev_and_sb()
512 sync_blockdev(*bdev); in btrfs_get_bdev_and_sb()
513 ret = set_blocksize(*bdev, BTRFS_BDEV_BLOCKSIZE); in btrfs_get_bdev_and_sb()
515 blkdev_put(*bdev, flags); in btrfs_get_bdev_and_sb()
518 invalidate_bdev(*bdev); in btrfs_get_bdev_and_sb()
519 *disk_super = btrfs_read_dev_super(*bdev); in btrfs_get_bdev_and_sb()
522 blkdev_put(*bdev, flags); in btrfs_get_bdev_and_sb()
529 *bdev = NULL; in btrfs_get_bdev_and_sb()
601 struct block_device *bdev; in btrfs_open_one_device() local
606 if (device->bdev) in btrfs_open_one_device()
612 &bdev, &disk_super); in btrfs_open_one_device()
636 if (bdev_read_only(bdev)) in btrfs_open_one_device()
642 if (!bdev_nonrot(bdev)) in btrfs_open_one_device()
645 device->bdev = bdev; in btrfs_open_one_device()
661 blkdev_put(bdev, flags); in btrfs_open_one_device()
943 if (device->bdev) { in device_list_add()
1080 if (device->bdev) { in __btrfs_free_extra_devids()
1081 blkdev_put(device->bdev, device->mode); in __btrfs_free_extra_devids()
1082 device->bdev = NULL; in __btrfs_free_extra_devids()
1119 if (!device->bdev) in btrfs_close_bdev()
1123 sync_blockdev(device->bdev); in btrfs_close_bdev()
1124 invalidate_bdev(device->bdev); in btrfs_close_bdev()
1127 blkdev_put(device->bdev, device->mode); in btrfs_close_bdev()
1149 if (device->bdev) { in btrfs_close_one_device()
1151 device->bdev = NULL; in btrfs_close_one_device()
1312 static struct btrfs_super_block *btrfs_read_disk_super(struct block_device *bdev, in btrfs_read_disk_super() argument
1321 if (bytenr + PAGE_SIZE >= bdev_nr_bytes(bdev)) in btrfs_read_disk_super()
1334 page = read_cache_page_gfp(bdev->bd_inode->i_mapping, index, GFP_KERNEL); in btrfs_read_disk_super()
1378 struct block_device *bdev; in btrfs_scan_one_device() local
1401 bdev = blkdev_get_by_path(path, flags, holder); in btrfs_scan_one_device()
1402 if (IS_ERR(bdev)) in btrfs_scan_one_device()
1403 return ERR_CAST(bdev); in btrfs_scan_one_device()
1406 ret = btrfs_sb_log_location_bdev(bdev, 0, READ, &bytenr); in btrfs_scan_one_device()
1412 disk_super = btrfs_read_disk_super(bdev, bytenr, bytenr_orig); in btrfs_scan_one_device()
1425 blkdev_put(bdev, flags); in btrfs_scan_one_device()
2015 && next_device->bdev) in btrfs_find_next_active_device()
2039 (fs_info->sb->s_bdev == device->bdev)) in btrfs_assign_next_active_device()
2040 fs_info->sb->s_bdev = next_device->bdev; in btrfs_assign_next_active_device()
2042 if (fs_info->fs_devices->latest_dev->bdev == device->bdev) in btrfs_assign_next_active_device()
2065 struct block_device *bdev, in btrfs_scratch_superblocks() argument
2071 if (!bdev) in btrfs_scratch_superblocks()
2078 disk_super = btrfs_read_dev_one_super(bdev, copy_num, false); in btrfs_scratch_superblocks()
2082 if (bdev_is_zoned(bdev)) { in btrfs_scratch_superblocks()
2083 btrfs_reset_sb_log_zones(bdev, copy_num); in btrfs_scratch_superblocks()
2103 btrfs_kobject_uevent(bdev, KOBJ_CHANGE); in btrfs_scratch_superblocks()
2111 struct block_device **bdev, fmode_t *mode) in btrfs_rm_device() argument
2220 if (device->bdev) { in btrfs_rm_device()
2241 btrfs_scratch_superblocks(fs_info, device->bdev, in btrfs_rm_device()
2243 if (device->bdev) { in btrfs_rm_device()
2244 sync_blockdev(device->bdev); in btrfs_rm_device()
2245 invalidate_bdev(device->bdev); in btrfs_rm_device()
2249 *bdev = device->bdev; in btrfs_rm_device()
2306 if (srcdev->bdev) in btrfs_rm_dev_replace_remove_srcdev()
2345 if (tgtdev->bdev) in btrfs_destroy_dev_replace_tgtdev()
2356 btrfs_scratch_superblocks(tgtdev->fs_info, tgtdev->bdev, in btrfs_destroy_dev_replace_tgtdev()
2387 struct block_device *bdev; in btrfs_get_dev_args_from_path() local
2405 &bdev, &disk_super); in btrfs_get_dev_args_from_path()
2418 blkdev_put(bdev, FMODE_READ); in btrfs_get_dev_args_from_path()
2638 struct block_device *bdev; in btrfs_init_new_device() local
2652 bdev = blkdev_get_by_path(device_path, FMODE_WRITE | FMODE_EXCL, in btrfs_init_new_device()
2654 if (IS_ERR(bdev)) in btrfs_init_new_device()
2655 return PTR_ERR(bdev); in btrfs_init_new_device()
2657 if (!btrfs_check_device_zone_type(fs_info, bdev)) { in btrfs_init_new_device()
2669 sync_blockdev(bdev); in btrfs_init_new_device()
2673 if (device->bdev == bdev) { in btrfs_init_new_device()
2696 device->bdev = bdev; in btrfs_init_new_device()
2717 round_down(bdev_nr_bytes(bdev), fs_info->sectorsize); in btrfs_init_new_device()
2724 set_blocksize(device->bdev, BTRFS_BDEV_BLOCKSIZE); in btrfs_init_new_device()
2758 if (!bdev_nonrot(bdev)) in btrfs_init_new_device()
2880 blkdev_put(bdev, FMODE_EXCL); in btrfs_init_new_device()
5905 if (map->stripes[preferred_mirror].dev->bdev && in find_live_mirror()
5909 if (map->stripes[i].dev->bdev && in find_live_mirror()
6755 if (!dev || !dev->bdev) in btrfs_log_dev_io_error()
6856 if (!dev || !dev->bdev || in btrfs_submit_dev_bio()
6864 bio_set_dev(bio, dev->bdev); in btrfs_submit_dev_bio()
6886 (unsigned long)dev->bdev->bd_dev, rcu_str_deref(dev->name), in btrfs_submit_dev_bio()
6982 !device->bdev) in dev_args_match_device()
7435 if (!device->bdev) { in read_one_dev()
7445 if (!device->bdev && in read_one_dev()
7481 if (device->bdev) { in read_one_dev()
7482 u64 max_total_bytes = bdev_nr_bytes(device->bdev); in read_one_dev()
7645 if (!dev || !dev->bdev || in btrfs_check_rw_degradable()