FUJITA Tomonori wrote: > On Mon, 23 Feb 2009 20:06:06 +0200 > Boaz Harrosh <bharrosh at panasas.com> wrote: > >> aio backend is very broken on BSD. #idef out of the way >> to enable compilation of code. >> >> Signed-off-by: Boaz Harrosh <bharrosh at panasas.com> >> --- >> usr/bs_aio.h | 24 ++++++++++++++++++++++++ >> 1 files changed, 24 insertions(+), 0 deletions(-) >> >> diff --git a/usr/bs_aio.h b/usr/bs_aio.h >> index f62e99c..c028848 100644 >> --- a/usr/bs_aio.h >> +++ b/usr/bs_aio.h >> @@ -132,34 +132,58 @@ static inline void io_prep_pwrite(struct iocb *iocb, int fd, void const *buf, >> >> static inline int io_setup(unsigned nr_reqs, io_context_t *ctx) >> { >> +#ifndef __MAKE_TGT_ON_BSD__ >> return syscall(__NR_io_setup, nr_reqs, ctx); >> +#else >> + return -1; >> +#endif >> } > > Hmm, why can't you just do something like this? > > diff --git a/usr/Makefile b/usr/Makefile > index f76cac2..d29fae9 100644 > --- a/usr/Makefile > +++ b/usr/Makefile > @@ -4,6 +4,8 @@ EXTRAVERSION = $(if $(shell git-show-ref 2>/dev/null),-git-$(shell git-show-ref > mandir = /usr/share/man > docdir = /usr/share/doc/tgt > > +UNAME ?= $(shell uname) > + > ifneq ($(IBMVIO),) > CFLAGS += -DIBMVIO -DUSE_KERNEL > TGTD_OBJS += $(addprefix ibmvio/, ibmvio.o) > @@ -15,7 +17,7 @@ CFLAGS += -DISCSI > TGTD_OBJS += $(addprefix iscsi/, conn.o param.o session.o \ > iscsid.o target.o chap.o transport.o iscsi_tcp.o \ > isns.o) > -TGTD_OBJS += bs_rdwr.o bs_aio.o > +TGTD_OBJS += bs_rdwr.o > > LIBS += -lcrypto > ifneq ($(ISCSI_RDMA),) > @@ -23,6 +25,11 @@ CFLAGS += -DISCSI_RDMA > TGTD_OBJS += iscsi/iscsi_rdma.o > LIBS += -libverbs -lrdmacm > endif > + > +ifeq ($(UNAME),Linux) > +TGTD_OBJS += bs_aio.o > +endif > + > endif > > ifneq ($(FCP),) I will try that, it looks like a very good Idea Boaz -- 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 |