summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Durgin <josh.durgin@inktank.com>2012-08-31 20:17:17 +0200
committerJosh Durgin <josh.durgin@inktank.com>2012-08-31 20:17:17 +0200
commit1779d5ab0d04665b76d7f894b4a83f9788b645a9 (patch)
tree6ab3e0bdf65a9ea44c55918992f4e3f0991def74
parentcls_lock_client: change modified reference parameters to pointers (diff)
downloadceph-1779d5ab0d04665b76d7f894b4a83f9788b645a9.tar.xz
ceph-1779d5ab0d04665b76d7f894b4a83f9788b645a9.zip
cls_lock_client: fix indentation
Add indentation settings to header, and reindent. Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
-rw-r--r--src/cls/lock/cls_lock_client.h103
1 files changed, 51 insertions, 52 deletions
diff --git a/src/cls/lock/cls_lock_client.h b/src/cls/lock/cls_lock_client.h
index 760f9178d4f..527eefed767 100644
--- a/src/cls/lock/cls_lock_client.h
+++ b/src/cls/lock/cls_lock_client.h
@@ -16,75 +16,75 @@ namespace rados {
namespace lock {
extern void lock(librados::ObjectWriteOperation *rados_op,
- const std::string& name, ClsLockType type,
- const std::string& cookie, const std::string& tag,
- const std::string& description, const utime_t& duration,
- uint8_t flags);
+ const std::string& name, ClsLockType type,
+ const std::string& cookie, const std::string& tag,
+ const std::string& description, const utime_t& duration,
+ uint8_t flags);
extern int lock(librados::IoCtx *ioctx,
- const std::string& oid,
- const std::string& name, ClsLockType type,
- const std::string& cookie, const std::string& tag,
- const std::string& description, const utime_t& duration,
- uint8_t flags);
+ const std::string& oid,
+ const std::string& name, ClsLockType type,
+ const std::string& cookie, const std::string& tag,
+ const std::string& description, const utime_t& duration,
+ uint8_t flags);
extern void unlock(librados::ObjectWriteOperation *rados_op,
- const std::string& name, const std::string& cookie);
+ const std::string& name, const std::string& cookie);
extern int unlock(librados::IoCtx *ioctx, const std::string& oid,
- const std::string& name, const std::string& cookie);
+ const std::string& name, const std::string& cookie);
extern void break_lock(librados::ObjectWriteOperation *op,
- const std::string& name, const std::string& cookie,
- const entity_name_t& locker);
+ const std::string& name, const std::string& cookie,
+ const entity_name_t& locker);
extern int break_lock(librados::IoCtx *ioctx, const std::string& oid,
- const std::string& name, const std::string& cookie,
- const entity_name_t& locker);
+ const std::string& name, const std::string& cookie,
+ const entity_name_t& locker);
extern int list_locks(librados::IoCtx *ioctx, const std::string& oid,
- list<std::string> *locks);
+ list<std::string> *locks);
extern int get_lock_info(librados::IoCtx *ioctx, const std::string& oid,
- const std::string& lock,
- map<locker_id_t, locker_info_t> *lockers,
- ClsLockType *lock_type,
- std::string *tag);
+ const std::string& lock,
+ map<locker_id_t, locker_info_t> *lockers,
+ ClsLockType *lock_type,
+ std::string *tag);
class Lock {
- std::string name;
- std::string cookie;
- std::string tag;
- std::string description;
- utime_t duration;
- uint8_t flags;
+ std::string name;
+ std::string cookie;
+ std::string tag;
+ std::string description;
+ utime_t duration;
+ uint8_t flags;
public:
- Lock(const std::string& _n) : name(_n), flags(0) {}
-
- void set_cookie(const std::string& c) { cookie = c; }
- void set_tag(const std::string& t) { tag = t; }
- void set_description(const std::string& desc) { description = desc; }
- void set_duration(const utime_t& e) { duration = e; }
- void set_renew(bool renew) {
- if (renew) {
- flags |= LOCK_FLAG_RENEW;
- } else {
- flags &= ~LOCK_FLAG_RENEW;
- }
- }
-
- /* ObjectWriteOperation */
- void lock_exclusive(librados::ObjectWriteOperation *ioctx);
- void lock_shared(librados::ObjectWriteOperation *ioctx);
- void unlock(librados::ObjectWriteOperation *ioctx);
- void break_lock(librados::ObjectWriteOperation *ioctx, const entity_name_t& locker);
-
- /* IoCtx*/
- int lock_exclusive(librados::IoCtx *ioctx, const std::string& oid);
- int lock_shared(librados::IoCtx *ioctx, const std::string& oid);
- int unlock(librados::IoCtx *ioctx, const std::string& oid);
- int break_lock(librados::IoCtx *ioctx, const std::string& oid,
+ Lock(const std::string& _n) : name(_n), flags(0) {}
+
+ void set_cookie(const std::string& c) { cookie = c; }
+ void set_tag(const std::string& t) { tag = t; }
+ void set_description(const std::string& desc) { description = desc; }
+ void set_duration(const utime_t& e) { duration = e; }
+ void set_renew(bool renew) {
+ if (renew) {
+ flags |= LOCK_FLAG_RENEW;
+ } else {
+ flags &= ~LOCK_FLAG_RENEW;
+ }
+ }
+
+ /* ObjectWriteOperation */
+ void lock_exclusive(librados::ObjectWriteOperation *ioctx);
+ void lock_shared(librados::ObjectWriteOperation *ioctx);
+ void unlock(librados::ObjectWriteOperation *ioctx);
+ void break_lock(librados::ObjectWriteOperation *ioctx, const entity_name_t& locker);
+
+ /* IoCtx */
+ int lock_exclusive(librados::IoCtx *ioctx, const std::string& oid);
+ int lock_shared(librados::IoCtx *ioctx, const std::string& oid);
+ int unlock(librados::IoCtx *ioctx, const std::string& oid);
+ int break_lock(librados::IoCtx *ioctx, const std::string& oid,
const entity_name_t& locker);
};
@@ -93,4 +93,3 @@ namespace rados {
} // namespace rados
#endif
-