ocfs2: abstract out allocation locking
authorMark Fasheh <mark.fasheh@oracle.com>
Wed, 17 Jan 2007 21:07:24 +0000 (13:07 -0800)
committerMark Fasheh <mark.fasheh@oracle.com>
Thu, 26 Apr 2007 22:01:58 +0000 (15:01 -0700)
commitabf8b1569415bb4a8915a4884943ecd39c510957
treed2d1e9fb20fbe1fa9126fe843cab2a283c7a2c6c
parent3a0782d09c07aa3ec767ba6089cd15cfbfbfc508
ocfs2: abstract out allocation locking

Right now, file allocation for ocfs2 is done within ocfs2_extend_file(),
which is either called from ->setattr() (for an i_size change), or at the
top of ocfs2_file_aio_write().

Inodes on file systems with sparse file support will want to do their
allocation during the actual write call.

In either case the cluster locking decisions are the same. We abstract out
that code into a new function, ocfs2_lock_allocators() which will be used by
a later patch to enable writing to sparse files.

This also provides a nice cleanup of ocfs2_extend_allocation().

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
fs/ocfs2/file.c