* Re: [RFD w/info-PATCH] device arguments from lookup, partion code inuserspace
@ 2001-05-19 18:05 Andries.Brouwer
2001-05-19 18:07 ` Aaron Lehmann
0 siblings, 1 reply; 19+ messages in thread
From: Andries.Brouwer @ 2001-05-19 18:05 UTC (permalink / raw)
To: Andries.Brouwer, aaronl
Cc: andrewm, bcrl, clausen, linux-fsdevel, linux-kernel, torvalds,
viro
> initrd is an unnecessary pain in the ass for most people.
> It had better not become mandatory.
You would not notice the difference, only your kernel would be
a bit smaller and the RRPART ioctl disappears.
[Besides: we have lived with DOS-type partition tables for ten years,
but they will not last another ten years. Very soon disk partitions
will look very different. It will be good to move knowledge about
these things out of the kernel before this happens.]
Andries
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFD w/info-PATCH] device arguments from lookup, partion code inuserspace
2001-05-19 18:05 [RFD w/info-PATCH] device arguments from lookup, partion code inuserspace Andries.Brouwer
@ 2001-05-19 18:07 ` Aaron Lehmann
2001-05-19 19:50 ` Brad Boyer
0 siblings, 1 reply; 19+ messages in thread
From: Aaron Lehmann @ 2001-05-19 18:07 UTC (permalink / raw)
To: Andries.Brouwer
Cc: andrewm, bcrl, clausen, linux-fsdevel, linux-kernel, torvalds,
viro
On Sat, May 19, 2001 at 08:05:02PM +0200, Andries.Brouwer@cwi.nl wrote:
> > initrd is an unnecessary pain in the ass for most people.
> > It had better not become mandatory.
>
> You would not notice the difference, only your kernel would be
> a bit smaller and the RRPART ioctl disappears.
Would I not notice the difference as a user, as a sysadmin, as a
kernel builder, as a kernel hacker, or all of the above?
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFD w/info-PATCH] device arguments from lookup, partion code inuserspace
2001-05-19 18:07 ` Aaron Lehmann
@ 2001-05-19 19:50 ` Brad Boyer
2001-05-19 19:37 ` Linus Torvalds
0 siblings, 1 reply; 19+ messages in thread
From: Brad Boyer @ 2001-05-19 19:50 UTC (permalink / raw)
To: Aaron Lehmann
Cc: Andries.Brouwer, andrewm, bcrl, clausen, linux-fsdevel,
linux-kernel, torvalds, viro
Aaron Lehmann wrote:
> On Sat, May 19, 2001 at 08:05:02PM +0200, Andries.Brouwer@cwi.nl wrote:
> > > initrd is an unnecessary pain in the ass for most people.
> > > It had better not become mandatory.
> >
> > You would not notice the difference, only your kernel would be
> > a bit smaller and the RRPART ioctl disappears.
>
> Would I not notice the difference as a user, as a sysadmin, as a
> kernel builder, as a kernel hacker, or all of the above?
If I understand the status of stuff correctly, I think this would make it
a lot more painful to admin if it became a requirement to use initrd on
everything just to be able to boot. If you've ever seen the way some of
the bootloaders for alterate platforms (like ppc and 68k) handle booting,
you'd see what a pain it can be to have anything more than a simple string
of options getting passed to the kernel. It's particularly bad on some
of the embedded ppc platforms. I suspect that if this happened, it would
never be allowed into many people's trees, because it would be worth their
effort to maintain different code so they don't have to squeeze an initrd
on flash along with their kernel and root filesystem. If I'm missing the
boat here, please tell me, but it sure seems like a bad idea to me.
Brad Boyer
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFD w/info-PATCH] device arguments from lookup, partion code inuserspace
2001-05-19 19:50 ` Brad Boyer
@ 2001-05-19 19:37 ` Linus Torvalds
0 siblings, 0 replies; 19+ messages in thread
From: Linus Torvalds @ 2001-05-19 19:37 UTC (permalink / raw)
To: Brad Boyer
Cc: Aaron Lehmann, Andries.Brouwer, andrewm, bcrl, clausen,
linux-fsdevel, linux-kernel, viro
On Sat, 19 May 2001, Brad Boyer wrote:
>
> If I understand the status of stuff correctly, I think this would make it
> a lot more painful to admin if it became a requirement to use initrd on
> everything just to be able to boot.
Don't get too hung up on initrd. Symbolic links really _are_ workable ways
to basically cache the information across boots, and the real problems are
elsewhere.
Linus
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFD w/info-PATCH] device arguments from lookup, partion code inuserspace
@ 2001-05-19 19:17 Andries.Brouwer
0 siblings, 0 replies; 19+ messages in thread
From: Andries.Brouwer @ 2001-05-19 19:17 UTC (permalink / raw)
To: Andries.Brouwer, aaronl
Cc: andrewm, bcrl, clausen, linux-fsdevel, linux-kernel, torvalds,
viro
From aaronl@vitelus.com Sat May 19 20:07:23 2001
> > initrd is an unnecessary pain in the ass for most people.
> > It had better not become mandatory.
>
> You would not notice the difference, only your kernel would be
> a bit smaller and the RRPART ioctl disappears.
Would I not notice the difference as a user, as a sysadmin, as a
kernel builder, as a kernel hacker, or all of the above?
All of the above.
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [RFD w/info-PATCH] device arguments from lookup, partion code inuserspace
@ 2001-05-19 11:30 Andries.Brouwer
2001-05-19 17:50 ` Aaron Lehmann
2001-05-19 18:43 ` Richard Gooch
0 siblings, 2 replies; 19+ messages in thread
From: Andries.Brouwer @ 2001-05-19 11:30 UTC (permalink / raw)
To: andrewm, viro; +Cc: bcrl, clausen, linux-fsdevel, linux-kernel, torvalds
Andrew Morton writes:
> > (2) what about bootstrapping? how do you find the root device?
> > Do you do "root=/dev/hda/offset=63,limit=1235823"? Bit nasty.
>
> Ben's patch makes initrd mandatory.
Can this be fixed? I've *never* had to futz with initrd.
Probably most systems are the same. It seems a step
backward to make it necessary.
I don't think so. It is necessary, and it is good.
But it is easy to make the transition painless.
Instead of the current choice between INITRD (yes/no)
we have INITRD (default built-in / external).
The built-in version can then slowly become smaller and die.
Andries
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [RFD w/info-PATCH] device arguments from lookup, partion code inuserspace
2001-05-19 11:30 Andries.Brouwer
@ 2001-05-19 17:50 ` Aaron Lehmann
2001-05-19 18:43 ` Richard Gooch
1 sibling, 0 replies; 19+ messages in thread
From: Aaron Lehmann @ 2001-05-19 17:50 UTC (permalink / raw)
To: Andries.Brouwer
Cc: andrewm, viro, bcrl, clausen, linux-fsdevel, linux-kernel,
torvalds
On Sat, May 19, 2001 at 01:30:14PM +0200, Andries.Brouwer@cwi.nl wrote:
> I don't think so. It is necessary, and it is good.
>
> But it is easy to make the transition painless.
> Instead of the current choice between INITRD (yes/no)
> we have INITRD (default built-in / external).
> The built-in version can then slowly become smaller and die.
initrd is an unnecessary pain in the ass for most people. It had
better not become mandatory.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFD w/info-PATCH] device arguments from lookup, partion code inuserspace
2001-05-19 11:30 Andries.Brouwer
2001-05-19 17:50 ` Aaron Lehmann
@ 2001-05-19 18:43 ` Richard Gooch
1 sibling, 0 replies; 19+ messages in thread
From: Richard Gooch @ 2001-05-19 18:43 UTC (permalink / raw)
To: Andries.Brouwer
Cc: andrewm, viro, bcrl, clausen, linux-fsdevel, linux-kernel,
torvalds
Andries Brouwer writes:
> Andrew Morton writes:
>
> > > (2) what about bootstrapping? how do you find the root device?
> > > Do you do "root=/dev/hda/offset=63,limit=1235823"? Bit nasty.
> >
> > Ben's patch makes initrd mandatory.
>
> Can this be fixed? I've *never* had to futz with initrd.
> Probably most systems are the same. It seems a step
> backward to make it necessary.
>
> I don't think so. It is necessary, and it is good.
It most certainly is not. This attitude of pushing more and more stuff
out of the kernel and into initrd is really annoying. Initrd is messy,
nasty and opaque. It makes the boot process more complex. There is no
way in hell I want to be forced to use it.
Removing N lines from the kernel at the cost of adding N+k lines to
user-space is a *loss*, not a gain. I want my *system* to be simple
and transparent.
> But it is easy to make the transition painless.
No, initrd is fundamentally painful. Let go of this ideology of
removing code from the kernel at all costs. A super-slim kernel which
requires a more complex to administer user-space is too high a cost.
The benefits of removing partition support from the kernel are
basically zero.
Regards,
Richard....
Permanent: rgooch@atnf.csiro.au
Current: rgooch@ras.ucalgary.ca
^ permalink raw reply [flat|nested] 19+ messages in thread
* [RFD w/info-PATCH] device arguments from lookup, partion code in userspace
@ 2001-05-19 6:23 Ben LaHaise
2001-05-19 6:57 ` [RFD w/info-PATCH] device arguments from lookup, partion code inuserspace Andrew Clausen
0 siblings, 1 reply; 19+ messages in thread
From: Ben LaHaise @ 2001-05-19 6:23 UTC (permalink / raw)
To: torvalds; +Cc: viro, linux-kernel, linux-fsdevel
Hey folks,
The work-in-progress patch for-demonstration-purposes-only below consists
of 3 major components, and is meant to start discussion about the future
direction of device naming and its interaction block layer. The main
motivations here are the wasting of minor numbers for partitions, and the
duplication of code between user and kernel space in areas such as
partition detection, uuid location, lvm setup, mount by label, journal
replay, and so on...
1. Generic lookup method and argument parsiing (fs/lookupargs.c)
This code implements a lookup function which is for demonstration
purposes used in fs/block_dev.c. The general idea is to pass
additional parameters to device drivers on open via a comma
seperated list of options following the device's name. Sample
uses:
/dev/sda/raw -> open sda in raw mode.
/dev/sda/limit=102400 -> open sda with a limit of 100K
/dev/sda/offset=1024,limit=2048
-> open a device that gives a view of sda at an
offset of 1KB to 2KB
The arguments are defined in a table (fs/block_dev.c:660), which
defines the name and type of argument to parse. This table is
used at lookup time to determine if an option name is valid
(resulting in a postive dentry) or invalid. Potential uses for
this are numerous: opening a control channel to a device,
specifying a graphics mode for a framebuffer on open, replacing
ioctls, .... lots of options. Please seperate comments on this
portion from the other parts of the patch.
2. Restricted block device (drivers/block/blkrestrict.c)
This is a quick-n-dirty implementation of a simple md-like block
device that adds an offset to sector requests and limits the
maximum offset on the device. The idea here is to replace the
special case minor numbers used for the partitioning code with
a generic runtime allocated translation node. The idea will work
best once its data can be stored in a kdev_t structure. The API
for use is simple:
kdev_t restrict_create_dev(kdev_t dev,
unsigned long long offset,
unsigned long long limit)
The associated cleanup of the startup code is not addressed here.
Comments on this part (I know the implementation is ugly, talk
about the ideas please)?
3. Userspace partition code proposal
Given the above two bits, here's a brief explaination of a
proposal to move management of the partitioning scheme into
userspace, along with portions of raid startup, lvm, uuid and
mount by label code needed for mounting the root filesystem.
Consider that the device node currently known as /dev/hda5 can
also be viewed as /dev/hda at offset 512000 with a limit of 10GB.
With the extensions in fs/block_dev.c, you could replace /dev/hda5
with /dev/hda/offset=512000,limit=10240000000. Now, by putting
the partition parsing code into a libpart and binding mount to a
libpart, the root filesystem mounting code can be run out of an
initrd image. The use of mount gives us the ability to mount
filesystems by UUID, by label or other exotic schemes without
having to add any additional code to the kernel.
I'm going to stop writing this now. I need sleep...
Folks, please let me know your opinions on the ideas presented herein, and
do attempt to keep the bits of code that are useful. Cheers,
-ben
[23:34:07] <viro> bcrl: you are sick.
[23:41:13] <viro> bcrl: you _are_ sick.
[23:43:24] <viro> bcrl: you are _fscking_ sick.
here starts v2.4.5-pre3_bdev_naming-A0.diff
diff -urN kernels/2.4/v2.4.5-pre3/Makefile bdev_naming/Makefile
--- kernels/2.4/v2.4.5-pre3/Makefile Thu May 17 18:09:42 2001
+++ bdev_naming/Makefile Sat May 19 01:33:39 2001
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 4
SUBLEVEL = 5
-EXTRAVERSION =-pre3
+EXTRAVERSION =-pre3-sick-test
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
diff -urN kernels/2.4/v2.4.5-pre3/arch/i386/boot/install.sh bdev_naming/arch/i386/boot/install.sh
--- kernels/2.4/v2.4.5-pre3/arch/i386/boot/install.sh Tue Jan 3 06:57:26 1995
+++ bdev_naming/arch/i386/boot/install.sh Fri May 18 20:24:36 2001
@@ -21,6 +21,7 @@
# User may have a custom install script
+if [ -x ~/bin/installkernel ]; then exec ~/bin/installkernel "$@"; fi
if [ -x /sbin/installkernel ]; then exec /sbin/installkernel "$@"; fi
# Default install - same as make zlilo
diff -urN kernels/2.4/v2.4.5-pre3/drivers/block/Makefile bdev_naming/drivers/block/Makefile
--- kernels/2.4/v2.4.5-pre3/drivers/block/Makefile Fri Dec 29 17:07:21 2000
+++ bdev_naming/drivers/block/Makefile Sat May 19 00:29:08 2001
@@ -12,7 +12,7 @@
export-objs := ll_rw_blk.o blkpg.o loop.o DAC960.o
-obj-y := ll_rw_blk.o blkpg.o genhd.o elevator.o
+obj-y := ll_rw_blk.o blkpg.o genhd.o elevator.o blkrestrict.o
obj-$(CONFIG_MAC_FLOPPY) += swim3.o
obj-$(CONFIG_BLK_DEV_FD) += floppy.o
diff -urN kernels/2.4/v2.4.5-pre3/drivers/block/blkrestrict.c bdev_naming/drivers/block/blkrestrict.c
--- kernels/2.4/v2.4.5-pre3/drivers/block/blkrestrict.c Wed Dec 31 19:00:00 1969
+++ bdev_naming/drivers/block/blkrestrict.c Sat May 19 01:17:36 2001
@@ -0,0 +1,105 @@
+/* driver/block/blkrestrict.c - written by Benjamin LaHaise
+ * Block device limit enforcer. Designed to implement partition
+ * tables under control of other code.
+ *
+ * Copyright 2001 Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#include <linux/fs.h>
+#include <linux/blkdev.h>
+#include <linux/init.h>
+
+static char major_name[] = "restrict";
+static unsigned int major_nr;
+static unsigned int minor_nr; /* next free minor number */
+
+static struct restrict_info {
+ unsigned long offset;
+ unsigned long limit;
+ kdev_t dev;
+} restrict_info[256]; /* FIXME: stupid */
+
+static int restrict_blk_size[256]; /* grr */
+
+kdev_t restrict_create_dev(kdev_t dev, unsigned long long offset, unsigned long long limit)
+{
+ unsigned int minor = minor_nr++; /* FIXME: overflow/smp/fish */
+ struct restrict_info *info = &restrict_info[minor];
+
+ info->offset = offset / 512;
+ info->limit = limit / 512;
+ info->dev = dev;
+
+ restrict_blk_size[minor] = info->limit - info->offset;
+
+ printk("restrict_create_dev: (0x%02x, 0x%02x) offset=0x%lx limit=0x%lx on (0x%04x)\n", major_nr, minor, info->offset, info->limit, info->dev); /* FIXME: duh */
+
+ return MKDEV(major_nr, minor);
+}
+
+static int restrict_open(struct inode *inode, struct file *file)
+{
+ return 0;
+}
+
+static int restrict_release(struct inode *inode, struct file *file)
+{
+ return 0;
+}
+
+static int restrict_make_req(request_queue_t *q, int rw, struct buffer_head *bh)
+{
+ struct restrict_info *info = &restrict_info[MINOR(bh->b_rdev)];
+ unsigned long new_sector = bh->b_rsector + info->offset;
+
+ if (new_sector >= info->limit || new_sector < bh->b_rsector) {
+ printk("restrict_make_req: 0x%lx beyond limit on 0x%x (0x%lx,0x%lx)\n", bh->b_rsector, bh->b_rdev, info->offset, info->limit);
+ buffer_IO_error(bh);
+ return 0;
+ }
+
+ bh->b_rdev = info->dev;
+ bh->b_rsector += info->offset;
+
+ return 1;
+}
+
+static struct block_device_operations restrict_bdops = {
+ open: restrict_open,
+ release: restrict_release,
+};
+
+static int __init blkrestrict_init(void)
+{
+ major_nr = register_blkdev(0, major_name, &restrict_bdops);
+ if (major_nr < 0)
+ return major_nr;
+
+ printk("blkrestrict_init: got major %u\n", major_nr);
+
+ blk_queue_make_request(BLK_DEFAULT_QUEUE(major_nr), restrict_make_req);
+ blk_size[major_nr] = restrict_blk_size;
+
+ return 0;
+}
+
+static void __exit blkrestrict_exit(void)
+{
+ unregister_blkdev(major_nr, major_name);
+}
+
+module_init(blkrestrict_init);
+module_exit(blkrestrict_exit);
diff -urN kernels/2.4/v2.4.5-pre3/fs/Makefile bdev_naming/fs/Makefile
--- kernels/2.4/v2.4.5-pre3/fs/Makefile Thu Apr 5 11:53:44 2001
+++ bdev_naming/fs/Makefile Fri May 18 18:49:49 2001
@@ -12,7 +12,7 @@
obj-y := open.o read_write.o devices.o file_table.o buffer.o \
super.o block_dev.o stat.o exec.o pipe.o namei.o fcntl.o \
- ioctl.o readdir.o select.o fifo.o locks.o \
+ ioctl.o readdir.o select.o fifo.o locks.o lookupargs.o \
dcache.o inode.o attr.o bad_inode.o file.o iobuf.o dnotify.o \
filesystems.o
diff -urN kernels/2.4/v2.4.5-pre3/fs/block_dev.c bdev_naming/fs/block_dev.c
--- kernels/2.4/v2.4.5-pre3/fs/block_dev.c Thu May 17 18:09:42 2001
+++ bdev_naming/fs/block_dev.c Sat May 19 01:31:51 2001
@@ -14,9 +14,12 @@
#include <linux/major.h>
#include <linux/devfs_fs_kernel.h>
#include <linux/smp_lock.h>
+#include <linux/lookupargs.h>
#include <asm/uaccess.h>
+extern kdev_t restrict_create_dev(kdev_t dev, unsigned long long offset, unsigned long long limit);
+
extern int *blk_size[];
extern int *blksize_size[];
@@ -648,10 +651,52 @@
return ret;
}
+struct blkdev_param {
+ unsigned long long offset,
+ limit;
+ int raw;
+};
+
+arg_format_t blkdev_arg_fmt[] = {
+ { "offset", Arg_ull, offsetof(struct blkdev_param, offset) },
+ { "limit", Arg_ull, offsetof(struct blkdev_param, limit) },
+ { "raw", Arg_bool, offsetof(struct blkdev_param, raw) },
+ { NULL }
+};
+
+static struct dentry *blkdev_lookup(struct inode *inode, struct dentry *dentry)
+{
+ return generic_parse_lookup(inode, dentry, blkdev_arg_fmt);
+}
+
int blkdev_open(struct inode * inode, struct file * filp)
{
- int ret = -ENXIO;
+ int ret;
struct block_device *bdev = inode->i_bdev;
+ struct dentry *dentry = filp->f_dentry;
+ struct blkdev_param param = { 0ULL, ~0ULL, 0 };
+
+ if (dentry && dentry->d_parent &&
+ dentry->d_inode == dentry->d_parent->d_inode) {
+ printk("blkdev_open: args='%*s'\n", dentry->d_name.len, dentry->d_name.name);
+ ret = generic_parse_args(&dentry->d_name, blkdev_arg_fmt, ¶m);
+ if (ret)
+ return ret;
+ printk("blkdev_open: offset=0x%Lx limit=0x%Lx raw=%d",
+ param.offset, param.limit, param.raw);
+
+ if (param.offset || ~param.limit) {
+ struct inode *old_inode = inode;
+ inode = get_empty_inode();
+ inode->i_rdev = restrict_create_dev(old_inode->i_rdev, param.offset, param.limit);
+ bdev = inode->i_bdev = bdget(inode->i_rdev);
+ filp->f_dentry = d_alloc_root(inode);
+ /* FIXME: error handling, dangling dentry/inode */
+ }
+ }
+
+ ret = -ENXIO;
+
down(&bdev->bd_sem);
lock_kernel();
if (!bdev->bd_op)
@@ -721,6 +766,10 @@
write: block_write,
fsync: block_fsync,
ioctl: blkdev_ioctl,
+};
+
+struct inode_operations def_blk_iops = {
+ lookup: blkdev_lookup,
};
const char * bdevname(kdev_t dev)
diff -urN kernels/2.4/v2.4.5-pre3/fs/devices.c bdev_naming/fs/devices.c
--- kernels/2.4/v2.4.5-pre3/fs/devices.c Sun Oct 1 23:35:16 2000
+++ bdev_naming/fs/devices.c Fri May 18 18:41:00 2001
@@ -205,6 +205,7 @@
inode->i_rdev = to_kdev_t(rdev);
} else if (S_ISBLK(mode)) {
inode->i_fop = &def_blk_fops;
+ inode->i_op = &def_blk_iops;
inode->i_rdev = to_kdev_t(rdev);
inode->i_bdev = bdget(rdev);
} else if (S_ISFIFO(mode))
diff -urN kernels/2.4/v2.4.5-pre3/fs/lookupargs.c bdev_naming/fs/lookupargs.c
--- kernels/2.4/v2.4.5-pre3/fs/lookupargs.c Wed Dec 31 19:00:00 1969
+++ bdev_naming/fs/lookupargs.c Sat May 19 00:26:31 2001
@@ -0,0 +1,156 @@
+/* fs/lookupargs.c - written by Benjamin LaHaise
+ * Support for comma seperated argument lists via a lookup method.
+ * Useful for device drivers and other filesystem entities.
+ *
+ * Copyright 2001 Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#include <linux/fs.h>
+#include <linux/lookupargs.h>
+
+/* Returns the format if arg is in the list of options */
+static const struct parsed_arg_format *find_arg_fmt(
+ const struct parsed_arg *arg, arg_format_t *fmt)
+{
+ if (fmt)
+ for (; fmt->name; fmt++) {
+ const char *opt = fmt->name;
+
+ if (!memcmp(arg->arg_start, opt, arg->arg_len) &&
+ strlen(opt) == arg->arg_len) {
+ return fmt;
+ }
+ }
+
+ return NULL;
+}
+
+/* TODO: fix it to actually validate the argument */
+int generic_check_arg(const struct parsed_arg *arg, arg_format_t *fmt)
+{
+ return !find_arg_fmt(arg, fmt);
+}
+
+static int parse_arg(const struct qstr *qstr, int offset, struct parsed_arg *arg)
+{
+ const char *str = qstr->name + offset;
+ int left = qstr->len - offset;
+
+ arg->arg_start = NULL;
+ arg->arg_len = 0;
+ arg->option_start = NULL;
+ arg->option_len = 0;
+
+ if (offset < 0)
+ return -1;
+
+ if (left <= 0)
+ return -1;
+
+ /* First off, scan for the argument name -> ends at end of string,
+ * an equals sign or comma.
+ */
+ arg->arg_start = str;
+ for (; left > 0 && (*str != '=') && (*str != ',');
+ left--,str++)
+ ;
+
+ arg->arg_len = str - arg->arg_start;
+
+ /* This argument ends if therer's nothing left or we've hit a comma. */
+ if (left <= 0)
+ goto out;
+
+ left--;
+ if (*str++ == ',')
+ goto out;
+
+ /* Second part: scan the option looking for the end: ends at
+ * end of string or a comma.
+ */
+ arg->option_start = str;
+ for (; left > 0 && (*str != ',');
+ left--,str++) {
+ /* Eat the escaped character */
+ if (*str == '\\' && left > 1)
+ left--, str++;
+ }
+
+ arg->option_len = str - arg->arg_start;
+
+out:
+ return str - (const char *)qstr->name;
+}
+
+/* TODO: FIXME: proper range checking!!! */
+static int fill_arg_data(const struct parsed_arg *arg, arg_format_t *fmt, char *data)
+{
+ char *end;
+
+ data += fmt->offset;
+
+ switch (fmt->type) {
+ case Arg_bool:
+ *(int *)data = 1;
+ return 0;
+ case Arg_ull:
+ if (!arg->option_start || !arg->option_len)
+ break;
+ *(unsigned long long *)data = simple_strtoull(arg->option_start, &end, 10);
+ return 0;
+ }
+ return -EINVAL;
+}
+
+int generic_parse_args(const struct qstr *str, arg_format_t *fmt_list, void *data)
+{
+ int ret = 0;
+ for_each_parsed_arg(str) {
+ arg_format_t *fmt = find_arg_fmt(&arg, fmt_list);
+ ret = -EINVAL;
+ if (!fmt)
+ break;
+ ret = fill_arg_data(&arg, fmt, (char *)data);
+ if (ret)
+ break;
+ }
+ return ret;
+}
+
+struct dentry *generic_parse_lookup(
+ struct inode *inode,
+ struct dentry *dentry,
+ arg_format_t *fmt_list)
+{
+ /* Application compatibility: report -ENOTDIR on "." and ".." */
+ if (dentry->d_name.name[0] == '.' &&
+ ((dentry->d_name.len == 1) ||
+ (dentry->d_name.name[1] == '.' && dentry->d_name.len == 2)))
+ return ERR_PTR(-ENOTDIR);
+
+ /* Make sure all the arguments are okay */
+ { for_each_parsed_arg(&dentry->d_name) {
+ arg_format_t *fmt = find_arg_fmt(&arg, fmt_list);
+ if (!fmt || generic_check_arg(&arg, fmt)) {
+ inode = NULL;
+ break;
+ }
+ }}
+
+ d_add(dentry, inode);
+ return NULL;
+}
+
diff -urN kernels/2.4/v2.4.5-pre3/fs/namei.c bdev_naming/fs/namei.c
--- kernels/2.4/v2.4.5-pre3/fs/namei.c Thu May 3 11:22:16 2001
+++ bdev_naming/fs/namei.c Fri May 18 22:38:50 2001
@@ -470,7 +470,8 @@
* to be able to know about the current root directory and
* parent relationships.
*/
- if (this.name[0] == '.') switch (this.len) {
+ if (this.name[0] == '.' && S_ISDIR(nd->dentry->d_inode->i_mode))
+ switch (this.len) {
default:
break;
case 2:
@@ -538,7 +539,8 @@
last_component:
if (lookup_flags & LOOKUP_PARENT)
goto lookup_parent;
- if (this.name[0] == '.') switch (this.len) {
+ if (this.name[0] == '.' && S_ISDIR(nd->dentry->d_inode->i_mode))
+ switch (this.len) {
default:
break;
case 2:
@@ -593,7 +595,7 @@
lookup_parent:
nd->last = this;
nd->last_type = LAST_NORM;
- if (this.name[0] != '.')
+ if (this.name[0] != '.' || !S_ISDIR(nd->dentry->d_inode->i_mode))
goto return_base;
if (this.len == 1)
nd->last_type = LAST_DOT;
diff -urN kernels/2.4/v2.4.5-pre3/include/linux/fs.h bdev_naming/include/linux/fs.h
--- kernels/2.4/v2.4.5-pre3/include/linux/fs.h Thu May 17 18:09:42 2001
+++ bdev_naming/include/linux/fs.h Fri May 18 20:10:50 2001
@@ -984,6 +984,7 @@
extern void bdput(struct block_device *);
extern int blkdev_open(struct inode *, struct file *);
extern struct file_operations def_blk_fops;
+extern struct inode_operations def_blk_iops;
extern struct file_operations def_fifo_fops;
extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long);
extern int blkdev_get(struct block_device *, mode_t, unsigned, int);
diff -urN kernels/2.4/v2.4.5-pre3/include/linux/lookupargs.h bdev_naming/include/linux/lookupargs.h
--- kernels/2.4/v2.4.5-pre3/include/linux/lookupargs.h Wed Dec 31 19:00:00 1969
+++ bdev_naming/include/linux/lookupargs.h Fri May 18 23:06:56 2001
@@ -0,0 +1,48 @@
+/* include/linux/lookupargs.h
+ */
+struct parsed_arg {
+ const char *arg_start;
+ const char *option_start;
+ int arg_len;
+ int option_len;
+};
+
+enum parsed_arg_type {
+ Arg_bool, /* really an int */
+ Arg_ull,
+#if 0
+ //Arg_str, /* really a char */
+ Arg_c,
+ Arg_uc,
+ Arg_s,
+ Arg_us,
+ Arg_i,
+ Arg_ui,
+ Arg_l,
+ Arg_ul,
+ Arg_ll,
+ Arg_u32,
+ Arg_u64,
+#endif
+};
+
+typedef const struct parsed_arg_format {
+ const char *name;
+ enum parsed_arg_type type;
+ size_t offset;
+} arg_format_t;
+
+#define for_each_parsed_arg(str)\
+ struct parsed_arg arg; \
+ int __offset = 0; \
+ while ((__offset = parse_arg((str), __offset, &arg)) > 0)
+
+struct dentry;
+struct inode;
+struct qstr;
+
+extern int generic_parse_args(
+ const struct qstr *str, arg_format_t *fmt, void *data);
+extern struct dentry *generic_parse_lookup(
+ struct inode *inode, struct dentry *dentry, arg_format_t *fmt);
+
diff -urN kernels/2.4/v2.4.5-pre3/include/linux/raid/md_k.h bdev_naming/include/linux/raid/md_k.h
--- kernels/2.4/v2.4.5-pre3/include/linux/raid/md_k.h Thu May 17 18:09:42 2001
+++ bdev_naming/include/linux/raid/md_k.h Sat May 19 01:13:18 2001
@@ -36,6 +36,7 @@
case RAID5: return 5;
}
panic("pers_to_level()");
+ return 0;
}
extern inline int level_to_pers (int level)
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [RFD w/info-PATCH] device arguments from lookup, partion code inuserspace
2001-05-19 6:23 [RFD w/info-PATCH] device arguments from lookup, partion code in userspace Ben LaHaise
@ 2001-05-19 6:57 ` Andrew Clausen
2001-05-19 7:04 ` Alexander Viro
2001-05-19 7:58 ` Ben LaHaise
0 siblings, 2 replies; 19+ messages in thread
From: Andrew Clausen @ 2001-05-19 6:57 UTC (permalink / raw)
To: Ben LaHaise; +Cc: torvalds, viro, linux-kernel, linux-fsdevel
Ben LaHaise wrote:
> The work-in-progress patch for-demonstration-purposes-only below consists
> of 3 major components, and is meant to start discussion about the future
> direction of device naming and its interaction block layer. The main
> motivations here are the wasting of minor numbers for partitions, and the
> duplication of code between user and kernel space in areas such as
> partition detection, uuid location, lvm setup, mount by label, journal
> replay, and so on...
(1) these issues are independent. The partition parsing could
be done in user space, today, by blkpg, if I read the code correctly
;-) (there's an ioctl for [un]registering partitions) Never
tried it though ;-)
(2) what about bootstrapping? how do you find the root device?
Do you do "root=/dev/hda/offset=63,limit=1235823"? Bit nasty.
(3) how does this work for LVM and RAID?
(4) <propaganda>libparted already has a fair bit of partition
scanning code, etc. Should be trivial to hack it up... That said,
it should be split up into .so modules... 200k is a bit heavy just
for mounting partitions (most of the bulk is file system stuff).
</propaganda>
(5) what happens to /etc/fstab? User-space ([u]mount?) translates
/dev/hda1 into /dev/hda/offset=63,limit=1235823, and back?
Andrew Clausen
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFD w/info-PATCH] device arguments from lookup, partion code inuserspace
2001-05-19 6:57 ` [RFD w/info-PATCH] device arguments from lookup, partion code inuserspace Andrew Clausen
@ 2001-05-19 7:04 ` Alexander Viro
2001-05-19 7:23 ` Andrew Clausen
2001-05-19 9:11 ` Andrew Morton
2001-05-19 7:58 ` Ben LaHaise
1 sibling, 2 replies; 19+ messages in thread
From: Alexander Viro @ 2001-05-19 7:04 UTC (permalink / raw)
To: Andrew Clausen; +Cc: Ben LaHaise, torvalds, linux-kernel, linux-fsdevel
On Sat, 19 May 2001, Andrew Clausen wrote:
> (1) these issues are independent. The partition parsing could
> be done in user space, today, by blkpg, if I read the code correctly
> ;-) (there's an ioctl for [un]registering partitions) Never
> tried it though ;-)
ioctls are even more evil than encoding limits into the name. Cease
and desist, please.
> (2) what about bootstrapping? how do you find the root device?
> Do you do "root=/dev/hda/offset=63,limit=1235823"? Bit nasty.
Ben's patch makes initrd mandatory.
> (3) how does this work for LVM and RAID?
It doesn't
> (4) <propaganda>libparted already has a fair bit of partition
> scanning code, etc. Should be trivial to hack it up... That said,
> it should be split up into .so modules... 200k is a bit heavy just
> for mounting partitions (most of the bulk is file system stuff).
> </propaganda>
We will be much better off providing a sane API from the kernel. And
dropping the layout-aware code from fdisk, parted, yodda, yodda.
Libraries do not remove code duplication. You still need to relink the
stuff you keep statically linked, etc. Otherwise you get version skew.
Big way. Besides, you can't use library from a script, etc.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFD w/info-PATCH] device arguments from lookup, partion code inuserspace
2001-05-19 7:04 ` Alexander Viro
@ 2001-05-19 7:23 ` Andrew Clausen
2001-05-19 8:30 ` Alexander Viro
2001-05-19 9:11 ` Andrew Morton
1 sibling, 1 reply; 19+ messages in thread
From: Andrew Clausen @ 2001-05-19 7:23 UTC (permalink / raw)
To: Alexander Viro; +Cc: Ben LaHaise, torvalds, linux-kernel, linux-fsdevel
Alexander Viro wrote:
> On Sat, 19 May 2001, Andrew Clausen wrote:
>
> > (1) these issues are independent. The partition parsing could
> > be done in user space, today, by blkpg, if I read the code correctly
> > ;-) (there's an ioctl for [un]registering partitions) Never
> > tried it though ;-)
>
> ioctls are even more evil than encoding limits into the name.
Why? Encoding sounds funky... you don't get normal
ls behaviour, etc.
I think I'd prefer something like /dev/hda/table, where
table is something like /proc/partitions for /dev/hda, but
it's read/write ;-)
> Cease and desist, please.
Hehe
> > (4) <propaganda>libparted already has a fair bit of partition
> > scanning code, etc. Should be trivial to hack it up... That said,
> > it should be split up into .so modules... 200k is a bit heavy just
> > for mounting partitions (most of the bulk is file system stuff).
> > </propaganda>
>
> We will be much better off providing a sane API from the kernel. And
> dropping the layout-aware code from fdisk, parted, yodda, yodda.
What about partition editing on other OSs? There's no reason
why fdisk/parted/etc. should be Linux only. Why should the kernel
need to know how to write partition tables?
Also, different partition table formats have different alignment
constraints (which is relevant for creating partitions). These
mainly need to be respected for other braindead OS's and/or BIOSes.
Communicating those between user/kernel space doesn't excite me.
Any ideas?
> Libraries do not remove code duplication. You still need to relink the
> stuff you keep statically linked, etc. Otherwise you get version skew.
> Big way. Besides, you can't use library from a script, etc.
Libtool & friends deals with version skew (ugly, but it works...)
You can write wrappers for libraries.
That said, a kernel API would be nice, if it was doable...
Andrew Clausen
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFD w/info-PATCH] device arguments from lookup, partion code inuserspace
2001-05-19 7:23 ` Andrew Clausen
@ 2001-05-19 8:30 ` Alexander Viro
2001-05-19 10:13 ` Andrew Clausen
0 siblings, 1 reply; 19+ messages in thread
From: Alexander Viro @ 2001-05-19 8:30 UTC (permalink / raw)
To: Andrew Clausen; +Cc: Ben LaHaise, torvalds, linux-kernel, linux-fsdevel
On Sat, 19 May 2001, Andrew Clausen wrote:
> Alexander Viro wrote:
> > On Sat, 19 May 2001, Andrew Clausen wrote:
> >
> > > (1) these issues are independent. The partition parsing could
> > > be done in user space, today, by blkpg, if I read the code correctly
> > > ;-) (there's an ioctl for [un]registering partitions) Never
> > > tried it though ;-)
> >
> > ioctls are even more evil than encoding limits into the name.
>
> Why? Encoding sounds funky... you don't get normal
> ls behaviour, etc.
ioctls are evil, period. At least with these names you can use normal
scripting and don't need any special tools. Every ioctl means a binary
that has no business to exist.
> What about partition editing on other OSs? There's no reason
> why fdisk/parted/etc. should be Linux only. Why should the kernel
> need to know how to write partition tables?
It needs to read them. Writing doesn't add much. I'd rather see
trivial partitioning tools that consist only of UI code in case
of Linux.
> Also, different partition table formats have different alignment
> constraints (which is relevant for creating partitions). These
> mainly need to be respected for other braindead OS's and/or BIOSes.
>
> Communicating those between user/kernel space doesn't excite me.
So don't communicate them.
> Libtool & friends deals with version skew (ugly, but it works...)
With statically linked binaries? How?
> You can write wrappers for libraries.
Uh-huh. And you can write them for ioctls. We had been busily doing that
for years. Results are not pretty, to put it very mildly.
OK, let me put it that way: I know how to do it in the kernel with
no code duplication and less impact on userland. BTW, most of the
code can very well sit in the userland, but that's another story
(userland filesystems). Anyway, there's only one way to settle such
stuff - sit down and write the patch. Which is what I'm going to do.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFD w/info-PATCH] device arguments from lookup, partion code inuserspace
2001-05-19 8:30 ` Alexander Viro
@ 2001-05-19 10:13 ` Andrew Clausen
0 siblings, 0 replies; 19+ messages in thread
From: Andrew Clausen @ 2001-05-19 10:13 UTC (permalink / raw)
To: Alexander Viro; +Cc: Ben LaHaise, torvalds, linux-kernel, linux-fsdevel
Alexander Viro wrote:
> ioctls are evil, period. At least with these names you can use normal
> scripting and don't need any special tools. Every ioctl means a binary
> that has no business to exist.
Special names are butt-ugly.
ioctl's can be replaced with games on /proc or whatever, which are
better than special names.
> > What about partition editing on other OSs? There's no reason
> > why fdisk/parted/etc. should be Linux only. Why should the kernel
> > need to know how to write partition tables?
>
> It needs to read them. Writing doesn't add much.
Wrong. When you read, you throw out 90% of the useless crap.
When you write, you need to know about it, and provide
interfaces for it.
> I'd rather see
> trivial partitioning tools that consist only of UI code in case
> of Linux.
Some stuff friendly partition tools should have, IMHO:
(1) ability to predict what's going to happen. That way, you can
play around until it looks nice, and hit the friendly commit
button.
(2) ability to do data recovery (eg: probe for signatures where
it expects the start of partitions to occur. You can be
intelligent/quick about it, by knowing about alignment stuff,
for example)
(3) ability to convert between partition table types (and
even LVM ;-) This can be tricky because of alignment stuff.
So:
(1) could be done in-kernel by being able to discard changes,
and re-reading, I guess.
(2) and (3) really only need alignment stuff.
Also, you need to be able to deal with legacy stuff, like
setting magic flags for booting.
> > Also, different partition table formats have different alignment
> > constraints (which is relevant for creating partitions). These
> > mainly need to be respected for other braindead OS's and/or BIOSes.
> >
> > Communicating those between user/kernel space doesn't excite me.
>
> So don't communicate them.
So, what do you do?
Sometimes, you want to force alignment violations (eg: recovering
an accidently deleted partition)
The real problem happens when you want to resize file systems, and
you need to simultaneously satisfy resizer and partition table
constraints. (there are currently no resizers like this, but
an ext2-resize-the-start and NTFS-resize-the-start would definitely
be like this... when I get time to write them. It's pure luck
that you don't need this for FAT, but this causes all sorts of
headaches for Linux...)
Anyway, you have one constraint in user space, and one in the
kernel... how do you find the intersection?
> > Libtool & friends deals with version skew (ugly, but it works...)
>
> With statically linked binaries? How?
Why do we need them?
> > You can write wrappers for libraries.
>
> Uh-huh. And you can write them for ioctls. We had been busily doing that
> for years. Results are not pretty, to put it very mildly.
If you can get everything into a nice file system interface,
then you've convinced me.
> BTW, most of the
> code can very well sit in the userland, but that's another story
> (userland filesystems). Anyway, there's only one way to settle such
> stuff - sit down and write the patch. Which is what I'm going to do.
Have fun.
So, my patch will be about 50 lines in parted, to call blkpg,
and provide a "kernelread" command... But, philosophy essay to
write... :-( (you have to wait until Monday)
Then you can rm -r fs/partitions
But, I don't see how patches will settle anything, when we're
arguing over interfaces & stuff needed for partition tools. Or
are you writing patches for Parted as well?
Andrew Clausen
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFD w/info-PATCH] device arguments from lookup, partion code inuserspace
2001-05-19 7:04 ` Alexander Viro
2001-05-19 7:23 ` Andrew Clausen
@ 2001-05-19 9:11 ` Andrew Morton
2001-05-19 9:20 ` Alexander Viro
1 sibling, 1 reply; 19+ messages in thread
From: Andrew Morton @ 2001-05-19 9:11 UTC (permalink / raw)
To: Alexander Viro
Cc: Andrew Clausen, Ben LaHaise, torvalds, linux-kernel,
linux-fsdevel
Alexander Viro wrote:
>
> > (2) what about bootstrapping? how do you find the root device?
> > Do you do "root=/dev/hda/offset=63,limit=1235823"? Bit nasty.
>
> Ben's patch makes initrd mandatory.
>
Can this be fixed? I've *never* had to futz with initrd.
Probably most systems are the same. It seems a step
backward to make it necessary.
-
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFD w/info-PATCH] device arguments from lookup, partion code inuserspace
2001-05-19 9:11 ` Andrew Morton
@ 2001-05-19 9:20 ` Alexander Viro
0 siblings, 0 replies; 19+ messages in thread
From: Alexander Viro @ 2001-05-19 9:20 UTC (permalink / raw)
To: Andrew Morton
Cc: Andrew Clausen, Ben LaHaise, torvalds, linux-kernel,
linux-fsdevel
On Sat, 19 May 2001, Andrew Morton wrote:
> Alexander Viro wrote:
> >
> > > (2) what about bootstrapping? how do you find the root device?
> > > Do you do "root=/dev/hda/offset=63,limit=1235823"? Bit nasty.
> >
> > Ben's patch makes initrd mandatory.
> >
>
> Can this be fixed? I've *never* had to futz with initrd.
> Probably most systems are the same. It seems a step
> backward to make it necessary.
Well, if you remove partition table parsing from the kernel - you've
got to boot with root on unpartitioned device (e.g. /dev/ram0) and
either stay that way or bring the userland code that understands
partitioning on that device...
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFD w/info-PATCH] device arguments from lookup, partion code inuserspace
2001-05-19 6:57 ` [RFD w/info-PATCH] device arguments from lookup, partion code inuserspace Andrew Clausen
2001-05-19 7:04 ` Alexander Viro
@ 2001-05-19 7:58 ` Ben LaHaise
2001-05-19 8:10 ` Alexander Viro
1 sibling, 1 reply; 19+ messages in thread
From: Ben LaHaise @ 2001-05-19 7:58 UTC (permalink / raw)
To: Andrew Clausen; +Cc: torvalds, viro, linux-kernel, linux-fsdevel
On Sat, 19 May 2001, Andrew Clausen wrote:
> (1) these issues are independent. The partition parsing could
> be done in user space, today, by blkpg, if I read the code correctly
> ;-) (there's an ioctl for [un]registering partitions) Never
> tried it though ;-)
I tried to imply that through the use of the the word component. Yes,
they're independant, but the code is pretty meaningless without a
demonstration of how it's used. ;-)
> (2) what about bootstrapping? how do you find the root device?
> Do you do "root=/dev/hda/offset=63,limit=1235823"? Bit nasty.
root= becomes a parameter to mount, and initrd becomes mandatory. I'd be
all for including all of the bits needed to build the initrd boot code in
the tree, but it's completely in the air.
> (3) how does this work for LVM and RAID?
It's not done yet, but similar techniques would be applied. I envision
that a raid device would support operations such as
open("/dev/md0/slot=5,hot-add=/dev/sda")
> (4) <propaganda>libparted already has a fair bit of partition
> scanning code, etc. Should be trivial to hack it up... That said,
> it should be split up into .so modules... 200k is a bit heavy just
> for mounting partitions (most of the bulk is file system stuff).
> </propaganda>
Good. Less work to do.
> (5) what happens to /etc/fstab? User-space ([u]mount?) translates
> /dev/hda1 into /dev/hda/offset=63,limit=1235823, and back?
I'd just create a symlink to /dev/hda1 at mount time, although that really
isn't what the user wants to see: the label or uuid is more useful.
-ben
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [RFD w/info-PATCH] device arguments from lookup, partion code inuserspace
2001-05-19 7:58 ` Ben LaHaise
@ 2001-05-19 8:10 ` Alexander Viro
2001-05-19 8:16 ` Ben LaHaise
0 siblings, 1 reply; 19+ messages in thread
From: Alexander Viro @ 2001-05-19 8:10 UTC (permalink / raw)
To: Ben LaHaise; +Cc: Andrew Clausen, torvalds, linux-kernel, linux-fsdevel
On Sat, 19 May 2001, Ben LaHaise wrote:
> It's not done yet, but similar techniques would be applied. I envision
> that a raid device would support operations such as
> open("/dev/md0/slot=5,hot-add=/dev/sda")
Think for a moment and you'll see why it's not only ugly as hell, but simply
won't work.
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [RFD w/info-PATCH] device arguments from lookup, partion code inuserspace
2001-05-19 8:10 ` Alexander Viro
@ 2001-05-19 8:16 ` Ben LaHaise
2001-05-19 8:32 ` Alexander Viro
0 siblings, 1 reply; 19+ messages in thread
From: Ben LaHaise @ 2001-05-19 8:16 UTC (permalink / raw)
To: Alexander Viro; +Cc: Andrew Clausen, linux-kernel, linux-fsdevel
On Sat, 19 May 2001, Alexander Viro wrote:
> On Sat, 19 May 2001, Ben LaHaise wrote:
>
> > It's not done yet, but similar techniques would be applied. I envision
> > that a raid device would support operations such as
> > open("/dev/md0/slot=5,hot-add=/dev/sda")
>
> Think for a moment and you'll see why it's not only ugly as hell, but simply
> won't work.
Yeah, I shouldn't be replying to email anymore in my bleery-eyed state.
=) Of course slash seperated data doesn't work, so it would have to be
hot-add=<filedescriptor> or somesuch. Gah, that's why the options are all
parsed from a single lookup name anyways...
-ben (who's going to sleep)
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [RFD w/info-PATCH] device arguments from lookup, partion code inuserspace
2001-05-19 8:16 ` Ben LaHaise
@ 2001-05-19 8:32 ` Alexander Viro
0 siblings, 0 replies; 19+ messages in thread
From: Alexander Viro @ 2001-05-19 8:32 UTC (permalink / raw)
To: Ben LaHaise; +Cc: Andrew Clausen, linux-kernel, linux-fsdevel
On Sat, 19 May 2001, Ben LaHaise wrote:
> On Sat, 19 May 2001, Alexander Viro wrote:
>
> > On Sat, 19 May 2001, Ben LaHaise wrote:
> >
> > > It's not done yet, but similar techniques would be applied. I envision
> > > that a raid device would support operations such as
> > > open("/dev/md0/slot=5,hot-add=/dev/sda")
> >
> > Think for a moment and you'll see why it's not only ugly as hell, but simply
> > won't work.
>
> Yeah, I shouldn't be replying to email anymore in my bleery-eyed state.
> =) Of course slash seperated data doesn't work, so it would have to be
> hot-add=<filedescriptor> or somesuch. Gah, that's why the options are all
> parsed from a single lookup name anyways...
That's why you want to use write(2) to pass that information instead of
encoding it into open(2).
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2001-05-20 2:12 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-05-19 18:05 [RFD w/info-PATCH] device arguments from lookup, partion code inuserspace Andries.Brouwer
2001-05-19 18:07 ` Aaron Lehmann
2001-05-19 19:50 ` Brad Boyer
2001-05-19 19:37 ` Linus Torvalds
-- strict thread matches above, loose matches on Subject: below --
2001-05-19 19:17 Andries.Brouwer
2001-05-19 11:30 Andries.Brouwer
2001-05-19 17:50 ` Aaron Lehmann
2001-05-19 18:43 ` Richard Gooch
2001-05-19 6:23 [RFD w/info-PATCH] device arguments from lookup, partion code in userspace Ben LaHaise
2001-05-19 6:57 ` [RFD w/info-PATCH] device arguments from lookup, partion code inuserspace Andrew Clausen
2001-05-19 7:04 ` Alexander Viro
2001-05-19 7:23 ` Andrew Clausen
2001-05-19 8:30 ` Alexander Viro
2001-05-19 10:13 ` Andrew Clausen
2001-05-19 9:11 ` Andrew Morton
2001-05-19 9:20 ` Alexander Viro
2001-05-19 7:58 ` Ben LaHaise
2001-05-19 8:10 ` Alexander Viro
2001-05-19 8:16 ` Ben LaHaise
2001-05-19 8:32 ` Alexander Viro
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox