Skip to contentSkip to conversation

2.4.11 loses sda9

DISCUSSION [email protected] 2 participants 2 messages Oct 11, 2001

lore
Share & tools
lore
#0 lore raw

From [email protected] Thu Oct 11 21:19:27 2001

On Thu, 11 Oct 2001 [email protected] wrote:

> so as to make it easy to switch between compiles where > a kdev_t is a number and we use the infamous arrays, > and compiles where a kdev_t is a pointer to a device struct, > and no arrays exist, I now see that get_hardsect_size(dev) > is replaced by
> get_hardsect_size(to_kdev_t(bdev->bd_dev))
> . Yecch.
> Al, I never understood why you want to introduce a > struct block_device * to do precisely what kdev_t > was designed to do.]

We had been through that way too many times. You know what problems with unified device struct I've brought before. You know what problems I have with your 64bit dev_t. And you know _very_ well that any patches in that area should be done in small steps.

Hell, I'd prefer that one to be done _much_ slower - with decent debugging between the steps instead of "we've got to close the holes opened by bdev-in-pagecache _NOW_" kind of situation we'd got.

IMO eventually we should have per-disk structure and keep reference to it from struct block_device. Then get_hardsect_size() wiuld turn into access to field of that beast (and would take struct block_device * as an argument). But that's 2.5 stuff and I bloody refuse to participate in attempts to do everything in one huge leap. One we'd got is already bad enough.

You invent two strawmen to divert attention from the question:

Quoted 1 line

You know what problems I have with your 64bit dev_t.

Well, in fact I don't know, except that you announced to fork the source once it got one. But that is an entirely separate discussion and has nothing to do with kdev_t. A dev_t is what goes into the kernel at the mknod system call, and comes out of the kernel at the stat system call, and roughly speaking has no other significance. It plays a role in NFS, but NFS already uses a 64bit dev_t.

Kernel patches for a 64bit dev_t are entirely orthogonal to kdev_t work.

Quoted 1 line

I refuse to participate in attempts to do everything in one huge leap.

Well, it is not me who invents the idea of big changes at once. It was mostly Linus who did not like intermediate code.

I think I can go to my goal in many small steps avoiding intermediate code, although life is a bit easier with intermediate stuff like get_hardsect_size(dev).

But the size of the leaps towards the goal has very little to do with the design of the goal.

So those are your two strawmen. Yes, there is one more sentence:

Quoted 1 line

You know what problems with unified device struct I've brought before.

I don't mind splitting kdev_t into kbdev_t and kcdev_t. Keeping the former requires a cast or a union somewhere. Splitting requires some code duplication.
Altogether there is very little difference between the two setups.

Remains the question, let me repeat:
"Al, I never understood why you want to introduce a struct block_device *
to do precisely what kdev_t was designed to do."

I see that you are making small steps away from my goal, so I hope you know very precisely where you want to go and how to get there.

Quoted 1 line

But that's 2.5 stuff

Yes, precisely. But you do not wait for 2.5 but start walking already.

Andries

#1 lore raw
Quoted 6 lines · On Thu, 11 Oct 2001 [email protected] wrote:
Quoted 1 line

You know what problems with unified device struct I've brought before.

I don't mind splitting kdev_t into kbdev_t and kcdev_t. Keeping the former requires a cast or a union somewhere. Splitting requires some code duplication.
Altogether there is very little difference between the two setups.

typedef struct block_device *kbdev_t;

Aside of 1:5 vowels to consonants ratio I've no problems with that.

Quoted 6 lines

Remains the question, let me repeat:
"Al, I never understood why you want to introduce a struct block_device *
to do precisely what kdev_t was designed to do."

I see that you are making small steps away from my goal, so I hope you know very precisely where you want to go and how to get there.

Right now we have a big and fairly nasty mix of the stuff that can be turned in pointer to block device, pointer to character device _and_ stuff that is used as numbers. Moreover, allocation policy for these structures is a tricky beast - block ones are mostly sane now, but character are most definitely not. Right now we have places where we look up the blocksize, etc. with nothing more than a number. Actually, recent changes, as much as I'd prefer to see them done only in 2.5, help in that respect - they remove one of the major sources of that. Switching get_...size() to stuct block_device * (or kbdev_t is you like to spell it that way) is a good thing, but it deserves a separate patch. And no, changing definition of kdev_t is not a good idea right now - too large patch and too many places to audit.

Resulting setup is going to be pretty close, indeed, but getting there is going to take some work.

Quoted 3 lines
Quoted 1 line

But that's 2.5 stuff

Yes, precisely. But you do not wait for 2.5 but start walking already.

We needed to switch partition-related code to pagecache; _that_ was the result of changes that were, IMO, bad idea at that point. But these changes were done and we have to deal with the fallout. Getting to the address_space of device in question requires pointer to structure. So the choice is between merging your patch on top of Andrea's stuff + fixes to said stuff and praying and propagating pointer to existing object in places where we need it and trying to debug that. Somehow the latter variant seems less painful.