lkml.org 
[lkml]   [1997]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: dynamic partitions
Date
Hi!

> I have a crazy idea to implement a pair of ioctl()s to allow the
> setting of the start and size of a device partition.
>
> Looking through the block drivers, it seems easy enough to add code
> like (for ide.c):
>
> case BLKSETSIZE: /* Set device size */
> if (!suser()) return -EACCES;
> drive->part[MINOR(inode->i_rdev)&PARTN_MASK].nr_sects = arg;
> return 0 ;
> case BLKSETSTART: /* Set device start */
> if (!suser()) return -EACCES;
> drive->part[MINOR(inode->i_rdev)&PARTN_MASK].start_sect = arg;
> return 0 ;
>
> (and appropriate definitions in fs.h for BLKSETSIZE/START).
>
> It seems that such changes would need to be made to every block
> driver. Is there a better place to add partition changing code?

For now the `loop' device already supports "offset" option but "size"
is determined in drivers/block/loop.c/figure_loop_size() automagically.
When the size option will be added to `loop', you can losetup /dev/hda
to /dev/loop0 appropriately. The only problem remains the ugly
drivers/block/loop.c/transfer_none()/memcpy().


Jan Kratochvil



P.S.: When we're at another large memory copying, will someone the write page
flipping support so that during CD burn the data will no longer be copied
6 times? Count with me:

[disk DMA->kernel buffer]
1. buffer -> userland mkisofs
2. mkisofs -> kernel pipe buffer
3. kernel pipe buffer -> userland buffering tool
[>10MB buffer to deal with starvations during compiles]
4. userland buffering tool -> kernel pipe buffer
5. kernel pipe buffer -> userland cdrecord buffer
6. userland cdrecord buffer -> scsi layer buffer
[scsi layer->scsi controller DMA]

Maybe I've forgot about some additional kernel SCSI copying, though...

\
 
 \ /
  Last update: 2005-03-22 13:39    [W:0.129 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site