Skip to contentSkip to conversation

device arguments from lookup, partion code in userspace

RFD w/info-PATCH [email protected] 11 participants 15 messages May 19, 2001 – May 21, 2001

lore
Share & tools
lore
#0 lore raw

From: Ben LaHaise <[email protected]>

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...

Hmm. You know that I wrote this long ago?
And that it has been part of the kernel for a long time? And that there are user space utilities that use it?

In util-linux, look at the partx subdirectory. In the kernel, read drivers/block/blkpg.c.

Andries

#1 lore raw
Quoted 2 lines · [email protected] wrote:

Hmm. You know that I wrote this long ago?

Well, let's not get too hung up on the disk thing (yeah, I started it...).

Ben's intent here is to *demonstrate* how argv-style info can be passed into device nodes. It seems neat, and nice.

We can also make use of a strong argument parsing library in the kernel - there are a great number of open-coded string bashing functions which could be rationalised and regularised.

So. When am I going to be able to:

	open("/bin/ls,-l,/etc/passwd", O_RDONLY);

?

#2 lore raw
Quoted 3 lines · Andrew Morton

So. When am I going to be able to:

	open("/bin/ls,-l,/etc/passwd", O_RDONLY);

You are not. Think for a minute and you'll see why.

Linus' idea of /dev/tty/<parameters> is marginally sane - it makes sense to consider that as configuring-upon-open. You _are_ going to do IO on that file.

Ben's /dev/md0/<living_horror> is ugly - it's open just for side effects, with no IO supposed to happen.

His idea of passing file descriptor instead of name makes these side effects even messier.

The stuff you've proposed is a perversion worth of Albert. You've introduced additional metacharacter into filenames, you will need some form of quoting to be able to pass literal commas and you will need to quote slashes. It's way past ugly.

#3 lore raw
Quoted 2 lines · Alexander Viro

Ben's /dev/md0/<living_horror> is ugly - it's open just for side effects, with no IO supposed to happen.

Now that I'm awake and refreshed, yeah, that's awful. But echo "hot-add,slot=5,device=/dev/sda" >/dev/md0/control *is* sane. Heck, the system can even send back result codes that way.

-ben

#4 lore raw

Re: [RFD w/info-PATCH] device arguments from lookup, partion code

Quoted 3 lines

Now that I'm awake and refreshed, yeah, that's awful. But echo "hot-add,slot=5,device=/dev/sda" >/dev/md0/control *is* sane. Heck, the system can even send back result codes that way.

Only to an English speaker. I suspect Quebec City canadians would prefer a different command set.

#5 lore raw

Re: [RFD w/info-PATCH] device arguments from lookup, partion code

Quoted 6 lines · Alan Cox
Quoted 3 lines

Now that I'm awake and refreshed, yeah, that's awful. But echo "hot-add,slot=5,device=/dev/sda" >/dev/md0/control *is* sane. Heck, the system can even send back result codes that way.

Only to an English speaker. I suspect Quebec City canadians would prefer a different command set.

Alan, I'm not a native speaker and I had worked with system that got names of utilities translated to Russian.

It's was hell. And I don't think that replacing compress (or пакуй) with 42A1769 would make it better.

#6 lore raw

Re: [RFD w/info-PATCH] device arguments from lookup, partion code

In reply to Alan Cox
Quoted 6 lines · Alan Cox
Quoted 3 lines

Now that I'm awake and refreshed, yeah, that's awful. But echo "hot-add,slot=5,device=/dev/sda" >/dev/md0/control *is* sane. Heck, the system can even send back result codes that way.

Only to an English speaker. I suspect Quebec City canadians would prefer a different command set.

Well... Around here we've been used to Microsoft translations like:

ETES-VOUS CERTAIN [O/N] ?

... and of course pressing 'o' doesn't work while 'y' does. :-)

Wanting to localize such low-level keywords is utopia. Otherwise you'll want to translate command names like free, rm, mv, etc. and yet programming languages as well like C keywords. And then you come to a point where nothing could be interoperable any more.

Nicolas

#7 lore raw

Re: [RFD w/info-PATCH] device arguments from lookup, partion code

In reply to Alan Cox
Quoted 7 lines · Alan Cox
Quoted 4 lines

Now that I'm awake and refreshed, yeah, that's awful. But echo "hot-add,slot=5,device=/dev/sda" >/dev/md0/control *is* sane. Heck, the system can even send back result codes that way.

Only to an English speaker. I suspect Quebec City canadians would prefer a different command set.

I was waiting for the "anglo-saxon" argument.

I don't think it's a valid argument. You already have "/dev". You already have english names for the numbers in ioctl's (and let's not be mentally dishonest and say "numbers are cross-cultural", because NOBODY MUST EVER USE THE RAW NUMBERS - you have to use the anglo-saxon #define'd names because the numbers aren't even cross-platform on Linux, much less portable to other systems).

So the "English is bad" argument is a complete non-argument.

Linus

#8 lore raw

Re: [RFD w/info-PATCH] device arguments from lookup, partion code

