Re: [PATCH 4/5] osduld: Use device->release instead of internal kref

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2009-10-29 at 19:58 +0200, Boaz Harrosh wrote:
> On 10/29/2009 07:41 PM, James Bottomley wrote:
> > 
> > Chaining methods like this because of inner knowledge of the
> > implementation isn't resilient, it's very fragile.
> > 
> 
> If I would just kfree, because I know the inner code, that would be
> fragile.
> 
> But overriding a destructor, do what you need, and call previous
> distroctor. Does not take any inner knowledge. Just the published fact
> that it is a distructor, which will destroy the object.

You can't even justify this on OO grounds: In OO code, you get this
override by extending the object not hijacking the method and
arbitrarily linking two separate objects.

Embedding the device is the C equivalent of the OO object extension.

Method hijacks are almost always wrong.

James


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux