Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 190087
b: refs/heads/master
c: d3a03f8
h: refs/heads/master
i:
  190085: 6c9a3c8
  190083: 46fc9fc
  190079: 4414ed3
v: v3
  • Loading branch information
Joern Engel committed Apr 13, 2010
1 parent cb9a377 commit ba8e433
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 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: 032d8f7268444a0f5d4ee02d9513d682d5b8edfc
refs/heads/master: d3a03f8031000f8297823b80e36db536fd020884
24 changes: 14 additions & 10 deletions trunk/fs/logfs/journal.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,28 +388,32 @@ static void journal_get_erase_count(struct logfs_area *area)
static int journal_erase_segment(struct logfs_area *area)
{
struct super_block *sb = area->a_sb;
struct logfs_segment_header sh;
union {
struct logfs_segment_header sh;
unsigned char c[ALIGN(sizeof(struct logfs_segment_header), 16)];
} u;
u64 ofs;
int err;

err = logfs_erase_segment(sb, area->a_segno, 1);
if (err)
return err;

sh.pad = 0;
sh.type = SEG_JOURNAL;
sh.level = 0;
sh.segno = cpu_to_be32(area->a_segno);
sh.ec = cpu_to_be32(area->a_erase_count);
sh.gec = cpu_to_be64(logfs_super(sb)->s_gec);
sh.crc = logfs_crc32(&sh, sizeof(sh), 4);
memset(&u, 0, sizeof(u));
u.sh.pad = 0;
u.sh.type = SEG_JOURNAL;
u.sh.level = 0;
u.sh.segno = cpu_to_be32(area->a_segno);
u.sh.ec = cpu_to_be32(area->a_erase_count);
u.sh.gec = cpu_to_be64(logfs_super(sb)->s_gec);
u.sh.crc = logfs_crc32(&u.sh, sizeof(u.sh), 4);

/* This causes a bug in segment.c. Not yet. */
//logfs_set_segment_erased(sb, area->a_segno, area->a_erase_count, 0);

ofs = dev_ofs(sb, area->a_segno, 0);
area->a_used_bytes = ALIGN(sizeof(sh), 16);
logfs_buf_write(area, ofs, &sh, sizeof(sh));
area->a_used_bytes = sizeof(u);
logfs_buf_write(area, ofs, &u, sizeof(u));
return 0;
}

Expand Down

0 comments on commit ba8e433

Please sign in to comment.