[stgt] [PATCH] 1/1 Honour media capacity

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Mon Oct 19 00:04:38 CEST 2009


On Sat, 17 Oct 2009 23:01:30 +0900
FUJITA Tomonori <fujita.tomonori at lab.ntt.co.jp> wrote:

> On Wed, 14 Oct 2009 06:44:02 +1100
> Mark Harvey <markh794 at gmail.com> wrote:
> 
> > >From 8838e603da133001d3284f0ee1f0a6c71f906d09 Mon Sep 17 00:00:00 2001
> > From: Mark Harvey <markh794 at gmail.com>
> > Date: Tue, 13 Oct 2009 18:36:15 +1100
> > Subject: Honour media capacity.
> > 
> > Return NO_SENSE with 'EOM' set once 'media capacity' number of bytes
> > written to backing store file.
> > 
> > Signed-off-by: Mark Harvey <markh794 at gmail.com>
> > ---
> >  usr/bs_ssc.c |   23 +++++++++++++++++++++--
> >  1 files changed, 21 insertions(+), 2 deletions(-)
> > 
> > diff --git a/usr/bs_ssc.c b/usr/bs_ssc.c
> > index ce5c3bf..b2ad7c7 100644
> > --- a/usr/bs_ssc.c
> > +++ b/usr/bs_ssc.c
> > @@ -40,6 +40,12 @@
> >  #include "ssc.h"
> >  #include "libssc.h"
> >  
> > +#define SENSE_FILEMARK	0x80
> > +#define SENSE_EOM	0x40
> > +#define SENSE_ILI	0X20
> > +
> > +static uint64_t media_capacity;
> 
> Hmm, the global media_capacity value doesn't look correct? If you have
> multiple virtual tape devices, what happens?
> 
> Why can't we do something like this?
> 
> 
> diff --git a/usr/bs_ssc.c b/usr/bs_ssc.c
> index c0d5b59..8e57c1c 100644
> --- a/usr/bs_ssc.c
> +++ b/usr/bs_ssc.c
> @@ -40,6 +40,10 @@
>  #include "ssc.h"
>  #include "libssc.h"

Mark confirmed that this patch is correct so I've applied this.
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list