[PATCH 1/32] ide-tape: move historical changelog to Documentation/ide/ChangeLog.ide-tape.1995-2002

2008-01-27 Thread Borislav Petkov
Also, cleanup whitespace and update comments.

Signed-off-by: Borislav Petkov [EMAIL PROTECTED]
---
 Documentation/ide/ChangeLog.ide-tape.1995-2002 |  405 +++
 drivers/ide/ide-tape.c |  414 +---
 2 files changed, 409 insertions(+), 410 deletions(-)

diff --git a/Documentation/ide/ChangeLog.ide-tape.1995-2002 
b/Documentation/ide/ChangeLog.ide-tape.1995-2002
new file mode 100644
index 000..e406762
--- /dev/null
+++ b/Documentation/ide/ChangeLog.ide-tape.1995-2002
@@ -0,0 +1,405 @@
+/*
+ * IDE ATAPI streaming tape driver.
+ *
+ * This driver is a part of the Linux ide driver and works in co-operation
+ * with drivers/block/ide.c.
+ *
+ * The driver, in co-operation with ide.c, basically traverses the
+ * request-list for the block device interface. The character device
+ * interface, on the other hand, creates new requests, adds them
+ * to the request-list of the block device, and waits for their completion.
+ *
+ * Pipelined operation mode is now supported on both reads and writes.
+ *
+ * The block device major and minor numbers are determined from the
+ * tape's relative position in the ide interfaces, as explained in ide.c.
+ *
+ * The character device interface consists of the following devices:
+ *
+ * ht0 major 37, minor 0   first  IDE tape, rewind on close.
+ * ht1 major 37, minor 1   second IDE tape, rewind on close.
+ * ...
+ * nht0major 37, minor 128 first  IDE tape, no rewind on 
close.
+ * nht1major 37, minor 129 second IDE tape, no rewind on 
close.
+ * ...
+ *
+ * The general magnetic tape commands compatible interface, as defined by
+ * include/linux/mtio.h, is accessible through the character device.
+ *
+ * General ide driver configuration options, such as the interrupt-unmask
+ * flag, can be configured by issuing an ioctl to the block device interface,
+ * as any other ide device.
+ *
+ * Our own ide-tape ioctl's can be issued to either the block device or
+ * the character device interface.
+ *
+ * Maximal throughput with minimal bus load will usually be achieved in the
+ * following scenario:
+ *
+ * 1.  ide-tape is operating in the pipelined operation mode.
+ * 2.  No buffering is performed by the user backup program.
+ *
+ * Testing was done with a 2 GB CONNER CTMA 4000 IDE ATAPI Streaming Tape 
Drive.
+ *
+ * Ver 0.1   Nov  1 95   Pre-working code :-)
+ * Ver 0.2   Nov 23 95   A short backup (few megabytes) and restore procedure
+ *was successful ! (Using tar cvf ... on the block
+ *device interface).
+ *   A longer backup resulted in major swapping, bad
+ *overall Linux performance and eventually failed as
+ *we received non serial read-ahead requests from the
+ *buffer cache.
+ * Ver 0.3   Nov 28 95   Long backups are now possible, thanks to the
+ *character device interface. Linux's responsiveness
+ *and performance doesn't seem to be much affected
+ *from the background backup procedure.
+ *   Some general mtio.h magnetic tape operations are
+ *now supported by our character device. As a result,
+ *popular tape utilities are starting to work with
+ *ide tapes :-)
+ *   The following configurations were tested:
+ *   1. An IDE ATAPI TAPE shares the same interface
+ *and irq with an IDE ATAPI CDROM.
+ *   2. An IDE ATAPI TAPE shares the same interface
+ *and irq with a normal IDE disk.
+ *Both configurations seemed to work just fine !
+ *However, to be on the safe side, it is meanwhile
+ *recommended to give the IDE TAPE its own interface
+ *and irq.
+ *   The one thing which needs to be done here is to
+ *add a request postpone feature to ide.c,
+ *so that we won't have to wait for the tape to finish
+ *performing a long media access (DSC) request (such
+ *as a rewind) before we can access the other device
+ *on the same interface. This effect doesn't disturb
+ *normal operation most of the time because read/write
+ *requests are relatively fast, and once we are
+ *performing one tape r/w request, a lot of requests
+ *from the other device can be queued and ide.c will
+ *   service all of them after this single tape request.
+ * Ver 1.0   Dec 11 95   Integrated into Linux 1.3.46 

Re: [PATCH 1/32] ide-tape: move historical changelog to Documentation/ide/ChangeLog.ide-tape.1995-2002

2008-01-27 Thread Bartlomiej Zolnierkiewicz
On Sunday 27 January 2008, Borislav Petkov wrote:
 Also, cleanup whitespace and update comments.
 
 Signed-off-by: Borislav Petkov [EMAIL PROTECTED]

applied with some changes

 ---
  Documentation/ide/ChangeLog.ide-tape.1995-2002 |  405 +++
  drivers/ide/ide-tape.c |  414 
 +---
  2 files changed, 409 insertions(+), 410 deletions(-)
 
 diff --git a/Documentation/ide/ChangeLog.ide-tape.1995-2002 
 b/Documentation/ide/ChangeLog.ide-tape.1995-2002
 new file mode 100644
 index 000..e406762
 --- /dev/null
 +++ b/Documentation/ide/ChangeLog.ide-tape.1995-2002
 @@ -0,0 +1,405 @@
 +/*
 + * IDE ATAPI streaming tape driver.
 + *
 + * This driver is a part of the Linux ide driver and works in co-operation
 + * with drivers/block/ide.c.

I removed incorrect reference to drivers/block/ide.c

 + * The driver, in co-operation with ide.c, basically traverses the
 + * request-list for the block device interface. The character device
 + * interface, on the other hand, creates new requests, adds them
 + * to the request-list of the block device, and waits for their completion.
 + *
 + * Pipelined operation mode is now supported on both reads and writes.
 + *
 + * The block device major and minor numbers are determined from the
 + * tape's relative position in the ide interfaces, as explained in ide.c.
 + *
 + * The character device interface consists of the following devices:
 + *
 + * ht0   major 37, minor 0   first  IDE tape, rewind on 
 close.
 + * ht1   major 37, minor 1   second IDE tape, rewind on 
 close.
 + * ...
 + * nht0  major 37, minor 128 first  IDE tape, no rewind on 
 close.
 + * nht1  major 37, minor 129 second IDE tape, no rewind on 
 close.
 + * ...
 + *
 + * The general magnetic tape commands compatible interface, as defined by
 + * include/linux/mtio.h, is accessible through the character device.
 + *
 + * General ide driver configuration options, such as the interrupt-unmask
 + * flag, can be configured by issuing an ioctl to the block device interface,
 + * as any other ide device.
 + *
 + * Our own ide-tape ioctl's can be issued to either the block device or
 + * the character device interface.
 + *
 + * Maximal throughput with minimal bus load will usually be achieved in the
 + * following scenario:
 + *
 + *   1.  ide-tape is operating in the pipelined operation mode.
 + *   2.  No buffering is performed by the user backup program.

the above is not the part of the changelog

[...]

 + * Here are some words from the first releases of hd.c, which are quoted
 + * in ide.c and apply here as well:
 + *
 + * | Special care is recommended.  Have Fun!

[...]

ditto

 + * An overview of the pipelined operation mode.
 + *
 + * In the pipelined write mode, we will usually just add requests to our
 + * pipeline and return immediately, before we even start to service them. The
 + * user program will then have enough time to prepare the next request while
 + * we are still busy servicing previous requests. In the pipelined read mode,
 + * the situation is similar - we add read-ahead requests into the pipeline,
 + * before the user even requested them.
 + *
 + * The pipeline can be viewed as a safety net which will be activated when
 + * the system load is high and prevents the user backup program from keeping 
 up
 + * with the current tape speed. At this point, the pipeline will get
 + * shorter and shorter but the tape will still be streaming at the same 
 speed.
 + * Assuming we have enough pipeline stages, the system load will hopefully
 + * decrease before the pipeline is completely empty, and the backup program
 + * will be able to catch up and refill the pipeline again.
 + *
 + * When using the pipelined mode, it would be best to disable any type of
 + * buffering done by the user program, as ide-tape already provides all the
 + * benefits in the kernel, where it can be done in a more efficient way.
 + * As we will usually not block the user program on a request, the most
 + * efficient user code will then be a simple read-write-read-... cycle.
 + * Any additional logic will usually just slow down the backup process.
 + *
 + * Using the pipelined mode, I get a constant over 400 KBps throughput,
 + * which seems to be the maximum throughput supported by my tape.
 + *
 + * However, there are some downfalls:
 + *
 + *   1.  We use memory (for data buffers) in proportional to the number
 + *   of pipeline stages (each stage is about 26 KB with my tape).
 + *   2.  In the pipelined write mode, we cheat and postpone error codes
 + *   to the user task. In read mode, the actual tape position
 + *   will be a bit further than the last requested block.
 + *
 + * Concerning (1):
 + *
 + *   1.  We allocate stages dynamically only when we need them. When
 + *   we don't need them, we don't consume additional memory. In
 + *