-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
librbd, cls_rbd: move parent_info and parent_spec to parent_types.h
parent_type.h is a new librbd-scope header containing info related to parents and children (clones) Signed-off-by: Dan Mick <[email protected]>
- Loading branch information
Dan Mick
committed
Aug 18, 2012
1 parent
9a45ffb
commit 31824b6
Showing
8 changed files
with
52 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- | ||
// vim: ts=8 sw=2 smarttab | ||
#ifndef CEPH_LIBRBD_PARENT_TYPES_H | ||
#define CEPH_LIBRBD_PARENT_TYPES_H | ||
|
||
// parent_spec uniquely identifies a parent in the clone relationship | ||
// (clone(parent) creates child, then parent_spec <-> child_imageid) | ||
|
||
namespace librbd { | ||
struct parent_spec { | ||
int64_t pool_id; | ||
string image_id; | ||
snapid_t snap_id; | ||
parent_spec() : pool_id(-1), snap_id(CEPH_NOSNAP) {} | ||
parent_spec(uint64_t pool_id, string image_id, snapid_t snap_id) : | ||
pool_id(pool_id), image_id(image_id), snap_id(snap_id) {} | ||
bool operator==(const parent_spec &other) { | ||
return ((this->pool_id == other.pool_id) && | ||
(this->image_id == other.image_id) && | ||
(this->snap_id == other.snap_id)); | ||
} | ||
bool operator!=(const parent_spec &other) { | ||
return !(*this == other); | ||
} | ||
}; | ||
|
||
struct parent_info { | ||
parent_spec spec; | ||
uint64_t overlap; | ||
parent_info() : overlap(0) {} | ||
}; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters