Skip to content

Commit

Permalink
Rename the LTFS FreeBSD backend to conform to the LTFS backend
Browse files Browse the repository at this point in the history
naming conventions.

Old:  libtape-camtape-freebsd.so and tape_freebsd_camtape
New:  libtape-cam.so and tape_freebsd_cam

As Abe-san explained:

"We introduced weak convention against tape backend name (Sorry it
is undocumented yet...).

Naming of the backend is tape_[platform]_[accessdriver]_[supportdrive]
Naming of the library file is libtape-[accessdriver]-[supportdrive]

For example, ibmtape support on sg (on linux) is

Platform: linux
Access driver: sg
Support drives: ibmtape"

He also explained that the drive support portion is implicit and
can be omitted.

So, for now, we'll call it the CAM backend.  It uses both the sa(4)
and pass(4) drivers.  It is possible that at some point, we'll do
a passthrough-only FreeBSD backend, like the Linux sg backend.  If
we do that, it will probably be best to do that by modifying the sg
backend to talk to a generic SCSI passthrough layer that works with
Linux, FreeBSD and other OSes.  If we do that, we'll probably need
to consider renaming the sg backend to something else at that
point.

I left the function names and other variables in the backend as
camtape_*.  Since there are lots of functions in libcam on FreeBSD
that are prefixed with cam_, renaming the functions inside the
backend to cam_* may produce conflicts.  For instance, the LTFS
backend has a camtape_send_ccb(), and libcam has a cam_send_ccb().
Renaming the backend function to cam_send_ccb() would produce an
obvious conflict.

conf/Makefile.am:
	libtape-camtape-freebsd.so -> libtape-cam.so

configure.ac:
	DEFAULT_TAPE=camtape -> DEFAULT_TAPE=cam

messages/Makefile.am:
	tape_freebsd_camtape_dat.o -> tape_freebsd_cam_dat.o

messages/tape_freebsd_camtape -> messages/tape_freebsd_cam:

src/tape_drivers/freebsd/cam/Makefile.am:
	libtape_camtape_freebsd -> libtape_cam
	camtape_cmn.c -> cam_cmn.c
	camtape_tc.c -> cam_tc.c

src/tape_drivers/freebsd/cam/camtape_cmn.c:
	Renamed to cam_cmn.c.

src/tape_drivers/freebsd/cam/camtape_cmn.h:
	Renamed to cam_cmn.h.

src/tape_drivers/freebsd/cam/camtape_tc.c:
	Renamed to cam_tc.c.

	Change the include for camtape_cmn.h to cam_cmn.h.

	The message data bundle is now called tape_freebsd_cam_dat.
  • Loading branch information
kendmerry committed Mar 9, 2018
1 parent 4c9cb9f commit d6f9f71
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion conf/Makefile.am
Expand Up @@ -11,7 +11,7 @@ PLAT_OPT += plugin tape iokit __LIBDIR__/ltfs/libtape-iokit-ibmtape.so
endif

if PLATFORM_FREEBSD
PLAT_OPT += plugin tape camtape __LIBDIR__/ltfs/libtape-camtape-freebsd.so
PLAT_OPT += plugin tape cam __LIBDIR__/ltfs/libtape-cam.so
endif

if ENABLE_LIN_TAPE
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -163,7 +163,7 @@ then
fi
if test "x${host_freebsd}" = "xyes"
then
DEFAULT_TAPE=camtape
DEFAULT_TAPE=cam
fi
fi

Expand Down
2 changes: 1 addition & 1 deletion messages/Makefile.am
Expand Up @@ -57,7 +57,7 @@ RESOURCES = \
tape_linux_lin_tape_dat.o \
tape_linux_sg_ibmtape_dat.o \
tape_iokit_ibmtape_dat.o \
tape_freebsd_camtape_dat.o \
tape_freebsd_cam_dat.o \
iosched_fcfs_dat.o \
iosched_unified_dat.o \
libltfs_dat.o \
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 12 additions & 12 deletions src/tape_drivers/freebsd/cam/Makefile.am
Expand Up @@ -35,24 +35,24 @@
#


lib_LTLIBRARIES = libtape-camtape-freebsd.la
lib_LTLIBRARIES = libtape-cam.la
libdir = @libdir@/ltfs

AM_LIBTOOLFLAGS = --tag=disable-static

