]> bbs.cooldavid.org Git - net-next-2.6.git/commit
ocfs2: allow return of new inode block location before allocation of the inode
authorMark Fasheh <mfasheh@suse.com>
Fri, 13 Aug 2010 22:15:17 +0000 (15:15 -0700)
committerTao Ma <tao.ma@oracle.com>
Wed, 8 Sep 2010 06:25:59 +0000 (14:25 +0800)
commite49e27674d1dd2717ad90b21ece8f83102153315
tree3ef61e9e4273a236dde61af12cb1e43d8c421c21
parentd51349829c378c06ba4aa7d4b16ca23739858608
ocfs2: allow return of new inode block location before allocation of the inode

This allows code which needs to know the eventual block number of an inode
but can't allocate it yet due to transaction or lock ordering. For example,
ocfs2_create_inode_in_orphan() currently gives a junk blkno for preparation
of the orphan dir because it can't yet know where the actual inode is placed
- that code is actually in ocfs2_mknod_locked. This is a problem when the
orphan dirs are indexed as the junk inode number will create an index entry
which goes unused (and fails the later removal from the orphan dir).  Now
with these interfaces, ocfs2_create_inode_in_orphan() can run the block
group search (and get back the inode block number) *before* any actual
allocation occurs.

Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Tao Ma <tao.ma@oracle.com>
fs/ocfs2/suballoc.c
fs/ocfs2/suballoc.h