super.c (9ff17e6bdaa50892dd9bdb1b116cb71b73dd711a) super.c (0718afd47f70cf46877c39c25d06b786e1a3f36c)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * bcache setup/teardown code, and some metadata io - read a superblock and
4 * figure out what to do with it.
5 *
6 * Copyright 2010, 2011 Kent Overstreet <kent.overstreet@gmail.com>
7 * Copyright 2012 Google, Inc.
8 */

--- 2546 unchanged lines hidden (view full) ---

2555 sb = kmalloc(sizeof(struct cache_sb), GFP_KERNEL);
2556 if (!sb)
2557 goto out_free_path;
2558
2559 ret = -EINVAL;
2560 err = "failed to open device";
2561 bdev = blkdev_get_by_path(strim(path),
2562 FMODE_READ|FMODE_WRITE|FMODE_EXCL,
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * bcache setup/teardown code, and some metadata io - read a superblock and
4 * figure out what to do with it.
5 *
6 * Copyright 2010, 2011 Kent Overstreet <kent.overstreet@gmail.com>
7 * Copyright 2012 Google, Inc.
8 */

--- 2546 unchanged lines hidden (view full) ---

2555 sb = kmalloc(sizeof(struct cache_sb), GFP_KERNEL);
2556 if (!sb)
2557 goto out_free_path;
2558
2559 ret = -EINVAL;
2560 err = "failed to open device";
2561 bdev = blkdev_get_by_path(strim(path),
2562 FMODE_READ|FMODE_WRITE|FMODE_EXCL,
2563 sb);
2563 sb, NULL);
2564 if (IS_ERR(bdev)) {
2565 if (bdev == ERR_PTR(-EBUSY)) {
2566 dev_t dev;
2567
2568 mutex_lock(&bch_register_lock);
2569 if (lookup_bdev(strim(path), &dev) == 0 &&
2570 bch_is_open(dev))
2571 err = "device already registered";

--- 367 unchanged lines hidden ---
2564 if (IS_ERR(bdev)) {
2565 if (bdev == ERR_PTR(-EBUSY)) {
2566 dev_t dev;
2567
2568 mutex_lock(&bch_register_lock);
2569 if (lookup_bdev(strim(path), &dev) == 0 &&
2570 bch_is_open(dev))
2571 err = "device already registered";

--- 367 unchanged lines hidden ---