mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
c6b4fcbad0
Add a target that allows a fast device such as an SSD to be used as a cache for a slower device such as a disk. A plug-in architecture was chosen so that the decisions about which data to migrate and when are delegated to interchangeable tunable policy modules. The first general purpose module we have developed, called "mq" (multiqueue), follows in the next patch. Other modules are under development. Signed-off-by: Joe Thornber <ejt@redhat.com> Signed-off-by: Heinz Mauelshagen <mauelshagen@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
54 lines
1.1 KiB
C
54 lines
1.1 KiB
C
/*
|
|
* Copyright (C) 2012 Red Hat, Inc.
|
|
*
|
|
* This file is released under the GPL.
|
|
*/
|
|
|
|
#ifndef DM_CACHE_BLOCK_TYPES_H
|
|
#define DM_CACHE_BLOCK_TYPES_H
|
|
|
|
#include "persistent-data/dm-block-manager.h"
|
|
|
|
/*----------------------------------------------------------------*/
|
|
|
|
/*
|
|
* It's helpful to get sparse to differentiate between indexes into the
|
|
* origin device, indexes into the cache device, and indexes into the
|
|
* discard bitset.
|
|
*/
|
|
|
|
typedef dm_block_t __bitwise__ dm_oblock_t;
|
|
typedef uint32_t __bitwise__ dm_cblock_t;
|
|
typedef dm_block_t __bitwise__ dm_dblock_t;
|
|
|
|
static inline dm_oblock_t to_oblock(dm_block_t b)
|
|
{
|
|
return (__force dm_oblock_t) b;
|
|
}
|
|
|
|
static inline dm_block_t from_oblock(dm_oblock_t b)
|
|
{
|
|
return (__force dm_block_t) b;
|
|
}
|
|
|
|
static inline dm_cblock_t to_cblock(uint32_t b)
|
|
{
|
|
return (__force dm_cblock_t) b;
|
|
}
|
|
|
|
static inline uint32_t from_cblock(dm_cblock_t b)
|
|
{
|
|
return (__force uint32_t) b;
|
|
}
|
|
|
|
static inline dm_dblock_t to_dblock(dm_block_t b)
|
|
{
|
|
return (__force dm_dblock_t) b;
|
|
}
|
|
|
|
static inline dm_block_t from_dblock(dm_dblock_t b)
|
|
{
|
|
return (__force dm_block_t) b;
|
|
}
|
|
|
|
#endif /* DM_CACHE_BLOCK_TYPES_H */
|