Commit 393f7a62 authored by Steven Murray's avatar Steven Murray
Browse files

Renamed castor::tape::tapeserver::drives to drive

The C++ namespace castor::tape::tapeserver::drive now matches its
directory structure.
parent b4651366
......@@ -48,8 +48,8 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
castor::tape::SCSI::DeviceInfo driveInfo = dv.findBySymlink(m_driveConfig.devFilename);
// Instantiate the drive object
std::auto_ptr<castor::tape::tapeserver::drives::DriveInterface> drive(
castor::tape::tapeserver::drives::DriveFactory(driveInfo, m_sysWrapper));
std::auto_ptr<castor::tape::tapeserver::drive::DriveInterface> drive(
castor::tape::tapeserver::drive::DriveFactory(driveInfo, m_sysWrapper));
if(NULL == drive.get()) {
castor::exception::Exception ex;
......
......@@ -172,7 +172,7 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
// file to recall.
// findDrive does not throw exceptions (it catches them to log errors)
// A NULL pointer is returned on failure
std::auto_ptr<castor::tape::tapeserver::drives::DriveInterface> drive(findDrive(m_driveConfig,lc));
std::auto_ptr<castor::tape::tapeserver::drive::DriveInterface> drive(findDrive(m_driveConfig,lc));
if(!drive.get()) return MARK_DRIVE_AS_UP;
// We can now start instantiating all the components of the data path
......@@ -265,7 +265,7 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
// in order to get the task injector ready to check if we actually have a
// file to migrate.
// 1) Get hold of the drive error logs are done inside the findDrive function
std::auto_ptr<castor::tape::tapeserver::drives::DriveInterface> drive(findDrive(m_driveConfig,lc));
std::auto_ptr<castor::tape::tapeserver::drive::DriveInterface> drive(findDrive(m_driveConfig,lc));
if (!drive.get()) return MARK_DRIVE_AS_UP;
// Once we got hold of the drive, we can run the session
{
......@@ -381,7 +381,7 @@ void castor::tape::tapeserver::daemon::DataTransferSession::executeDump(log::Log
* @param lc For logging purpose
* @return the drive if found, NULL otherwise
*/
castor::tape::tapeserver::drives::DriveInterface *
castor::tape::tapeserver::drive::DriveInterface *
castor::tape::tapeserver::daemon::DataTransferSession::findDrive(const utils::DriveConfig
&driveConfig, log::LogContext& lc) {
// Find the drive in the system's SCSI devices
......@@ -443,8 +443,8 @@ castor::tape::tapeserver::daemon::DataTransferSession::findDrive(const utils::Dr
return NULL;
}
try {
std::auto_ptr<castor::tape::tapeserver::drives::DriveInterface> drive;
drive.reset(castor::tape::tapeserver::drives::DriveFactory(driveInfo, m_sysWrapper));
std::auto_ptr<castor::tape::tapeserver::drive::DriveInterface> drive;
drive.reset(castor::tape::tapeserver::drive::DriveFactory(driveInfo, m_sysWrapper));
if (drive.get()) drive->librarySlot = driveConfig.librarySlot;
return drive.release();
} catch (castor::exception::Exception & e) {
......
......@@ -160,7 +160,7 @@ namespace daemon {
/** utility to find the drive on the system. This function logs
* all errors and hence does not throw exceptions. It returns NULL
* in case of failure. */
castor::tape::tapeserver::drives::DriveInterface * findDrive(
castor::tape::tapeserver::drive::DriveInterface * findDrive(
const utils::DriveConfig &driveConfig,log::LogContext & lc);
/** sub-part of execute for the read sessions */
......
......@@ -108,7 +108,7 @@ TEST(tapeServer, DataTransferSessionGooddayRecall) {
//delete is unnecessary
//pointer with ownership will be passed to the application,
//which will do the delete
mockSys.fake.m_pathToDrive["/dev/nst0"] = new castor::tape::tapeserver::drives::FakeDrive;
mockSys.fake.m_pathToDrive["/dev/nst0"] = new castor::tape::tapeserver::drive::FakeDrive;
// We can prepare files for reading on the drive
{
......@@ -212,7 +212,7 @@ TEST(tapeServer, DataTransferSessionWrongRecall) {
//delete is unnecessary
//pointer with ownership will be passed to the application,
//which will do the delete
mockSys.fake.m_pathToDrive["/dev/nst0"] = new castor::tape::tapeserver::drives::FakeDrive;
mockSys.fake.m_pathToDrive["/dev/nst0"] = new castor::tape::tapeserver::drive::FakeDrive;
// We can prepare files for reading on the drive
{
......@@ -433,7 +433,7 @@ TEST(tapeServer, DataTransferSessionGooddayMigration) {
//delete is unnecessary
//pointer with ownership will be passed to the application,
//which will do the delete
mockSys.fake.m_pathToDrive["/dev/nst0"] = new castor::tape::tapeserver::drives::FakeDrive;
mockSys.fake.m_pathToDrive["/dev/nst0"] = new castor::tape::tapeserver::drive::FakeDrive;
// Just label the tape
castor::tape::tapeFile::LabelSession ls(*mockSys.fake.m_pathToDrive["/dev/nst0"],
......@@ -527,7 +527,7 @@ TEST(tapeServer, DataTransferSessionMissingFilesMigration) {
//delete is unnecessary
//pointer with ownership will be passed to the application,
//which will do the delete
mockSys.fake.m_pathToDrive["/dev/nst0"] = new castor::tape::tapeserver::drives::FakeDrive;
mockSys.fake.m_pathToDrive["/dev/nst0"] = new castor::tape::tapeserver::drive::FakeDrive;
// Just label the tape
castor::tape::tapeFile::LabelSession ls(*mockSys.fake.m_pathToDrive["/dev/nst0"],
......@@ -615,7 +615,7 @@ TEST(tapeServer, DataTransferSessionTapeFullMigration) {
//pointer with ownership will be passed to the application,
//which will do the delete
const uint64_t tapeSize = 5000;
mockSys.fake.m_pathToDrive["/dev/nst0"] = new castor::tape::tapeserver::drives::FakeDrive(tapeSize);
mockSys.fake.m_pathToDrive["/dev/nst0"] = new castor::tape::tapeserver::drive::FakeDrive(tapeSize);
// Just label the tape
castor::tape::tapeFile::LabelSession ls(*mockSys.fake.m_pathToDrive["/dev/nst0"],
......@@ -721,8 +721,8 @@ TEST(tapeServer, DataTransferSessionTapeFullOnFlushMigration) {
//which will do the delete
const uint64_t tapeSize = 5000;
mockSys.fake.m_pathToDrive["/dev/nst0"] =
new castor::tape::tapeserver::drives::FakeDrive(tapeSize,
castor::tape::tapeserver::drives::FakeDrive::OnFlush);
new castor::tape::tapeserver::drive::FakeDrive(tapeSize,
castor::tape::tapeserver::drive::FakeDrive::OnFlush);
// Just label the tape
castor::tape::tapeFile::LabelSession ls(*mockSys.fake.m_pathToDrive["/dev/nst0"],
......
......@@ -73,7 +73,7 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
log::Param("dgn", m_request.dgn)};
mountTape();
std::auto_ptr<castor::tape::tapeserver::drives::DriveInterface> drive =
std::auto_ptr<castor::tape::tapeserver::drive::DriveInterface> drive =
getDriveObject();
waitUntilTapeLoaded(drive.get(), 60); // 60 = 60 seconds
checkTapeIsWritable(drive.get());
......@@ -98,15 +98,15 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
//------------------------------------------------------------------------------
// getDriveObject
//------------------------------------------------------------------------------
std::auto_ptr<castor::tape::tapeserver::drives::DriveInterface>
std::auto_ptr<castor::tape::tapeserver::drive::DriveInterface>
castor::tape::tapeserver::daemon::LabelSession::getDriveObject() {
castor::tape::SCSI::DeviceVector dv(m_sysWrapper);
castor::tape::SCSI::DeviceInfo driveInfo =
dv.findBySymlink(m_driveConfig.devFilename);
// Instantiate the drive object
std::auto_ptr<castor::tape::tapeserver::drives::DriveInterface> drive(
castor::tape::tapeserver::drives::DriveFactory(driveInfo, m_sysWrapper));
std::auto_ptr<castor::tape::tapeserver::drive::DriveInterface> drive(
castor::tape::tapeserver::drive::DriveFactory(driveInfo, m_sysWrapper));
if(NULL == drive.get()) {
castor::exception::Exception ex;
......@@ -150,7 +150,7 @@ void castor::tape::tapeserver::daemon::LabelSession::mountTape() {
// waitUntilTapeLoaded
//------------------------------------------------------------------------------
void castor::tape::tapeserver::daemon::LabelSession::waitUntilTapeLoaded(
drives::DriveInterface *const drive, const int timeoutSecond) {
drive::DriveInterface *const drive, const int timeoutSecond) {
try {
drive->waitUntilReady(timeoutSecond);
const log::Param params[] = {
......@@ -170,7 +170,7 @@ void castor::tape::tapeserver::daemon::LabelSession::waitUntilTapeLoaded(
// checkTapeIsWritable
//------------------------------------------------------------------------------
void castor::tape::tapeserver::daemon::LabelSession::checkTapeIsWritable(
drives::DriveInterface *const drive) {
drive::DriveInterface *const drive) {
if(drive->isWriteProtected()) {
castor::exception::Exception ex;
ex.getMessage() << "Tape to be labeled in write protected";
......@@ -187,6 +187,6 @@ void castor::tape::tapeserver::daemon::LabelSession::checkTapeIsWritable(
// labelTheTape
//------------------------------------------------------------------------------
void castor::tape::tapeserver::daemon::LabelSession::labelTheTape(
drives::DriveInterface *const drive) {
drive::DriveInterface *const drive) {
tapeFile::LabelSession ls(*drive, m_request.vid, m_force);
}
......@@ -115,7 +115,7 @@ private:
*
* @return The drive object.
*/
std::auto_ptr<castor::tape::tapeserver::drives::DriveInterface> getDriveObject();
std::auto_ptr<castor::tape::tapeserver::drive::DriveInterface> getDriveObject();
/**
* Mounts the tape to be labelled.
......@@ -129,7 +129,7 @@ private:
* @param timeoutSecond The number of seconds to wait for the tape to be
* loaded into the tape drive.
*/
void waitUntilTapeLoaded(drives::DriveInterface *const drive,
void waitUntilTapeLoaded(drive::DriveInterface *const drive,
const int timeoutSecond);
/**
......@@ -137,14 +137,14 @@ private:
*
* @param drive Object representing the drive hardware.
*/
void checkTapeIsWritable(drives::DriveInterface *const drive);
void checkTapeIsWritable(drive::DriveInterface *const drive);
/**
* The function carrying out the actual labeling
* @param drive The drive object pointer
* @return
*/
void labelTheTape(drives::DriveInterface *const drive);
void labelTheTape(drive::DriveInterface *const drive);
/**
* Proxy object representing the tapeserverd daemon.
......
......@@ -77,7 +77,7 @@ void MigrationReportPacker::reportFailedJob(const tapegateway::FileToMigrateStru
//------------------------------------------------------------------------------
//reportFlush
//------------------------------------------------------------------------------
void MigrationReportPacker::reportFlush(drives::compressionStats compressStats){
void MigrationReportPacker::reportFlush(drive::compressionStats compressStats){
castor::server::MutexLocker ml(&m_producterProtection);
m_fifo.push(new ReportFlush(compressStats));
}
......
......@@ -72,7 +72,7 @@ public:
* @param compressStats
*
*/
void reportFlush(drives::compressionStats compressStats);
void reportFlush(drive::compressionStats compressStats);
/**
* Create into the MigrationReportPacker a report for the nominal end of session
......@@ -121,7 +121,7 @@ private:
virtual void execute(MigrationReportPacker& reportPacker);
};
class ReportFlush : public Report {
drives::compressionStats m_compressStats;
drive::compressionStats m_compressStats;
/**
* This function will approximate the compressed size of the files which
......@@ -143,7 +143,7 @@ private:
* @param nbByte the number of byte it really wrote to tape between
* this flush and the previous one
* */
ReportFlush(drives::compressionStats compressStats):m_compressStats(compressStats){}
ReportFlush(drive::compressionStats compressStats):m_compressStats(compressStats){}
void execute(MigrationReportPacker& reportPacker);
};
......
......@@ -29,7 +29,7 @@
namespace unitTests {
const std::string error="ERROR_TEST";
using namespace castor::tape;
const tapeserver::drives::compressionStats statsCompress;
const tapeserver::drive::compressionStats statsCompress;
using ::testing::_;
TEST(castor_tape_tapeserver_daemon, MigrationReportPackerNominal) {
......@@ -172,7 +172,7 @@ TEST(castor_tape_tapeserver_daemon, MigrationReportPackerOneByteFile) {
mrp.reportCompletedJob(migratedFileSmall,0,0);
mrp.reportCompletedJob(migrateNullFile,0,0);
tapeserver::drives::compressionStats stats;
tapeserver::drive::compressionStats stats;
stats.toTape=(100000+1)/3;
mrp.reportFlush(stats);
mrp.reportEndOfSession();
......
......@@ -59,7 +59,7 @@ class FakeSingleTapeReadThread : public TapeSingleThreadInterface<TapeReadTask>
public:
using TapeSingleThreadInterface<TapeReadTask>::m_tasks;
FakeSingleTapeReadThread(castor::tape::tapeserver::drives::DriveInterface& drive,
FakeSingleTapeReadThread(castor::tape::tapeserver::drive::DriveInterface& drive,
castor::legacymsg::RmcProxy & rmc,
castor::tape::tapeserver::daemon::TapeServerReporter & tsr,
const castor::tape::tapeserver::client::ClientInterface::VolumeInfo& volInfo,
......@@ -87,7 +87,7 @@ TEST(castor_tape_tapeserver_daemon, RecallTaskInjectorNominal) {
castor::log::StringLogger log("castor_tape_tapeserver_daemon_RecallTaskInjectorTest");
castor::log::LogContext lc(log);
RecallMemoryManager mm(50U,50U,lc);
castor::tape::tapeserver::drives::FakeDrive drive;
castor::tape::tapeserver::drive::FakeDrive drive;
FakeClient client(nbCalls);
FakeDiskWriteThreadPool diskWrite(lc);
castor::legacymsg::RmcProxyDummy rmc;
......@@ -144,7 +144,7 @@ TEST(castor_tape_tapeserver_daemon, RecallTaskInjectorNoFiles) {
castor::log::StringLogger log("castor_tape_tapeserver_daemon_RecallTaskInjectorTest");
castor::log::LogContext lc(log);
RecallMemoryManager mm(50U,50U,lc);
castor::tape::tapeserver::drives::FakeDrive drive;
castor::tape::tapeserver::drive::FakeDrive drive;
FakeClient client(0);
FakeDiskWriteThreadPool diskWrite(lc);
castor::legacymsg::RmcProxyDummy rmc;
......
......@@ -26,7 +26,7 @@
//constructor for TapeReadSingleThread
//------------------------------------------------------------------------------
castor::tape::tapeserver::daemon::TapeReadSingleThread::TapeReadSingleThread(
castor::tape::tapeserver::drives::DriveInterface& drive,
castor::tape::tapeserver::drive::DriveInterface& drive,
castor::legacymsg::RmcProxy& rmc,
TapeServerReporter& initialProcess,
const client::ClientInterface::VolumeInfo& volInfo,
......
......@@ -56,7 +56,7 @@ public:
/**
* Constructor:
*/
TapeReadSingleThread(castor::tape::tapeserver::drives::DriveInterface & drive,
TapeReadSingleThread(castor::tape::tapeserver::drive::DriveInterface & drive,
castor::legacymsg::RmcProxy & rmc,
TapeServerReporter & initialProcess,
const client::ClientInterface::VolumeInfo& volInfo,
......
......@@ -67,7 +67,7 @@ protected:
* An interface to manipulate the drive to manipulate the tape
* with the requested vid
*/
castor::tape::tapeserver::drives::DriveInterface & m_drive;
castor::tape::tapeserver::drive::DriveInterface & m_drive;
/** Reference to the mount interface */
castor::legacymsg::RmcProxy & m_rmc;
......@@ -198,7 +198,7 @@ public:
* @param capUtils
* @param lc lc The log context, later on copied
*/
TapeSingleThreadInterface(castor::tape::tapeserver::drives::DriveInterface & drive,
TapeSingleThreadInterface(castor::tape::tapeserver::drive::DriveInterface & drive,
castor::legacymsg::RmcProxy & rmc,
TapeServerReporter & tsr,
const client::ClientInterface::VolumeInfo& volInfo,
......
......@@ -26,7 +26,7 @@
//constructor
//------------------------------------------------------------------------------
castor::tape::tapeserver::daemon::TapeWriteSingleThread::TapeWriteSingleThread(
castor::tape::tapeserver::drives::DriveInterface & drive,
castor::tape::tapeserver::drive::DriveInterface & drive,
castor::legacymsg::RmcProxy & rmc,
TapeServerReporter & tsr,
const client::ClientInterface::VolumeInfo& volInfo,
......
......@@ -60,7 +60,7 @@ public:
* @param lastFseq the last fSeq
*/
TapeWriteSingleThread(
castor::tape::tapeserver::drives::DriveInterface & drive,
castor::tape::tapeserver::drive::DriveInterface & drive,
castor::legacymsg::RmcProxy & rmc,
TapeServerReporter & tsr,
const client::ClientInterface::VolumeInfo& volInfo,
......@@ -162,7 +162,7 @@ private:
const uint64_t m_bytesBeforeFlush;
///an interface for manipulating all type of drives
castor::tape::tapeserver::drives::DriveInterface& m_drive;
castor::tape::tapeserver::drive::DriveInterface& m_drive;
///the object that will send reports to the client
MigrationReportPacker & m_reportPacker;
......
......@@ -29,7 +29,7 @@ namespace castor {
namespace tape {
namespace tapeserver {
drives::DriveInterface * drives::DriveFactory(SCSI::DeviceInfo di,
drive::DriveInterface * drive::DriveFactory(SCSI::DeviceInfo di,
System::virtualWrapper& sw) {
if (std::string::npos != di.product.find("T10000")) {
return new DriveT10000(di, sw);
......@@ -40,7 +40,7 @@ drives::DriveInterface * drives::DriveFactory(SCSI::DeviceInfo di,
} else if (std::string::npos != di.product.find("VIRTUAL")) {
/* In case of a VIRTUAL drive, it could have been pre-allocated
* for testing purposes (with "pre-cooked" contents). */
drives::DriveInterface * ret = sw.getDriveByPath(di.nst_dev);
drive::DriveInterface * ret = sw.getDriveByPath(di.nst_dev);
if (ret) {
return ret;
} else {
......@@ -51,7 +51,7 @@ drives::DriveInterface * drives::DriveFactory(SCSI::DeviceInfo di,
}
}
drives::DriveGeneric::DriveGeneric(SCSI::DeviceInfo di, System::virtualWrapper& sw) : m_SCSIInfo(di),
drive::DriveGeneric::DriveGeneric(SCSI::DeviceInfo di, System::virtualWrapper& sw) : m_SCSIInfo(di),
m_tapeFD(-1), m_sysWrapper(sw) {
/* Open the device files */
/* We open the tape device file non-blocking as blocking open on rewind tapes (at least)
......@@ -63,7 +63,7 @@ m_tapeFD(-1), m_sysWrapper(sw) {
UpdateDriveStatus();
}
void drives::DriveGeneric::UpdateDriveStatus() {
void drive::DriveGeneric::UpdateDriveStatus() {
/* Read drive status */
castor::exception::Errnum::throwOnMinusOne(
m_sysWrapper.ioctl(m_tapeFD, MTIOCGET, &m_mtInfo),
......@@ -81,7 +81,7 @@ void drives::DriveGeneric::UpdateDriveStatus() {
* All comulative and threshold log counter values will be reset to their
* default values as specified in that pages reset behavior section.
*/
void drives::DriveGeneric::clearCompressionStats() {
void drive::DriveGeneric::clearCompressionStats() {
SCSI::Structures::logSelectCDB_t cdb;
cdb.PCR = 1; /* PCR set */
cdb.PC = 0x3; /* PC = 11b for T10000 only*/
......@@ -104,7 +104,7 @@ void drives::DriveGeneric::clearCompressionStats() {
* Information about the drive. The vendor id is used in the user labels of the files.
* @return The deviceInfo structure with the information about the drive.
*/
drives::deviceInfo drives::DriveGeneric::getDeviceInfo() {
drive::deviceInfo drive::DriveGeneric::getDeviceInfo() {
SCSI::Structures::inquiryCDB_t cdb;
SCSI::Structures::inquiryData_t inquiryData;
SCSI::Structures::senseData_t<255> senseBuff;
......@@ -136,7 +136,7 @@ drives::deviceInfo drives::DriveGeneric::getDeviceInfo() {
* Information about the serial number of the drive.
* @return Right-aligned ASCII data for the vendor-assigned serial number.
*/
std::string drives::DriveGeneric::getSerialNumber() {
std::string drive::DriveGeneric::getSerialNumber() {
SCSI::Structures::inquiryCDB_t cdb;
SCSI::Structures::inquiryUnitSerialNumberData_t inquirySerialData;
SCSI::Structures::senseData_t<255> senseBuff;
......@@ -169,7 +169,7 @@ std::string drives::DriveGeneric::getSerialNumber() {
* has completed.
* @param blockId The blockId, represented in local endianness.
*/
void drives::DriveGeneric::positionToLogicalObject(uint32_t blockId)
void drive::DriveGeneric::positionToLogicalObject(uint32_t blockId)
{
SCSI::Structures::locate10CDB_t cdb;
SCSI::Structures::senseData_t<255> senseBuff;
......@@ -195,7 +195,7 @@ void drives::DriveGeneric::positionToLogicalObject(uint32_t blockId)
* @return positionInfo class. This contains the logical position, plus information
* on the dirty data still in the write buffer.
*/
drives::positionInfo drives::DriveGeneric::getPositionInfo()
drive::positionInfo drive::DriveGeneric::getPositionInfo()
{
SCSI::Structures::readPositionCDB_t cdb;
SCSI::Structures::readPositionDataShortForm_t positionData;
......@@ -242,7 +242,7 @@ drives::positionInfo drives::DriveGeneric::getPositionInfo()
* Section is 4.2.17 in SSC-3.
* @return list of tape alerts descriptions. They are simply used for logging.
*/
std::vector<std::string> drives::DriveGeneric::getTapeAlerts() {
std::vector<std::string> drive::DriveGeneric::getTapeAlerts() {
/* return vector */
std::vector<std::string> ret;
/* We don't know how many elements we'll get. Prepare a 100 parameters array */
......@@ -290,7 +290,7 @@ std::vector<std::string> drives::DriveGeneric::getTapeAlerts() {
* @param compression The boolean variable to enable or disable compression
* on the drive for the tape. By default it is enabled.
*/
void drives::DriveGeneric::setDensityAndCompression(bool compression,
void drive::DriveGeneric::setDensityAndCompression(bool compression,
unsigned char densityCode) {
SCSI::Structures::modeSenseDeviceConfiguration_t devConfig;
{ // get info from the drive
......@@ -344,7 +344,7 @@ void drives::DriveGeneric::setDensityAndCompression(bool compression,
* Function that checks if a tape is blank (contains no records)
* @return true if tape is blank, false otherwise
*/
bool drives::DriveGeneric::isTapeBlank() {
bool drive::DriveGeneric::isTapeBlank() {
struct mtop mtCmd1;
mtCmd1.mt_op = MTREW;
mtCmd1.mt_count = 1;
......@@ -376,7 +376,7 @@ bool drives::DriveGeneric::isTapeBlank() {
* layer, unless the parameter turns out to be disused.
* @param bufWrite: value of the buffer write switch
*/
void drives::DriveGeneric::setSTBufferWrite(bool bufWrite) {
void drive::DriveGeneric::setSTBufferWrite(bool bufWrite) {
struct mtop m_mtCmd;
m_mtCmd.mt_op = MTSETDRVBUFFER;
m_mtCmd.mt_count = bufWrite ? (MT_ST_SETBOOLEANS | MT_ST_BUFFER_WRITES) : (MT_ST_CLEARBOOLEANS | MT_ST_BUFFER_WRITES);
......@@ -393,7 +393,7 @@ void drives::DriveGeneric::setSTBufferWrite(bool bufWrite) {
* all tape drives.
* TODO: synchronous? Timeout?
*/
void drives::DriveGeneric::spaceToEOM(void) {
void drive::DriveGeneric::spaceToEOM(void) {
setSTFastMTEOM(false);
struct mtop m_mtCmd;
m_mtCmd.mt_op = MTEOM;
......@@ -409,7 +409,7 @@ void drives::DriveGeneric::spaceToEOM(void) {
* the higher levels of the software (TODO: protected?).
* @param fastMTEOM the option switch.
*/
void drives::DriveGeneric::setSTFastMTEOM(bool fastMTEOM) {
void drive::DriveGeneric::setSTFastMTEOM(bool fastMTEOM) {
struct mtop m_mtCmd;
m_mtCmd.mt_op = MTSETDRVBUFFER;
m_mtCmd.mt_count = fastMTEOM ? (MT_ST_SETBOOLEANS | MT_ST_FAST_MTEOM) : (MT_ST_CLEARBOOLEANS | MT_ST_FAST_MTEOM);
......@@ -422,7 +422,7 @@ void drives::DriveGeneric::setSTFastMTEOM(bool fastMTEOM) {
* Jump to end of data. EOM in ST driver jargon, end of data (which is more accurate)
* in SCSI terminology). This uses the fast setting (not to be used for MIR rebuild)
*/
void drives::DriveGeneric::fastSpaceToEOM(void) {
void drive::DriveGeneric::fastSpaceToEOM(void) {
setSTFastMTEOM(true);
struct mtop m_mtCmd;
m_mtCmd.mt_op = MTEOM;
......@@ -435,7 +435,7 @@ void drives::DriveGeneric::fastSpaceToEOM(void) {
/**
* Rewind tape.
*/
void drives::DriveGeneric::rewind(void) {
void drive::DriveGeneric::rewind(void) {
struct mtop m_mtCmd;
m_mtCmd.mt_op = MTREW;
m_mtCmd.mt_count = 1;
......@@ -448,7 +448,7 @@ void drives::DriveGeneric::rewind(void) {
* Space count file marks backwards.
* @param count
*/
void drives::DriveGeneric::spaceFileMarksBackwards(size_t count) {
void drive::DriveGeneric::spaceFileMarksBackwards(size_t count) {
size_t tobeskipped = count;
struct mtop m_mtCmd;
m_mtCmd.mt_op = MTBSF;
......@@ -466,7 +466,7 @@ void drives::DriveGeneric::spaceFileMarksBackwards(size_t count) {
* Space count file marks forward.
* @param count
*/
void drives::DriveGeneric::spaceFileMarksForward(size_t count) {
void drive::DriveGeneric::spaceFileMarksForward(size_t count) {
size_t tobeskipped = count;
struct mtop m_mtCmd;
m_mtCmd.mt_op = MTFSF;
......@@ -483,7 +483,7 @@ void drives::DriveGeneric::spaceFileMarksForward(size_t count) {
/**
* Unload the tape.
*/
void drives::DriveGeneric::unloadTape(void) {
void drive::DriveGeneric::unloadTape(void) {
struct mtop m_mtCmd;
m_mtCmd.mt_op = MTUNLOAD;
m_mtCmd.mt_count = 1;
......@@ -496,7 +496,7 @@ void drives::DriveGeneric::unloadTape(void) {
* Synch call to the tape drive. This function will not return before the
* data in the drive's buffer is actually committed to the medium.
*/
void drives::DriveGeneric::flush(void) {
void drive::DriveGeneric::flush(void) {
struct mtop m_mtCmd;
m_mtCmd.mt_op = MTWEOF; //Not using MTNOP because it doesn't do what it claims (see st source code) so here we put "write sync file marks" with count set to 0.
// The following text is a quote from the SCSI Stream commands manual (SSC-3):
......@@ -512,7 +512,7 @@ void drives::DriveGeneric::flush(void) {
* are committed to medium.
* @param count
*/
void drives::DriveGeneric::writeSyncFileMarks(size_t count) {
void drive::DriveGeneric::writeSyncFileMarks(size_t count) {
struct mtop m_mtCmd;
m_mtCmd.mt_op = MTWEOF;
m_mtCmd.mt_count = (int)count;
......@@ -526,7 +526,7 @@ void drives::DriveGeneric::writeSyncFileMarks(size_t count) {
* buffer and the function return immediately.
* @param count
*/
void drives::DriveGeneric::writeImmediateFileMarks(size_t count) {
void drive::DriveGeneric::writeImmediateFileMarks(size_t count) {
struct mtop m_mtCmd;
m_mtCmd.mt_op = MTWEOFI; //Undocumented in "man st" needs the mtio_add.hh header file (see above)
m_mtCmd.mt_count = (int)count;
......@@ -540,7 +540,7 @@ void drives::DriveGeneric::writeImmediateFileMarks(size_t count) {
* @param data pointer the the data block
* @param count size of the data block
*/
void drives::DriveGeneric::writeBlock(const void * data, size_t count) {
void drive::DriveGeneric::writeBlock(const void * data, size_t count) {
castor::exception::Errnum::throwOnMinusOne(
m_sysWrapper.write(m_tapeFD, data, count),
"Failed ST write in DriveGeneric::writeBlock");
......@@ -552,7 +552,7 @@ void drives::DriveGeneric::writeBlock(const void * data, size_t count) {
* @param count size of the data block
* @return the actual size of read data
*/
ssize_t drives::DriveGeneric::readBlock(void * data, size_t count) {
ssize_t drive::DriveGeneric::readBlock(void * data, size_t count) {
ssize_t res = m_sysWrapper.read(m_tapeFD, data, count);
castor::exception::Errnum::throwOnMinusOne(res,
"Failed ST read in DriveGeneric::readBlock");
......@@ -566,7 +566,7 @@ ssize_t drives::DriveGeneric::readBlock(void * data, size_t count) {
* @param count size of the data block
* @return the actual size of read data
*/
void drives::DriveGeneric::readExactBlock(void * data, size_t count, std::string context) {
void drive::DriveGeneric::readExactBlock(void * data, size_t count, std::string context) {
ssize_t res = m_sysWrapper.read(m_tapeFD, data, count);
// First handle block too big
if (-1 == res && ENOSPC == errno)
......@@ -583,7 +583,7 @@ void drives::DriveGeneric::readExactBlock(void * data, size_t count, std::string
* Read over a file mark. Throw an exception we do not read one.
* @return the actual size of read data
*/
void drives::DriveGeneric::readFileMark(std::string context) {
void drive::DriveGeneric::readFileMark(std::string context) {
char buff[4]; // We need to try and read at least a small amount of data
// due to a bug in mhvtl
ssize_t res = m_sysWrapper.read(m_tapeFD, buff, 4);
......@@ -599,7 +599,7 @@ void drives::DriveGeneric::readFileMark(std::string context) {
}
void drives::DriveGeneric::SCSI_inquiry() {
void drive::DriveGeneric::SCSI_inquiry() {
SCSI::Structures::LinuxSGIO_t sgh;
SCSI::Structures::inquiryCDB_t cdb;
SCSI::Structures::senseData_t<255> senseBuff;
......@@ -630,7 +630,7 @@ void drives::DriveGeneric::SCSI_inquiry() {
}