libtape_camtape_freebsd_la_SOURCES = camtape_cmn.c camtape_tc.c
libtape_camtape_freebsd_la_DEPENDENCIES = ../../../../messages/tape_freebsd_camtape_dat.o libtape_camtape_freebsd_la-reed_solomon_crc.lo libtape_camtape_freebsd_la-crc32c_crc.lo libtape_camtape_freebsd_la-ibm_tape.lo
libtape_camtape_freebsd_la_LIBADD = ../../../../messages/tape_freebsd_camtape_dat.o ./libtape_camtape_freebsd_la-reed_solomon_crc.lo ./libtape_camtape_freebsd_la-crc32c_crc.lo ./libtape_camtape_freebsd_la-ibm_tape.lo
libtape_camtape_freebsd_la_LDFLAGS = -avoid-version -module
libtape_camtape_freebsd_la_CPPFLAGS = @AM_CPPFLAGS@ -I ../../.. -I ../..
libtape_camtape_freebsd_la-reed_solomon_crc.lo: ../../reed_solomon_crc.c
$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtape_camtape_freebsd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(CRC_OPTIMIZE) -MT libtape_camtape_freebsd_la-reed_solomon_crc.lo -MD -MP -c -o libtape_camtape_freebsd_la-reed_solomon_crc.lo ../../reed_solomon_crc.c
libtape_cam_la_SOURCES = cam_cmn.c cam_tc.c
libtape_cam_la_DEPENDENCIES = ../../../../messages/tape_freebsd_cam_dat.o libtape_cam_la-reed_solomon_crc.lo libtape_cam_la-crc32c_crc.lo libtape_cam_la-ibm_tape.lo
libtape_cam_la_LIBADD = ../../../../messages/tape_freebsd_cam_dat.o ./libtape_cam_la-reed_solomon_crc.lo ./libtape_cam_la-crc32c_crc.lo ./libtape_cam_la-ibm_tape.lo
libtape_cam_la_LDFLAGS = -avoid-version -module
libtape_cam_la_CPPFLAGS = @AM_CPPFLAGS@ -I ../../.. -I ../..
libtape_cam_la-reed_solomon_crc.lo: ../../reed_solomon_crc.c
$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtape_cam_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(CRC_OPTIMIZE) -MT libtape_cam_la-reed_solomon_crc.lo -MD -MP -c -o libtape_cam_la-reed_solomon_crc.lo ../../reed_solomon_crc.c

libtape_camtape_freebsd_la-crc32c_crc.lo: ../../crc32c_crc.c
$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtape_camtape_freebsd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(CRC_OPTIMIZE) -MT libtape_camtape_freebsd_la-crc32c_crc.lo -MD -MP -c -o libtape_camtape_freebsd_la-crc32c_crc.lo ../../crc32c_crc.c
libtape_cam_la-crc32c_crc.lo: ../../crc32c_crc.c
$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtape_cam_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(CRC_OPTIMIZE) -MT libtape_cam_la-crc32c_crc.lo -MD -MP -c -o libtape_cam_la-crc32c_crc.lo ../../crc32c_crc.c

libtape_camtape_freebsd_la-ibm_tape.lo: ../../ibm_tape.c
$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtape_camtape_freebsd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(CRC_OPTIMIZE) -MT libtape_camtape_freebsd_la-ibm_tape.lo -MD -MP -c -o libtape_camtape_freebsd_la-ibm_tape.lo ../../ibm_tape.c
libtape_cam_la-ibm_tape.lo: ../../ibm_tape.c
$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtape_cam_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(CRC_OPTIMIZE) -MT libtape_cam_la-ibm_tape.lo -MD -MP -c -o libtape_cam_la-ibm_tape.lo ../../ibm_tape.c


install-exec-hook:
Expand Down
Expand Up @@ -62,7 +62,7 @@
#include "ltfs_copyright.h"
#include "ibm_tape.h"
#include "libltfs/ltfslogging.h"
#include "camtape_cmn.h"
#include "cam_cmn.h"

volatile char *copyright = LTFS_COPYRIGHT_0"\n"LTFS_COPYRIGHT_1"\n"LTFS_COPYRIGHT_2"\n";

Expand Down
File renamed without changes.
Expand Up @@ -80,7 +80,7 @@
#include "tape_drivers/ibm_tape.h"

#define TAPE_BACKEND /* Use static vriable definition in tape_drivers.h */
#include "camtape_cmn.h"
#include "cam_cmn.h"
#include "reed_solomon_crc.h"
#include "crc32c_crc.h"

Expand Down Expand Up @@ -4108,12 +4108,12 @@ struct tape_ops *tape_dev_get_ops(void)
return &camtape_drive_handler;
}

extern char tape_freebsd_camtape_dat[];
extern char tape_freebsd_cam_dat[];

const char *tape_dev_get_message_bundle_name(void **message_data)
{
*message_data = tape_freebsd_camtape_dat;
return "tape_freebsd_camtape";
*message_data = tape_freebsd_cam_dat;
return "tape_freebsd_cam";
}

/**
Expand Down

0 comments on commit d6f9f71

Please sign in to comment.