linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] remove generic symlink from sg
@ 2006-03-18 21:06 James Bottomley
  2006-03-22 15:25 ` Douglas Gilbert
  0 siblings, 1 reply; 3+ messages in thread
From: James Bottomley @ 2006-03-18 21:06 UTC (permalink / raw)
  To: Douglas Gilbert; +Cc: linux-scsi

This has been redundant ever since James Smart added the class back
links since every scsi_device now gets one of these of the form
scsi_generic:sg<n>.

I'm open to going through the deprecated features business for this,
since this would represent a user visible change of the scsi sysfs
interface if you wish.

James

diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -1471,11 +1471,6 @@ sg_add(struct class_device *cl_dev, stru
 			printk(KERN_WARNING "sg_add: "
 				"class_device_create failed\n");
 		class_set_devdata(sg_class_member, sdp);
-		error = sysfs_create_link(&scsidp->sdev_gendev.kobj, 
-					  &sg_class_member->kobj, "generic");
-		if (error)
-			printk(KERN_ERR "sg_add: unable to make symlink "
-					"'generic' back to sg%d\n", k);
 	} else
 		printk(KERN_WARNING "sg_add: sg_sys INvalid\n");
 
@@ -1544,7 +1539,6 @@ sg_remove(struct class_device *cl_dev, s
 	write_unlock_irqrestore(&sg_dev_arr_lock, iflags);
 
 	if (sdp) {
-		sysfs_remove_link(&scsidp->sdev_gendev.kobj, "generic");
 		class_device_destroy(sg_sysfs_class, MKDEV(SCSI_GENERIC_MAJOR, k));
 		cdev_del(sdp->cdev);
 		sdp->cdev = NULL;



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] remove generic symlink from sg
  2006-03-18 21:06 [PATCH] remove generic symlink from sg James Bottomley
@ 2006-03-22 15:25 ` Douglas Gilbert
  2006-03-22 15:58   ` James Bottomley
  0 siblings, 1 reply; 3+ messages in thread
From: Douglas Gilbert @ 2006-03-22 15:25 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-scsi

James Bottomley wrote:
> This has been redundant ever since James Smart added the class back
> links since every scsi_device now gets one of these of the form
> scsi_generic:sg<n>.

James,
Careful with the spin:-) It is arguable which one is
redundant. I am testing this patch and it breaks
lsscsi and sg_map26 (again). Could you tell me which
version of the lk 2.6 series the scsi_generic:sg<n>
link appeared in? Because if I switch my code to
search for a scsi_generic:sg<n> symlink rather than
following the generic symlink then I will break
backward compatibility prior to that version (unless
I cope with both). At least one major distro has an
"enterprise" edition based on lk 2.6.5

> I'm open to going through the deprecated features business for this,
> since this would represent a user visible change of the scsi sysfs
> interface if you wish.

I can see from my lsscsi code and the st driver that
tape devices still have a plain old "tape" symlink.
Should I be expecting that one to break in the near
future?

Doug Gilbert

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] remove generic symlink from sg
  2006-03-22 15:25 ` Douglas Gilbert
@ 2006-03-22 15:58   ` James Bottomley
  0 siblings, 0 replies; 3+ messages in thread
From: James Bottomley @ 2006-03-22 15:58 UTC (permalink / raw)
  To: dougg; +Cc: linux-scsi

On Wed, 2006-03-22 at 10:25 -0500, Douglas Gilbert wrote:
> Careful with the spin:-) It is arguable which one is
> redundant. I am testing this patch and it breaks
> lsscsi and sg_map26 (again). Could you tell me which
> version of the lk 2.6 series the scsi_generic:sg<n>
> link appeared in? Because if I switch my code to
> search for a scsi_generic:sg<n> symlink rather than
> following the generic symlink then I will break
> backward compatibility prior to that version (unless
> I cope with both). At least one major distro has an
> "enterprise" edition based on lk 2.6.5

It was this patch

76d1ce00bdd76c2987fbfb763cd40447413a55b3
[PATCH] Driver core: link device and all class devices derived from it.

which added it on 10 July 05 according to the log.

I'd suggest not checking for version, but instead check for
scsi_generic: as the beginning of the link and then fallback if it's not
found.

> > I'm open to going through the deprecated features business for this,
> > since this would represent a user visible change of the scsi sysfs
> > interface if you wish.
> 
> I can see from my lsscsi code and the st driver that
> tape devices still have a plain old "tape" symlink.
> Should I be expecting that one to break in the near
> future?

Presumably if that link is likewise redundant.

James



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-03-22 15:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-18 21:06 [PATCH] remove generic symlink from sg James Bottomley
2006-03-22 15:25 ` Douglas Gilbert
2006-03-22 15:58   ` James Bottomley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).