From: Jeff Layton Date: Mon, 29 Aug 2016 11:16:38 +0000 (-0400) Subject: client: move the device bitshift handling macros to Client.h X-Git-Tag: v11.0.1~326^2~28 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2115de04a417e6df4272fc836829b70bd6a2b97e;p=ceph.git client: move the device bitshift handling macros to Client.h We'll need them in Client.cc now in addition to FUSE specific code. Signed-off-by: Jeff Layton --- diff --git a/src/client/Client.h b/src/client/Client.h index 1a7cefd2257e..5b0b7ee0a4c3 100644 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -93,6 +93,14 @@ struct CommandOp std::string *outs; }; +/* Device bit shift handling */ +#define MINORBITS 20 +#define MINORMASK ((1U << MINORBITS) - 1) + +#define MAJOR(dev) ((unsigned int) ((dev) >> MINORBITS)) +#define MINOR(dev) ((unsigned int) ((dev) & MINORMASK)) +#define MKDEV(ma,mi) (((ma) << MINORBITS) | (mi)) + /* error code for ceph_fuse */ #define CEPH_FUSE_NO_MDS_UP -(1<<2) /* no mds up deteced in ceph_fuse */ diff --git a/src/client/fuse_ll.cc b/src/client/fuse_ll.cc index de14029943d1..b30e2e0ba44b 100644 --- a/src/client/fuse_ll.cc +++ b/src/client/fuse_ll.cc @@ -41,13 +41,6 @@ #define FINO_STAG(x) ((x) >> 48) #define MAKE_FINO(i,s) ((i) | ((s) << 48)) -#define MINORBITS 20 -#define MINORMASK ((1U << MINORBITS) - 1) - -#define MAJOR(dev) ((unsigned int) ((dev) >> MINORBITS)) -#define MINOR(dev) ((unsigned int) ((dev) & MINORMASK)) -#define MKDEV(ma,mi) (((ma) << MINORBITS) | (mi)) - static uint32_t new_encode_dev(dev_t dev) { unsigned major = MAJOR(dev);