Commit 9bda462a authored by Dave Kleikamp's avatar Dave Kleikamp

JFS: Slightly relax allocation group reservation

Minor change that got missed in the last changeset.  If opening a
non-empty file for writing, don't assume we're allocating new space.
If the file is grown, we'll take care of it then.
parent 2f86142b
......@@ -106,8 +106,13 @@ static int jfs_open(struct inode *inode, struct file *file)
* We attempt to allow only one "active" file open per aggregate
* group. Otherwise, appending to files in parallel can cause
* fragmentation within the files.
*
* If the file is empty, it was probably just created and going
* to be written to. If it has a size, we'll hold off until the
* file is actually grown.
*/
if (S_ISREG(inode->i_mode) && file->f_mode & FMODE_WRITE) {
if (S_ISREG(inode->i_mode) && file->f_mode & FMODE_WRITE &&
(inode->i_size == 0)) {
struct jfs_inode_info *ji = JFS_IP(inode);
if (ji->active_ag == -1) {
ji->active_ag = ji->agno;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment