Merge branch '2015-08-19-thin-show-duplicates' into merge-thin-ls
Conflicts: Makefile.in block-cache/block_cache.h main.cc thin-provisioning/commands.h
This commit is contained in:
@ -188,7 +188,7 @@ block_cache::wait_io()
|
||||
|
||||
for (i = 0; i < static_cast<unsigned>(r); i++) {
|
||||
io_event const &e = events_[i];
|
||||
block *b = container_of(e.obj, &block::control_block_);
|
||||
block *b = base::container_of(e.obj, &block::control_block_);
|
||||
|
||||
if (e.res == block_size_ << SECTOR_SHIFT)
|
||||
complete_io(*b, 0);
|
||||
|
@ -1,6 +1,8 @@
|
||||
#ifndef BLOCK_CACHE_H
|
||||
#define BLOCK_CACHE_H
|
||||
|
||||
#include "base/container_of.h"
|
||||
|
||||
#include <boost/intrusive/list.hpp>
|
||||
#include <boost/intrusive/set.hpp>
|
||||
#include <boost/noncopyable.hpp>
|
||||
@ -13,26 +15,12 @@
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
|
||||
namespace bi = boost::intrusive;
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
||||
// FIXME: move to own file in base
|
||||
template<class P, class M>
|
||||
size_t offsetof__(const M P::*member)
|
||||
{
|
||||
return (size_t) &( reinterpret_cast<P*>(0)->*member);
|
||||
}
|
||||
|
||||
template<class P, class M>
|
||||
P *container_of(M *ptr, M const P::*member)
|
||||
{
|
||||
return (P *)((char *)(ptr) - offsetof__(member));
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
||||
namespace bcache {
|
||||
typedef uint64_t block_address;
|
||||
typedef uint64_t sector_t;
|
||||
|
Reference in New Issue
Block a user