[stgt] [PATCH] Make the backing-store modules shared objects that are loaded at runtime

Dan Mick dan.mick at inktank.com
Sat Aug 10 08:29:50 CEST 2013


> It may seem weird to compile, but it *should* be enough to add package
> 'librbd1' (which will also pull in librados2) to allow the build with
> CEPH_RBD enabled.

Of course I really meant to say "librbd-dev (which pulls in 
librados-dev, librbd1, and librados2)".  I've set up a VM and verified 
those are sufficient at least for Ubuntu Quantal.

This time I saved the diffs too, which are simple:

diff --git a/usr/Makefile b/usr/Makefile
index 5c76f43..1199802 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -14,7 +14,7 @@ TGTD_OBJS += $(addprefix iscsi/, conn.o param.o 
session.o \
                 isns.o)

  ifneq ($(CEPH_RBD),)
-BS_OBJS += bs_rdb.so
+BS_OBJS += bs_rbd.so
  endif

  ifneq ($(shell test -e /usr/include/sys/eventfd.h && test -e 
/usr/include/libai
@@ -90,8 +90,8 @@ tgtimg: $(TGTIMG_OBJS)
  bs_aio.so: bs_aio.c
         $(CC) -shared $(CFLAGS) bs_aio.c -o bs_aio.so -laio

-bs_rdb.so: bs_rdb.c
-       $(CC) -shared $(CFLAGS) bs_rdb.c -o bs_rdb.so -lrados -lrbd
+bs_rbd.so: bs_rbd.c
+       $(CC) -shared $(CFLAGS) bs_rbd.c -o bs_rbd.so -lrados -lrbd

  .PHONY: install
  install: $(PROGRAMS)
diff --git a/usr/bs_rbd.c b/usr/bs_rbd.c
index b09090b..f1dd77d 100644
--- a/usr/bs_rbd.c
+++ b/usr/bs_rbd.c
@@ -529,7 +529,7 @@ static struct backingstore_template rbd_bst = {
         .bs_oflags_supported    = O_SYNC | O_DIRECT,
  };

-static __attribute__((constructor)) void bs_rbd_constructor(void)
+void register_bs_module(void)
  {
         register_backingstore_template(&rbd_bst);
  }
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list