Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2:
nilfs2: fix problem in setting checkpoint interval
nilfs2: fix missing block address termination in btree node shrinking
nilfs2: fix incorrect block address termination in node concatenation

+28 -13
+27 -12
fs/nilfs2/btree.c
··· 1346 1346 path[level].bp_bh = NULL; 1347 1347 } 1348 1348 1349 + static void nilfs_btree_nop(struct nilfs_bmap *btree, 1350 + struct nilfs_btree_path *path, 1351 + int level, __u64 *keyp, __u64 *ptrp) 1352 + { 1353 + } 1349 1354 1350 1355 static int nilfs_btree_prepare_delete(struct nilfs_bmap *btree, 1351 1356 struct nilfs_btree_path *path, ··· 1361 1356 struct buffer_head *bh; 1362 1357 struct nilfs_btree_node *node, *parent, *sib; 1363 1358 __u64 sibptr; 1364 - int pindex, level, ncmin, ncmax, ncblk, ret; 1359 + int pindex, dindex, level, ncmin, ncmax, ncblk, ret; 1365 1360 1366 1361 ret = 0; 1367 1362 stats->bs_nblocks = 0; 1368 1363 ncmin = NILFS_BTREE_NODE_NCHILDREN_MIN(nilfs_btree_node_size(btree)); 1369 1364 ncblk = nilfs_btree_nchildren_per_block(btree); 1370 1365 1371 - for (level = NILFS_BTREE_LEVEL_NODE_MIN; 1366 + for (level = NILFS_BTREE_LEVEL_NODE_MIN, dindex = path[level].bp_index; 1372 1367 level < nilfs_btree_height(btree) - 1; 1373 1368 level++) { 1374 1369 node = nilfs_btree_get_nonroot_node(path, level); 1375 1370 path[level].bp_oldreq.bpr_ptr = 1376 - nilfs_btree_node_get_ptr(node, path[level].bp_index, 1377 - ncblk); 1371 + nilfs_btree_node_get_ptr(node, dindex, ncblk); 1378 1372 ret = nilfs_bmap_prepare_end_ptr(btree, 1379 1373 &path[level].bp_oldreq, dat); 1380 1374 if (ret < 0) ··· 1387 1383 1388 1384 parent = nilfs_btree_get_node(btree, path, level + 1, &ncmax); 1389 1385 pindex = path[level + 1].bp_index; 1386 + dindex = pindex; 1390 1387 1391 1388 if (pindex > 0) { 1392 1389 /* left sibling */ ··· 1426 1421 path[level].bp_sib_bh = bh; 1427 1422 path[level].bp_op = nilfs_btree_concat_right; 1428 1423 stats->bs_nblocks++; 1424 + /* 1425 + * When merging right sibling node 1426 + * into the current node, pointer to 1427 + * the right sibling node must be 1428 + * terminated instead. The adjustment 1429 + * below is required for that. 1430 + */ 1431 + dindex = pindex + 1; 1429 1432 /* continue; */ 1430 1433 } 1431 1434 } else { ··· 1444 1431 NILFS_BTREE_ROOT_NCHILDREN_MAX) { 1445 1432 path[level].bp_op = nilfs_btree_shrink; 1446 1433 stats->bs_nblocks += 2; 1434 + level++; 1435 + path[level].bp_op = nilfs_btree_nop; 1436 + goto shrink_root_child; 1447 1437 } else { 1448 1438 path[level].bp_op = nilfs_btree_do_delete; 1449 1439 stats->bs_nblocks++; 1440 + goto out; 1450 1441 } 1451 - 1452 - goto out; 1453 - 1454 1442 } 1455 1443 } 1456 1444 1445 + /* child of the root node is deleted */ 1446 + path[level].bp_op = nilfs_btree_do_delete; 1447 + stats->bs_nblocks++; 1448 + 1449 + shrink_root_child: 1457 1450 node = nilfs_btree_get_root(btree); 1458 1451 path[level].bp_oldreq.bpr_ptr = 1459 - nilfs_btree_node_get_ptr(node, path[level].bp_index, 1452 + nilfs_btree_node_get_ptr(node, dindex, 1460 1453 NILFS_BTREE_ROOT_NCHILDREN_MAX); 1461 1454 1462 1455 ret = nilfs_bmap_prepare_end_ptr(btree, &path[level].bp_oldreq, dat); 1463 1456 if (ret < 0) 1464 1457 goto err_out_child_node; 1465 - 1466 - /* child of the root node is deleted */ 1467 - path[level].bp_op = nilfs_btree_do_delete; 1468 - stats->bs_nblocks++; 1469 1458 1470 1459 /* success */ 1471 1460 out:
+1 -1
fs/nilfs2/segment.c
··· 2573 2573 sci->sc_watermark = NILFS_SC_DEFAULT_WATERMARK; 2574 2574 2575 2575 if (nilfs->ns_interval) 2576 - sci->sc_interval = nilfs->ns_interval; 2576 + sci->sc_interval = HZ * nilfs->ns_interval; 2577 2577 if (nilfs->ns_watermark) 2578 2578 sci->sc_watermark = nilfs->ns_watermark; 2579 2579 return sci;