lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200808121105.49645.bzolnier@gmail.com>
Date:	Tue, 12 Aug 2008 11:05:49 +0200
From:	Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
To:	petkovbb@...il.com
Cc:	linux-ide@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 11/22] ide: add ide_set_media_lock() helper

On Monday 11 August 2008, Borislav Petkov wrote:
> Hi,
> 
> On Sun, Aug 10, 2008 at 05:36:45PM +0200, Bartlomiej Zolnierkiewicz wrote:
> > * Set IDE_AFLAG_NO_DOORLOCK in idetape_get_mode_sense_result(), check it
> >   in ide_tape_set_media_lock() and cleanup idetape_create_prevent_cmd().
> > 
> > * Set IDE_AFLAG_NO_DOORLOCK in ide_floppy_create_read_capacity_cmd() and
> >   check it instead of IDE_AFLAG_CLIK_DRIVE in ide_floppy_set_media_lock().
> > 
> > * Add ide_set_media_lock() helper and convert ide-{floppy,tape}.c to use it.
> > 
> > * Remove no longer used ide*_create_prevent_cmd()/ide*_set_media_lock().
> > 
> > * Update comment in <linux/ide.h> accordingly.
> > 
> > Cc: Borislav Petkov <petkovbb@...il.com>
> > Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
> > ---
> >  drivers/ide/ide-atapi.c  |   15 +++++++++++++++
> >  drivers/ide/ide-floppy.c |   32 +++++++-------------------------
> >  drivers/ide/ide-tape.c   |   41 ++++++++++-------------------------------
> >  include/linux/ide.h      |    6 ++++--
> >  4 files changed, 36 insertions(+), 58 deletions(-)
> > 
> > Index: b/drivers/ide/ide-atapi.c
> > ===================================================================
> > --- a/drivers/ide/ide-atapi.c
> > +++ b/drivers/ide/ide-atapi.c
> > @@ -162,6 +162,21 @@ int ide_queue_pc_tail(ide_drive_t *drive
> >  }
> >  EXPORT_SYMBOL_GPL(ide_queue_pc_tail);
> >  
> > +int ide_set_media_lock(ide_drive_t *drive, struct gendisk *disk, int on)
> > +{
> > +	struct ide_atapi_pc pc;
> > +
> > +	if (drive->atapi_flags & IDE_AFLAG_NO_DOORLOCK)
> > +		return 0;
> > +
> > +	ide_init_pc(&pc);
> > +	pc.c[0] = ALLOW_MEDIUM_REMOVAL;
> 
> Are we switching to SCSI opcodes? What about the generic packet commands in
> <include/linux/cdrom.h>?

I prefer to use them when possible but there is no strict policy.

[ SCSI defines are shorter, one of the drivers was using them already
  and it also makes easier for comparing code with SCSI. ]
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