mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* VFS && UFS write support: possible on *BSD/Solaris, impossible on Linux?
@ 2006-04-19  9:22 Belan Kumar
  2006-04-21 12:30 ` Jan Kara
  0 siblings, 1 reply; 2+ messages in thread
From: Belan Kumar @ 2006-04-19  9:22 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, linux-fsdevel

Hello.

May be better call subject something like: "Shortest way to ufs write support",
but current subject give more chances to recieve answer.

First of all I try explain the current problem:
UFS as other block file systems has notition of "block",
but further to "block" notion it has "fragment" concept.
"fragment" used for preventing waste of space.
Usually fragment==block/8, and if "the rest of file" doesn't occupy
the whole block, it occupy several fragments. If file grows, at some point
"the rest of file"  will be occupy 8 fragments. And HERE IS PROBLEM,
we should allocate block and move 8 fragments to it.

On *BSD/Solaris it is simple: they read analog of buffer_head and
change analog of b_blocknr and that's all.

The current code of fs/ufs/balloc.c does the same:
----------------------
sb_bread
bh->b_blocknr =
mark_buffer_dirty (bh)
brelse (bh)
--------------------------
I suppose you guess: it doesn't work,
latter when you do sb_getblk(old_blocknr) it give to us the same block
and after that kernel hang up.


Hence question: what would be the proper solution in this situation?
Is it possible in current VFS change b_blocknr?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: VFS && UFS write support: possible on *BSD/Solaris, impossible on Linux?
  2006-04-19  9:22 VFS && UFS write support: possible on *BSD/Solaris, impossible on Linux? Belan Kumar
@ 2006-04-21 12:30 ` Jan Kara
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2006-04-21 12:30 UTC (permalink / raw)
  To: Belan Kumar; +Cc: Andrew Morton, linux-kernel, linux-fsdevel

  Hello,

> May be better call subject something like: "Shortest way to ufs write support",
> but current subject give more chances to recieve answer.
> 
> First of all I try explain the current problem:
> UFS as other block file systems has notition of "block",
> but further to "block" notion it has "fragment" concept.
> "fragment" used for preventing waste of space.
> Usually fragment==block/8, and if "the rest of file" doesn't occupy
> the whole block, it occupy several fragments. If file grows, at some point
> "the rest of file"  will be occupy 8 fragments. And HERE IS PROBLEM,
> we should allocate block and move 8 fragments to it.
> 
> On *BSD/Solaris it is simple: they read analog of buffer_head and
> change analog of b_blocknr and that's all.
> 
> The current code of fs/ufs/balloc.c does the same:
> ----------------------
> sb_bread
> bh->b_blocknr =
> mark_buffer_dirty (bh)
> brelse (bh)
> --------------------------
> I suppose you guess: it doesn't work,
> latter when you do sb_getblk(old_blocknr) it give to us the same block
> and after that kernel hang up.
> 
> 
> Hence question: what would be the proper solution in this situation?
> Is it possible in current VFS change b_blocknr?
  I guess it is possible but certainly it's not that easy as just
changing b_blocknr. Each buffer head is attached to a page (either to a
page of a backing device mapping or to a page belonging to the inode
mapping). And if you look at e.g. __find_get_block_slow() you'll see
that we look for the buffer using that page. So you definitely need to
somehow attach the buffer to the new page at the correct location.

								Honza
-- 
Jan Kara <jack@suse.cz>
SuSE CR Labs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-04-21 12:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-19  9:22 VFS && UFS write support: possible on *BSD/Solaris, impossible on Linux? Belan Kumar
2006-04-21 12:30 ` Jan Kara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®