In reply to Alan Cox

On Sat, May 19, 2001 at 11:34:48AM -0700, Linus Torvalds wrote:
[Reasons]

Quoted 1 line

So the "English is bad" argument is a complete non-argument.

Jepp, I have to agree.

English is used more or less as an communication protocol in computer science and for operating computers.

Once you know how to operate an computer in English, you can operate nearly every computer in the world, because they have English as default locale.

Let's not repeat Babel please :-(

PS: English is neither mine, nor Linus native language. Why do
the English natives complain instead of us? ;-)

<off topic side note>
And be glad that's not German, that has this role. English sentences are WAY easier to parse by computers, because it doesn't use much suffixes and prefixes on words and has very few exceptions. Also these exceptions are eleminated from command languages WITHOUT influencing readability and comprehensability.
</off topic side note>

Regards

Ingo Oeser

Signature · 2 lines
To the systems programmer,
users and applications serve only to provide a test load.
#9 lore raw

Re: [RFD w/info-PATCH] device arguments from lookup, partion code

Quoted 2 lines · Ingo Oeser

PS: English is neither mine, nor Linus native language. Why do
the English natives complain instead of us? ;-)

Because we had some experience with, erm, localized systems and for Alan it's most likely pure theory? ;-)

Al, still shuddering at the memories

#10 lore raw

Re: [RFD w/info-PATCH] device arguments from lookup, partion code

Quoted 6 lines · Ingo Oeser
Quoted 2 lines

PS: English is neither mine, nor Linus native language. Why do
the English natives complain instead of us? ;-)

Because we had some experience with, erm, localized systems and for Alan it's most likely pure theory? ;-)

I think its important its considered. I do like the idea of a sensible ioctl encoding (including ascii potentially) and being able to ship ioctls over the network.

#11 lore raw

Re: [RFD w/info-PATCH] device arguments from lookup, partion code

In reply to Alan Cox

Obviously there has to be some standard base with which to work, especially for computer language keywords as these can't be converted due to name clashes. What would be cool is to pick a better base language than English that everyone would have to learn to "use computers". This is especially important for opensource as it would greatly ease the operation of the collective brain. Something easily parseable would be an obvious criterion and would allow us to interact with computers by voice(-recognition) with no ambiguity, etc. etc...
tada: http://www.lojban.org/

will everything be changed over in the 2.5 timeframe? :-)

Padraig.

Quoted 34 lines · Ingo Oeser

On Sat, May 19, 2001 at 11:34:48AM -0700, Linus Torvalds wrote:
[Reasons]

Quoted 2 lines

So the "English is bad" argument is a complete non-argument.

Jepp, I have to agree.

English is used more or less as an communication protocol in computer science and for operating computers.

Once you know how to operate an computer in English, you can operate nearly every computer in the world, because they have English as default locale.

Let's not repeat Babel please :-(

PS: English is neither mine, nor Linus native language. Why do
the English natives complain instead of us? ;-)

<off topic side note>
And be glad that's not German, that has this role. English sentences are WAY easier to parse by computers, because it doesn't use much suffixes and prefixes on words and has very few exceptions. Also these exceptions are eleminated from command languages WITHOUT influencing readability and comprehensability.
</off topic side note>

Regards

Ingo Oeser

#12 lore raw

Re: [RFD w/info-PATCH] device arguments from lookup, partion code

In reply to Ben LaHaise
Quoted 2 lines · Alan Cox

Only to an English speaker. I suspect Quebec City canadians would prefer a different command set.

Should we support pas387' as well as no387' as a kernel boot parameter then? Face it, a sysadmin has to know the limited subset of english which is used to configure a kernel.

Signature · 1 line
Revolutions do not require corporate support.
#13 lore raw

Re: [RFD w/info-PATCH] device arguments from lookup, partion code

In reply to Ben LaHaise

Hi!

Quoted 6 lines
Quoted 3 lines

Now that I'm awake and refreshed, yeah, that's awful. But echo "hot-add,slot=5,device=/dev/sda" >/dev/md0/control *is* sane. Heck, the system can even send back result codes that way.

Only to an English speaker. I suspect Quebec City canadians would prefer a different command set.

Alan, bad idea.

This is less evil than magic numbers, and *users* should not be touching this anyway. They should have nice gui tools that do it for them.

English is *way* better than magic numbers. It makes sense at least for someone.
Pavel

Signature · 2 lines
I'm [email protected]. "In my country we have almost anarchy and I don't care."
Panos Katsaloulis describing me w.r.t. patents at [email protected]
#14 lore raw

Re: [RFD w/info-PATCH] device arguments from lookup, partion codein userspace

In reply to Andrew Morton
Quoted 2 lines · Alexander Viro

It's way past ugly.

I knew you'd like it.

It kind of makes sense, because it puts the two primary stream-of-bytes objects in Unix into the same namespace, with the same accessors. So if some random application is expecting a filename well heck, you just give it a path-to-executable with args. It won't care, although it may have trouble lseek()ing on it.

It wasn't very serious at all.

-