iustin / mt-st

Magnetic tape control tools for Linux SCSI tapes
Other
41 stars 12 forks source link

mtio.h is missing ioctls to Immediate EOF Writes #29

Closed dabiged closed 1 year ago

dabiged commented 1 year ago

In 2012 a new EOF write method was added to the linux kernel. This allows you to queue an End of File write to a tape, without flushing all buffers.

Kernel Commit here: https://yhbt.net/lore/all/4F4FA760.6090900@suse.com/T/

Explanation from the kernel documentation:

Writing filemarks without the immediate bit set in the SCSI command block acts as a synchronization point, i.e., all remaining data form the drive buffers is written to tape before the command returns. This makes sure that write errors are caught at that point, but this takes time. In some applications, several consecutive files must be written fast. The MTWEOFI operation can be used to write the filemarks without flushing the drive buffer. Writing filemark at close() is always flushing the drive buffers. However, if the previous operation is MTWEOFI, close() does not write a filemark. This can be used if the program wants to close/open the tape device between files and wants to skip waiting. From here

The present mtio.h file in this repo is lacking this.