Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 9634
b: refs/heads/master
c: c2b513d
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro authored and Linus Torvalds committed Oct 4, 2005
1 parent 75961b9 commit 8a9b6ae
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 13 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: ce0fe7e70a0ad11097a3773e9f3f0de3d859edf0
refs/heads/master: c2b513dfbb04d7c94cca145172cfeb91f7683e54
42 changes: 30 additions & 12 deletions trunk/fs/bfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,23 +362,41 @@ static int bfs_fill_super(struct super_block *s, void *data, int silent)
info->si_lf_eblk = 0;
info->si_lf_sblk = 0;
info->si_lf_ioff = 0;
bh = NULL;
for (i=BFS_ROOT_INO; i<=info->si_lasti; i++) {
inode = iget(s,i);
if (BFS_I(inode)->i_dsk_ino == 0)
struct bfs_inode *di;
int block = (i - BFS_ROOT_INO)/BFS_INODES_PER_BLOCK + 1;
int off = (i - BFS_ROOT_INO) % BFS_INODES_PER_BLOCK;
unsigned long sblock, eblock;

if (!off) {
brelse(bh);
bh = sb_bread(s, block);
}

if (!bh)
continue;

di = (struct bfs_inode *)bh->b_data + off;

if (!di->i_ino) {
info->si_freei++;
else {
set_bit(i, info->si_imap);
info->si_freeb -= inode->i_blocks;
if (BFS_I(inode)->i_eblock > info->si_lf_eblk) {
info->si_lf_eblk = BFS_I(inode)->i_eblock;
info->si_lf_sblk = BFS_I(inode)->i_sblock;
info->si_lf_ioff = BFS_INO2OFF(i);
}
continue;
}
set_bit(i, info->si_imap);
info->si_freeb -= BFS_FILEBLOCKS(di);

sblock = le32_to_cpu(di->i_sblock);
eblock = le32_to_cpu(di->i_eblock);
if (eblock > info->si_lf_eblk) {
info->si_lf_eblk = eblock;
info->si_lf_sblk = sblock;
info->si_lf_ioff = BFS_INO2OFF(i);
}
iput(inode);
}
brelse(bh);
if (!(s->s_flags & MS_RDONLY)) {
mark_buffer_dirty(bh);
mark_buffer_dirty(info->si_sbh);
s->s_dirt = 1;
}
dump_imap("read_super", s);
Expand Down

0 comments on commit 8a9b6ae

Please sign in to comment.