mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
dm: add persistent data library
The persistent-data library offers a re-usable framework for the storage and management of on-disk metadata in device-mapper targets. It's used by the thin-provisioning target in the next patch and in an upcoming hierarchical storage target. For further information, please read Documentation/device-mapper/persistent-data.txt Signed-off-by: Joe Thornber <thornber@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
This commit is contained in:
parent
95d402f057
commit
3241b1d3e0
22 changed files with 5709 additions and 0 deletions
19
drivers/md/persistent-data/dm-persistent-data-internal.h
Normal file
19
drivers/md/persistent-data/dm-persistent-data-internal.h
Normal file
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* Copyright (C) 2011 Red Hat, Inc.
|
||||
*
|
||||
* This file is released under the GPL.
|
||||
*/
|
||||
|
||||
#ifndef _DM_PERSISTENT_DATA_INTERNAL_H
|
||||
#define _DM_PERSISTENT_DATA_INTERNAL_H
|
||||
|
||||
#include "dm-block-manager.h"
|
||||
|
||||
static inline unsigned dm_hash_block(dm_block_t b, unsigned hash_mask)
|
||||
{
|
||||
const unsigned BIG_PRIME = 4294967291UL;
|
||||
|
||||
return (((unsigned) b) * BIG_PRIME) & hash_mask;
|
||||
}
|
||||
|
||||
#endif /* _PERSISTENT_DATA_INTERNAL_H */
|
Loading…
Add table
Add a link
Reference in a new issue