Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 348161
b: refs/heads/master
c: ce19a5d
h: refs/heads/master
i:
  348159: 2fe83f9
v: v3
  • Loading branch information
Jaegeuk Kim committed Dec 28, 2012
1 parent 8b9a0cd commit 2c12ceb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 64c576fe51bc6b19e99340d2d0e1bda89f66db25
refs/heads/master: ce19a5d4321911f98d42e4d724630ae48f413719
22 changes: 8 additions & 14 deletions trunk/fs/f2fs/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,28 +430,22 @@ static int gc_node_segment(struct f2fs_sb_info *sbi,
*/
block_t start_bidx_of_node(unsigned int node_ofs)
{
block_t start_bidx;
unsigned int bidx, indirect_blks;
int dec;
unsigned int indirect_blks = 2 * NIDS_PER_BLOCK + 4;
unsigned int bidx;

indirect_blks = 2 * NIDS_PER_BLOCK + 4;
if (node_ofs == 0)
return 0;

start_bidx = 1;
if (node_ofs == 0) {
start_bidx = 0;
} else if (node_ofs <= 2) {
if (node_ofs <= 2) {
bidx = node_ofs - 1;
} else if (node_ofs <= indirect_blks) {
dec = (node_ofs - 4) / (NIDS_PER_BLOCK + 1);
int dec = (node_ofs - 4) / (NIDS_PER_BLOCK + 1);
bidx = node_ofs - 2 - dec;
} else {
dec = (node_ofs - indirect_blks - 3) / (NIDS_PER_BLOCK + 1);
int dec = (node_ofs - indirect_blks - 3) / (NIDS_PER_BLOCK + 1);
bidx = node_ofs - 5 - dec;
}

if (start_bidx)
start_bidx = bidx * ADDRS_PER_BLOCK + ADDRS_PER_INODE;
return start_bidx;
return bidx * ADDRS_PER_BLOCK + ADDRS_PER_INODE;
}

static int check_dnode(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
Expand Down

0 comments on commit 2c12ceb

Please sign in to comment.