Re: [PATCH 1/4]Diskdump Update

From: Takao Indoh
Date: Tue Jun 22 2004 - 05:57:42 EST


On Mon, 21 Jun 2004 10:01:29 +0200, Arjan van de Ven wrote:

>> On Fri, 11 Jun 2004 13:50:45 +0200, Arjan van de Ven wrote:
>>
>> >> +#ifdef CONFIG_PROC_FS
>> >> +static int proc_ioctl(struct inode *inode, struct file *file, unsigned
>> >> int cmd, unsigned long param)
>> >
>> >
>> >ehhh this looks evil
>>
>> Do you mean I should use not ioctl but the following style?
>>
>> echo "add /dev/hda1" > /proc/diskdump
>> echo "delete /dev/hda1" > /proc/diskdump
>
>well no since /dev/hda is pointless; major/minor pairs maybe.
>But why in /proc???? it sounds like a sysfs job to me, where you probably
>want to represent a dump relationship with a symlink, and use "rm" to remove
>an entry..

Plural devices(partitions) can be registered to the diskdump as dump
device, so it seems difficult to represent a dump relationship with a
symlink.

Possible idea is adding new attribute to somewhere of sysfs entry,
for example /sys/block/sda/sda1/dumpdev.
When new device is added, echo 1 to this entry.
# echo 1 > /sys/block/sda/sda1/dumpdev

Its store function is as follows.

static ssize_t store(struct kobject * kobj, struct attribute * attr,
const char * buf, size_t count)
{
ssize_t ret;
struct gendisk *disk =
container_of(p->kobj.parent, struct gendisk, kobj);

return dump_register_device(disk);
}

The problem is how to get scsi_device from gendisk.

It seems that the method using sysfs is more complex than current method
using proc...
It may be better to use simply module parameter like netdump.

Best Regards,
Takao Indoh
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/