dir.c (811f933df1e55615fd0bb4818f31e3868a8e6e23) dir.c (e7d4cb6bc19658646357eeff134645cd9bc3479f)
1/* -*- mode: c; c-basic-offset: 8; -*-
2 * vim: noexpandtab sw=8 ts=8 sts=0:
3 *
4 * dir.c
5 *
6 * Creates, reads, walks and deletes directory-nodes
7 *
8 * Copyright (C) 2002, 2004 Oracle. All rights reserved.

--- 1292 unchanged lines hidden (view full) ---

1301 di->i_ctime = di->i_mtime = cpu_to_le64(dir->i_ctime.tv_sec);
1302 di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(dir->i_ctime.tv_nsec);
1303
1304 /*
1305 * This should never fail as our extent list is empty and all
1306 * related blocks have been journaled already.
1307 */
1308 ret = ocfs2_insert_extent(osb, handle, dir, di_bh, 0, blkno, len, 0,
1/* -*- mode: c; c-basic-offset: 8; -*-
2 * vim: noexpandtab sw=8 ts=8 sts=0:
3 *
4 * dir.c
5 *
6 * Creates, reads, walks and deletes directory-nodes
7 *
8 * Copyright (C) 2002, 2004 Oracle. All rights reserved.

--- 1292 unchanged lines hidden (view full) ---

1301 di->i_ctime = di->i_mtime = cpu_to_le64(dir->i_ctime.tv_sec);
1302 di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(dir->i_ctime.tv_nsec);
1303
1304 /*
1305 * This should never fail as our extent list is empty and all
1306 * related blocks have been journaled already.
1307 */
1308 ret = ocfs2_insert_extent(osb, handle, dir, di_bh, 0, blkno, len, 0,
1309 NULL);
1309 NULL, OCFS2_DINODE_EXTENT);
1310 if (ret) {
1311 mlog_errno(ret);
1312 goto out_commit;
1313 }
1314
1315 /*
1316 * Set i_blocks after the extent insert for the most up to
1317 * date ip_clusters value.

--- 15 unchanged lines hidden (view full) ---

1333 &len);
1334 if (ret) {
1335 mlog_errno(ret);
1336 goto out_commit;
1337 }
1338 blkno = ocfs2_clusters_to_blocks(dir->i_sb, bit_off);
1339
1340 ret = ocfs2_insert_extent(osb, handle, dir, di_bh, 1, blkno,
1310 if (ret) {
1311 mlog_errno(ret);
1312 goto out_commit;
1313 }
1314
1315 /*
1316 * Set i_blocks after the extent insert for the most up to
1317 * date ip_clusters value.

--- 15 unchanged lines hidden (view full) ---

1333 &len);
1334 if (ret) {
1335 mlog_errno(ret);
1336 goto out_commit;
1337 }
1338 blkno = ocfs2_clusters_to_blocks(dir->i_sb, bit_off);
1339
1340 ret = ocfs2_insert_extent(osb, handle, dir, di_bh, 1, blkno,
1341 len, 0, NULL);
1341 len, 0, NULL, OCFS2_DINODE_EXTENT);
1342 if (ret) {
1343 mlog_errno(ret);
1344 goto out_commit;
1345 }
1346 }
1347
1348 *first_block_bh = dirdata_bh;
1349 dirdata_bh = NULL;

--- 126 unchanged lines hidden (view full) ---

1476 mlog(0, "extending dir %llu (i_size = %lld)\n",
1477 (unsigned long long)OCFS2_I(dir)->ip_blkno, dir_i_size);
1478
1479 /* dir->i_size is always block aligned. */
1480 spin_lock(&OCFS2_I(dir)->ip_lock);
1481 if (dir_i_size == ocfs2_clusters_to_bytes(sb, OCFS2_I(dir)->ip_clusters)) {
1482 spin_unlock(&OCFS2_I(dir)->ip_lock);
1483 num_free_extents = ocfs2_num_free_extents(osb, dir,
1342 if (ret) {
1343 mlog_errno(ret);
1344 goto out_commit;
1345 }
1346 }
1347
1348 *first_block_bh = dirdata_bh;
1349 dirdata_bh = NULL;

--- 126 unchanged lines hidden (view full) ---

1476 mlog(0, "extending dir %llu (i_size = %lld)\n",
1477 (unsigned long long)OCFS2_I(dir)->ip_blkno, dir_i_size);
1478
1479 /* dir->i_size is always block aligned. */
1480 spin_lock(&OCFS2_I(dir)->ip_lock);
1481 if (dir_i_size == ocfs2_clusters_to_bytes(sb, OCFS2_I(dir)->ip_clusters)) {
1482 spin_unlock(&OCFS2_I(dir)->ip_lock);
1483 num_free_extents = ocfs2_num_free_extents(osb, dir,
1484 parent_fe_bh);
1484 parent_fe_bh,
1485 OCFS2_DINODE_EXTENT);
1485 if (num_free_extents < 0) {
1486 status = num_free_extents;
1487 mlog_errno(status);
1488 goto bail;
1489 }
1490
1491 if (!num_free_extents) {
1492 status = ocfs2_reserve_new_metadata(osb, el, &meta_ac);

--- 272 unchanged lines hidden ---
1486 if (num_free_extents < 0) {
1487 status = num_free_extents;
1488 mlog_errno(status);
1489 goto bail;
1490 }
1491
1492 if (!num_free_extents) {
1493 status = ocfs2_reserve_new_metadata(osb, el, &meta_ac);

--- 272 unchanged lines hidden ---