quota_space += PAGE_SIZE;
}
+ credits++; /* inode */
+ /*
+ * overwrite case, no need to modify tree and
+ * allocate blocks.
+ */
+ if (!newblocks)
+ goto out_declare;
/*
* each extent can go into new leaf causing a split
* 5 is max tree depth: inode + 4 index blocks
depth = ext_depth(inode);
depth = max(depth, 1) + 1;
newblocks += depth;
- credits++; /* inode */
credits += depth * 2 * extents;
} else {
depth = 3;
newblocks += depth;
- credits++; /* inode */
credits += depth * extents;
}
else
credits += newblocks;
+out_declare:
osd_trans_declare_op(env, oh, OSD_OT_WRITE, credits);
/* make sure the over quota flags were not set */