From: NeilBrown Date: Fri, 1 Oct 2010 12:38:48 +0000 (+1000) Subject: Minor formatting improvements. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=9641a20b365a6145f9fe7edc0ef4c10e716a3db1;p=LaFS.git Minor formatting improvements. Signed-off-by: NeilBrown --- diff --git a/cluster.c b/cluster.c index dd29852..b94387a 100644 --- a/cluster.c +++ b/cluster.c @@ -1209,26 +1209,24 @@ static void cluster_flush(struct fs *fs, int cnum) /* Fill in the cluster header */ strncpy(wc->chead->idtag, "LaFSHead", 8); - if (cnum) - wc->chead->flags = cpu_to_le32(0); - else { - /* checkpoints only happen in cnum==0 */ - if (fs->checkpointing) { - spin_lock(&fs->lock); - wc->chead->flags = cpu_to_le32(fs->checkpointing); - if (fs->checkpointing & CH_CheckpointEnd) { - fs->checkpointing = 0; - clear_bit(CheckpointOpen, &fs->fsstate); - } else if (fs->checkpointing & CH_CheckpointStart) { - fs->checkpointcluster = head_addr[0]; - fs->checkpointing &= ~CH_CheckpointStart; - } - spin_unlock(&fs->lock); - if (!fs->checkpointing) - wake_up(&fs->phase_wait); - } else - wc->chead->flags = 0; + wc->chead->flags = cpu_to_le32(0); + + /* checkpoints only happen in cnum==0 */ + if (cnum == 0 && fs->checkpointing) { + spin_lock(&fs->lock); + wc->chead->flags = cpu_to_le32(fs->checkpointing); + if (fs->checkpointing & CH_CheckpointEnd) { + fs->checkpointing = 0; + clear_bit(CheckpointOpen, &fs->fsstate); + } else if (fs->checkpointing & CH_CheckpointStart) { + fs->checkpointcluster = head_addr[0]; + fs->checkpointing &= ~CH_CheckpointStart; + } + spin_unlock(&fs->lock); + if (!fs->checkpointing) + wake_up(&fs->phase_wait); } + memcpy(wc->chead->uuid, fs->state->uuid, 16); wc->chead->seq = cpu_to_le64(wc->cluster_seq); wc->cluster_seq++; diff --git a/state.h b/state.h index e6da2d4..239f7a7 100644 --- a/state.h +++ b/state.h @@ -257,11 +257,11 @@ struct fs { u32 usage_inum; u16 level; - u32 rows_per_table, tables_per_seg; + u32 rows_per_table, tables_per_seg; int recent_dev, recent_state; - int tablesize; /* const */ + int tablesize; /* in segusage file, not in segments */ struct inode *segsum; } *devs;