Skip to content

Commit

Permalink
Remove HPE tape backend operations unused by libltfs
Browse files Browse the repository at this point in the history
Externally built backend will have to be patched so that
these operations are #ifdef out.

I kept format() HPE extra arguments even if they are
unused by libltfs, because it is annoying to have the
same function with two different prototypes.
  • Loading branch information
manu0401 authored and Atsushi Abe committed Feb 20, 2019
1 parent 69de75b commit f09f95b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 53 deletions.
4 changes: 2 additions & 2 deletions src/libltfs/ltfslogging.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ extern bool ltfs_print_thread_id;
do { \
printf(LTFS ## id, ##__VA_ARGS__); \
} while(0)
#else /* MSG_CHECK */
#else
#define ltfsmsg(level, id, ...) \
do { \
if (level <= ltfs_log_level) \
ltfsmsg_internal(true, level, NULL, #id, ##__VA_ARGS__); \
} while (0)
#endif /* MSG_CHECK */
#endif

/* CAUTION: ltfsmsg_buffer takes message ID as a text literal */
/* Wrapper for ltfsmsg_internal. It only invokes the message print function if the requested
Expand Down
5 changes: 0 additions & 5 deletions src/libltfs/tape.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,6 @@ int tape_device_open(struct device_data *device, const char *devname, struct tap

/* Validate the tape operations structure. */
for (i=0; i<sizeof(struct tape_ops)/sizeof(void *); ++i) {
/* It is fine to not define operation not used lib libltfs */
if ((void *)ops + i == (void *)&ops->loadunload ||
(void *)ops + i == (void *)&ops->report_density ||
(void *)ops + i == (void *)&ops->update_mam_attr)
continue;
if ((((void **)ops)[i]) == NULL) {
ltfsmsg(LTFS_ERR, 12004E);
return -LTFS_PLUGIN_INCOMPLETE;
Expand Down
46 changes: 0 additions & 46 deletions src/libltfs/tape_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -452,23 +452,6 @@ struct tape_ops {
*/
int (*rewind)(void *device, struct tc_position *pos);

/**
* Load or unload medium to/from a device
* Unused by libltfs (HPE extension)
* HPE Change - CR 11358 - Add a more flexible means of loading and unload.
* @param device Device handle returned by the backend's open().
* @param pos Pointer to a tc_position structure. The backend must fill this structure with
* the final logical block position of the device, even on error.
* libltfs does not depend on any particular position being set here.
* @param load Whether to load (TRUE) or unload (FALSE)
* @param hold Whether to partially load/unload (TRUE) or fully (FALSE)
* @return 0 on success or a negative value on error.
* If no medium is present in the device, the backend must return -EDEV_NO_MEDIUM.
* If the medium is unsupported (for example, does not support two partitions),
* the backend should return -LTFS_UNSUPPORTED_MEDIUM.
*/
int (*loadunload)(void *device, struct tc_position *pos, bool load, bool hold);

/**
* Seek to the specified position on a device.
* @param device Device handle returned by the backend's open().
Expand Down Expand Up @@ -711,18 +694,6 @@ struct tape_ops {
*/
int (*allow_overwrite)(void *device, const struct tc_position pos);

/**
* Issue a Report Density Support command to a device.
* This command is not currently used by libltfs (HPE extension)
* @param device Device handle returned by the backend's open().
* @param rep On success, the backend must fill this with the density report data returned by
* the device.
* @param medium set medium bit on
* @return 0 on success or a negative value on error.
*/
int (*report_density)(void *device, struct tc_density_report *rep, bool medium);


/**
* Enable or disable compression on a device.
* @param device Device handle returned by the backend's open().
Expand Down Expand Up @@ -896,23 +867,6 @@ struct tape_ops {
const unsigned char cart_type,
const unsigned char density);

/**
* Updating the MAM attributes.
* Unused by libltfs (HPE extension)
* @param device Pointer to ltotape backend.
* @param FORMAT The format type
* @param vol_name An optional volume name to the tape.
* @param barcode_name The volume barcode name
* @param lockbit volume lock state bit to be set in MAM
* @return 0 on success, a negative value on error.
*/
int (*update_mam_attr) (void *device,
TC_FORMAT_TYPE format,
const char *vol_name,
unsigned int attribute_id,
const char *barcode_name,
mam_lockval lockbit);

/**
* Check if the loaded carridge is WORM.
* @param device Device handle returned by the backend's open().
Expand Down

0 comments on commit f09f95b

Please sign in to comment.