MCPcopy Create free account
hub / github.com/bobranten/Ext4Fsd / ext3_append

Function ext3_append

Ext4Fsd/ext3/htree.c:279–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277}
278
279struct buffer_head *ext3_append(struct ext2_icb *icb, struct inode *inode,
280 ext3_lblk_t *block, int *err)
281{
282 PEXT2_MCB mcb = CONTAINING_RECORD(inode, EXT2_MCB, Inode);
283 PEXT2_FCB dcb = mcb->Fcb;
284 NTSTATUS status;
285
286 ASSERT(dcb);
287 ASSERT(inode == dcb->Inode);
288
289 /* allocate new block since there's no space for us */
290 *block = (ext3_lblk_t)(inode->i_size >> inode->i_sb->s_blocksize_bits);
291 dcb->Header.AllocationSize.QuadPart += dcb->Vcb->BlockSize;
292 status = Ext2ExpandFile(icb, dcb->Vcb, mcb, &(dcb->Header.AllocationSize));
293 if (NT_SUCCESS(status)) {
294
295 /* update Dcb */
296 dcb->Header.ValidDataLength = dcb->Header.FileSize = dcb->Header.AllocationSize;
297 mcb->Inode.i_size = dcb->Header.AllocationSize.QuadPart;
298
299 /* save parent directory's inode */
300 Ext2SaveInode(icb, dcb->Vcb, inode);
301 }
302
303 return ext3_bread(icb, inode, *block, err);
304}
305
306
307void ext3_inc_count(struct inode *inode)

Callers 5

Ext2AddDotEntriesFunction · 0.85
ext3_dx_add_entryFunction · 0.85
do_splitFunction · 0.85
make_indexed_dirFunction · 0.85
ext3_add_entryFunction · 0.85

Calls 3

Ext2ExpandFileFunction · 0.85
Ext2SaveInodeFunction · 0.85
ext3_breadFunction · 0.85

Tested by

no test coverage detected