Lines Matching refs:u
423 struct uuid_entry *u; in uuid_io() local
451 for (u = c->uuids; u < c->uuids + c->nr_uuids; u++) in uuid_io()
452 if (!bch_is_zero(u->uuid, 16)) in uuid_io()
454 u - c->uuids, u->uuid, u->label, in uuid_io()
455 u->first_reg, u->last_reg, u->invalidated); in uuid_io()
539 struct uuid_entry *u; in uuid_find() local
541 for (u = c->uuids; in uuid_find()
542 u < c->uuids + c->nr_uuids; u++) in uuid_find()
543 if (!memcmp(u->uuid, uuid, 16)) in uuid_find()
544 return u; in uuid_find()
834 struct uuid_entry *u = d->c->uuids + d->id; in bcache_device_detach() local
836 SET_UUID_FLASH_ONLY(u, 0); in bcache_device_detach()
837 memcpy(u->uuid, invalid_uuid, 16); in bcache_device_detach()
838 u->invalidated = cpu_to_le32((u32)ktime_get_real_seconds()); in bcache_device_detach()
1218 struct uuid_entry *u; in bch_cached_dev_attach() local
1255 u = uuid_find(c, dc->sb.uuid); in bch_cached_dev_attach()
1257 if (u && in bch_cached_dev_attach()
1260 memcpy(u->uuid, invalid_uuid, 16); in bch_cached_dev_attach()
1261 u->invalidated = cpu_to_le32((u32)ktime_get_real_seconds()); in bch_cached_dev_attach()
1262 u = NULL; in bch_cached_dev_attach()
1265 if (!u) { in bch_cached_dev_attach()
1272 u = uuid_find_empty(c); in bch_cached_dev_attach()
1273 if (!u) { in bch_cached_dev_attach()
1285 if (bch_is_zero(u->uuid, 16)) { in bch_cached_dev_attach()
1290 memcpy(u->uuid, dc->sb.uuid, 16); in bch_cached_dev_attach()
1291 memcpy(u->label, dc->sb.label, SB_LABEL_SIZE); in bch_cached_dev_attach()
1292 u->first_reg = u->last_reg = rtime; in bch_cached_dev_attach()
1301 u->last_reg = rtime; in bch_cached_dev_attach()
1305 bcache_device_attach(&dc->disk, c, u - c->uuids); in bch_cached_dev_attach()
1554 static int flash_dev_run(struct cache_set *c, struct uuid_entry *u) in flash_dev_run() argument
1566 if (bcache_device_init(d, block_bytes(c->cache), u->sectors, in flash_dev_run()
1570 bcache_device_attach(d, c, u - c->uuids); in flash_dev_run()
1595 struct uuid_entry *u; in flash_devs_run() local
1597 for (u = c->uuids; in flash_devs_run()
1598 u < c->uuids + c->nr_uuids && !ret; in flash_devs_run()
1599 u++) in flash_devs_run()
1600 if (UUID_FLASH_ONLY(u)) in flash_devs_run()
1601 ret = flash_dev_run(c, u); in flash_devs_run()
1608 struct uuid_entry *u; in bch_flash_dev_create() local
1616 u = uuid_find_empty(c); in bch_flash_dev_create()
1617 if (!u) { in bch_flash_dev_create()
1622 get_random_bytes(u->uuid, 16); in bch_flash_dev_create()
1623 memset(u->label, 0, 32); in bch_flash_dev_create()
1624 u->first_reg = u->last_reg = cpu_to_le32((u32)ktime_get_real_seconds()); in bch_flash_dev_create()
1626 SET_UUID_FLASH_ONLY(u, 1); in bch_flash_dev_create()
1627 u->sectors = size >> 9; in bch_flash_dev_create()
1631 return flash_dev_run(c, u); in bch_flash_dev_create()