Re: [patch] pagecache-2.3.9-E8, fixes against pre3-2.3.9

Linus Torvalds (torvalds@transmeta.com)
Fri, 25 Jun 1999 09:41:49 -0700 (PDT)


On Fri, 25 Jun 1999, Ingo Molnar wrote:
> >
> > This will not be accepted. I told you why I refused to have the crap
> > "result passing through pointers" in the first place. If it gets cleaned
> > up, it gets cleaned up _properly_, not like this.
>
> how should i clean it up? When we allocate a new block we have three
> (conceptual) parameters 'got new block', 'block address' and 'error
> condition'. I couldnt reduce it further. I did not want to duplicate code
> and put a whole block_write_partial|full_page implementation just to be
> able to pass bhs to the lowlevel fs. This just hides the parameter passing
> problem, N times, into every block-based filesystem. It also eliminates
> clean ways to merge the 'clear new block' operation with 'overwrite block
> contents'.

I sent you an email already, but maybe you missed it. Here is the relevant
part again, just one function, and no crappy "three return values"
breakage. The function returns an error value, nothing more.

Linus

---

No, the way to fix fullpage is NOT to change bmap.

Please don't change bmap at all. I want to get the other stuff fixed - if we leave a !blocknr assumption for now that's fine: I just didn't want to =continue= the assumptions in new code.

If you do change bmap, then it should be changed to just be the same as fs_get_block() - ie it passes in the bh, so that the low-level filesystem can directly set the BH_Allocated flags etc. You then change the "update" flag to fs_get_block() to be a real bitmap of flags, something like

FS_GETBLK_UPDATE - clear the block if new FS_GETBLK_ALLOCATE - allocate a new block if needed FS_GETBLK_SINGANDDANCE - do a little song while we're waiting

see?

Then you can wrap the old bmap() calls (only used by the magic ioctl's after this) to do something like

struct buffer_head dummy_bh;

memset(&dummy_bh, 0, sizeof(dummy_bh); if (!fs_get_block(inode, block, &dummy_bh, 0)) return dummy_bh.b_blocknr; return 0;

Simple..

Linus

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/