Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 142642
b: refs/heads/master
c: cece552
h: refs/heads/master
v: v3
  • Loading branch information
Ryusuke Konishi authored and Linus Torvalds committed Apr 7, 2009
1 parent 066b269 commit bba1dcf
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 209 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: c96fa464a567a2a8796009af0e79bc68af73f485
refs/heads/master: cece552074c591970353ad48308d65f110aeaf28
12 changes: 1 addition & 11 deletions trunk/fs/nilfs2/recovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,16 +463,6 @@ static int nilfs_prepare_segment_for_recovery(struct the_nilfs *nilfs,
nilfs_free_segment_entry(ent);
}

/*
* The segment having the latest super root is active, and
* should be deactivated on the next construction for recovery.
*/
err = -ENOMEM;
ent = nilfs_alloc_segment_entry(segnum[0]);
if (unlikely(!ent))
goto failed;
list_add_tail(&ent->list, &ri->ri_used_segments);

/* Allocate new segments for recovery */
err = nilfs_sufile_alloc(sufile, &segnum[0]);
if (unlikely(err))
Expand Down Expand Up @@ -757,7 +747,7 @@ int nilfs_recover_logical_segments(struct the_nilfs *nilfs,
goto failed;
}

err = nilfs_attach_segment_constructor(sbi, ri);
err = nilfs_attach_segment_constructor(sbi);
if (unlikely(err))
goto failed;

Expand Down
24 changes: 1 addition & 23 deletions trunk/fs/nilfs2/segbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,46 +64,24 @@ struct nilfs_segment_buffer *nilfs_segbuf_new(struct super_block *sb)
INIT_LIST_HEAD(&segbuf->sb_list);
INIT_LIST_HEAD(&segbuf->sb_segsum_buffers);
INIT_LIST_HEAD(&segbuf->sb_payload_buffers);
segbuf->sb_segent = NULL;
return segbuf;
}

void nilfs_segbuf_free(struct nilfs_segment_buffer *segbuf)
{
struct nilfs_segment_entry *ent = segbuf->sb_segent;

if (ent != NULL && list_empty(&ent->list)) {
/* free isolated segment list head */
nilfs_free_segment_entry(segbuf->sb_segent);
segbuf->sb_segent = NULL;
}
kmem_cache_free(nilfs_segbuf_cachep, segbuf);
}

int nilfs_segbuf_map(struct nilfs_segment_buffer *segbuf, __u64 segnum,
void nilfs_segbuf_map(struct nilfs_segment_buffer *segbuf, __u64 segnum,
unsigned long offset, struct the_nilfs *nilfs)
{
struct nilfs_segment_entry *ent;

segbuf->sb_segnum = segnum;
nilfs_get_segment_range(nilfs, segnum, &segbuf->sb_fseg_start,
&segbuf->sb_fseg_end);

segbuf->sb_pseg_start = segbuf->sb_fseg_start + offset;
segbuf->sb_rest_blocks =
segbuf->sb_fseg_end - segbuf->sb_pseg_start + 1;

/* Attach a segment list head */
ent = segbuf->sb_segent;
if (ent == NULL) {
segbuf->sb_segent = nilfs_alloc_segment_entry(segnum);
if (unlikely(!segbuf->sb_segent))
return -ENOMEM;
} else {
BUG_ON(ent->bh_su || !list_empty(&ent->list));
ent->segnum = segnum;
}
return 0;
}

void nilfs_segbuf_set_next_segnum(struct nilfs_segment_buffer *segbuf,
Expand Down
6 changes: 2 additions & 4 deletions trunk/fs/nilfs2/segbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ struct nilfs_segsum_info {
* struct nilfs_segment_buffer - Segment buffer
* @sb_super: back pointer to a superblock struct
* @sb_list: List head to chain this structure
* @sb_segent: Pointer for attaching a segment entry
* @sb_sum: On-memory segment summary
* @sb_segnum: Index number of the full segment
* @sb_nextnum: Index number of the next full segment
Expand All @@ -83,7 +82,6 @@ struct nilfs_segsum_info {
struct nilfs_segment_buffer {
struct super_block *sb_super;
struct list_head sb_list;
struct nilfs_segment_entry *sb_segent;

/* Segment information */
struct nilfs_segsum_info sb_sum;
Expand Down Expand Up @@ -125,8 +123,8 @@ int __init nilfs_init_segbuf_cache(void);
void nilfs_destroy_segbuf_cache(void);
struct nilfs_segment_buffer *nilfs_segbuf_new(struct super_block *);
void nilfs_segbuf_free(struct nilfs_segment_buffer *);
int nilfs_segbuf_map(struct nilfs_segment_buffer *, __u64, unsigned long,
struct the_nilfs *);
void nilfs_segbuf_map(struct nilfs_segment_buffer *, __u64, unsigned long,
struct the_nilfs *);
void nilfs_segbuf_set_next_segnum(struct nilfs_segment_buffer *, __u64,
struct the_nilfs *);
int nilfs_segbuf_reset(struct nilfs_segment_buffer *, unsigned, time_t);
Expand Down
Loading

0 comments on commit bba1dcf

Please sign in to comment.