aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-10-13 21:47:13 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-11-30 10:33:14 -0500
commit551676226163379c217e8ec54bd287eab9b8521e (patch)
tree84abfa1a29c23890124f6dc66790af49917940b4
parente697264709c86040271cdd7abee781d7adbb7f91 (diff)
[GFS2] split and annotate gfs2_log_head
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
-rw-r--r--fs/gfs2/glops.c2
-rw-r--r--fs/gfs2/incore.h2
-rw-r--r--fs/gfs2/lops.c4
-rw-r--r--fs/gfs2/lops.h2
-rw-r--r--fs/gfs2/ondisk.c2
-rw-r--r--fs/gfs2/recovery.c22
-rw-r--r--fs/gfs2/recovery.h2
-rw-r--r--fs/gfs2/super.c4
-rw-r--r--include/linux/gfs2_ondisk.h12
9 files changed, 31 insertions, 21 deletions
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c
index 41a6b6818a50..5406b193227c 100644
--- a/fs/gfs2/glops.c
+++ b/fs/gfs2/glops.c
@@ -491,7 +491,7 @@ static void trans_go_xmote_bh(struct gfs2_glock *gl)
491 struct gfs2_sbd *sdp = gl->gl_sbd; 491 struct gfs2_sbd *sdp = gl->gl_sbd;
492 struct gfs2_inode *ip = GFS2_I(sdp->sd_jdesc->jd_inode); 492 struct gfs2_inode *ip = GFS2_I(sdp->sd_jdesc->jd_inode);
493 struct gfs2_glock *j_gl = ip->i_gl; 493 struct gfs2_glock *j_gl = ip->i_gl;
494 struct gfs2_log_header head; 494 struct gfs2_log_header_host head;
495 int error; 495 int error;
496 496
497 if (gl->gl_state != LM_ST_UNLOCKED && 497 if (gl->gl_state != LM_ST_UNLOCKED &&
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index 8ca7a7f35062..e69f3394a2ce 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -41,7 +41,7 @@ struct gfs2_log_operations {
41 void (*lo_before_commit) (struct gfs2_sbd *sdp); 41 void (*lo_before_commit) (struct gfs2_sbd *sdp);
42 void (*lo_after_commit) (struct gfs2_sbd *sdp, struct gfs2_ail *ai); 42 void (*lo_after_commit) (struct gfs2_sbd *sdp, struct gfs2_ail *ai);
43 void (*lo_before_scan) (struct gfs2_jdesc *jd, 43 void (*lo_before_scan) (struct gfs2_jdesc *jd,
44 struct gfs2_log_header *head, int pass); 44 struct gfs2_log_header_host *head, int pass);
45 int (*lo_scan_elements) (struct gfs2_jdesc *jd, unsigned int start, 45 int (*lo_scan_elements) (struct gfs2_jdesc *jd, unsigned int start,
46 struct gfs2_log_descriptor *ld, __be64 *ptr, 46 struct gfs2_log_descriptor *ld, __be64 *ptr,
47 int pass); 47 int pass);
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c
index ab6d1115f95d..8a654cd253dd 100644
--- a/fs/gfs2/lops.c
+++ b/fs/gfs2/lops.c
@@ -182,7 +182,7 @@ static void buf_lo_after_commit(struct gfs2_sbd *sdp, struct gfs2_ail *ai)
182} 182}
183 183
184static void buf_lo_before_scan(struct gfs2_jdesc *jd, 184static void buf_lo_before_scan(struct gfs2_jdesc *jd,
185 struct gfs2_log_header *head, int pass) 185 struct gfs2_log_header_host *head, int pass)
186{ 186{
187 struct gfs2_sbd *sdp = GFS2_SB(jd->jd_inode); 187 struct gfs2_sbd *sdp = GFS2_SB(jd->jd_inode);
188 188
@@ -328,7 +328,7 @@ static void revoke_lo_before_commit(struct gfs2_sbd *sdp)
328} 328}
329 329
330static void revoke_lo_before_scan(struct gfs2_jdesc *jd, 330static void revoke_lo_before_scan(struct gfs2_jdesc *jd,
331 struct gfs2_log_header *head, int pass) 331 struct gfs2_log_header_host *head, int pass)
332{ 332{
333 struct gfs2_sbd *sdp = GFS2_SB(jd->jd_inode); 333 struct gfs2_sbd *sdp = GFS2_SB(jd->jd_inode);
334 334
diff --git a/fs/gfs2/lops.h b/fs/gfs2/lops.h
index 5839c05ae6be..965bc65c7c64 100644
--- a/fs/gfs2/lops.h
+++ b/fs/gfs2/lops.h
@@ -60,7 +60,7 @@ static inline void lops_after_commit(struct gfs2_sbd *sdp, struct gfs2_ail *ai)
60} 60}
61 61
62static inline void lops_before_scan(struct gfs2_jdesc *jd, 62static inline void lops_before_scan(struct gfs2_jdesc *jd,
63 struct gfs2_log_header *head, 63 struct gfs2_log_header_host *head,
64 unsigned int pass) 64 unsigned int pass)
65{ 65{
66 int x; 66 int x;
diff --git a/fs/gfs2/ondisk.c b/fs/gfs2/ondisk.c
index 64f5f0c604aa..84b1ebc7569e 100644
--- a/fs/gfs2/ondisk.c
+++ b/fs/gfs2/ondisk.c
@@ -251,7 +251,7 @@ void gfs2_dinode_print(const struct gfs2_dinode_host *di)
251 printk(KERN_INFO " di_eattr = %llu\n", (unsigned long long)di->di_eattr); 251 printk(KERN_INFO " di_eattr = %llu\n", (unsigned long long)di->di_eattr);
252} 252}
253 253
254void gfs2_log_header_in(struct gfs2_log_header *lh, const void *buf) 254void gfs2_log_header_in(struct gfs2_log_header_host *lh, const void *buf)
255{ 255{
256 const struct gfs2_log_header *str = buf; 256 const struct gfs2_log_header *str = buf;
257 257
diff --git a/fs/gfs2/recovery.c b/fs/gfs2/recovery.c
index 62cd223819b7..447816241626 100644
--- a/fs/gfs2/recovery.c
+++ b/fs/gfs2/recovery.c
@@ -132,10 +132,10 @@ void gfs2_revoke_clean(struct gfs2_sbd *sdp)
132 */ 132 */
133 133
134static int get_log_header(struct gfs2_jdesc *jd, unsigned int blk, 134static int get_log_header(struct gfs2_jdesc *jd, unsigned int blk,
135 struct gfs2_log_header *head) 135 struct gfs2_log_header_host *head)
136{ 136{
137 struct buffer_head *bh; 137 struct buffer_head *bh;
138 struct gfs2_log_header lh; 138 struct gfs2_log_header_host lh;
139 u32 hash; 139 u32 hash;
140 int error; 140 int error;
141 141
@@ -143,7 +143,7 @@ static int get_log_header(struct gfs2_jdesc *jd, unsigned int blk,
143 if (error) 143 if (error)
144 return error; 144 return error;
145 145
146 memcpy(&lh, bh->b_data, sizeof(struct gfs2_log_header)); 146 memcpy(&lh, bh->b_data, sizeof(struct gfs2_log_header)); /* XXX */
147 lh.lh_hash = 0; 147 lh.lh_hash = 0;
148 hash = gfs2_disk_hash((char *)&lh, sizeof(struct gfs2_log_header)); 148 hash = gfs2_disk_hash((char *)&lh, sizeof(struct gfs2_log_header));
149 gfs2_log_header_in(&lh, bh->b_data); 149 gfs2_log_header_in(&lh, bh->b_data);
@@ -174,7 +174,7 @@ static int get_log_header(struct gfs2_jdesc *jd, unsigned int blk,
174 */ 174 */
175 175
176static int find_good_lh(struct gfs2_jdesc *jd, unsigned int *blk, 176static int find_good_lh(struct gfs2_jdesc *jd, unsigned int *blk,
177 struct gfs2_log_header *head) 177 struct gfs2_log_header_host *head)
178{ 178{
179 unsigned int orig_blk = *blk; 179 unsigned int orig_blk = *blk;
180 int error; 180 int error;
@@ -205,10 +205,10 @@ static int find_good_lh(struct gfs2_jdesc *jd, unsigned int *blk,
205 * Returns: errno 205 * Returns: errno
206 */ 206 */
207 207
208static int jhead_scan(struct gfs2_jdesc *jd, struct gfs2_log_header *head) 208static int jhead_scan(struct gfs2_jdesc *jd, struct gfs2_log_header_host *head)
209{ 209{
210 unsigned int blk = head->lh_blkno; 210 unsigned int blk = head->lh_blkno;
211 struct gfs2_log_header lh; 211 struct gfs2_log_header_host lh;
212 int error; 212 int error;
213 213
214 for (;;) { 214 for (;;) {
@@ -245,9 +245,9 @@ static int jhead_scan(struct gfs2_jdesc *jd, struct gfs2_log_header *head)
245 * Returns: errno 245 * Returns: errno
246 */ 246 */
247 247
248int gfs2_find_jhead(struct gfs2_jdesc *jd, struct gfs2_log_header *head) 248int gfs2_find_jhead(struct gfs2_jdesc *jd, struct gfs2_log_header_host *head)
249{ 249{
250 struct gfs2_log_header lh_1, lh_m; 250 struct gfs2_log_header_host lh_1, lh_m;
251 u32 blk_1, blk_2, blk_m; 251 u32 blk_1, blk_2, blk_m;
252 int error; 252 int error;
253 253
@@ -320,7 +320,7 @@ static int foreach_descriptor(struct gfs2_jdesc *jd, unsigned int start,
320 length = be32_to_cpu(ld->ld_length); 320 length = be32_to_cpu(ld->ld_length);
321 321
322 if (be32_to_cpu(ld->ld_header.mh_type) == GFS2_METATYPE_LH) { 322 if (be32_to_cpu(ld->ld_header.mh_type) == GFS2_METATYPE_LH) {
323 struct gfs2_log_header lh; 323 struct gfs2_log_header_host lh;
324 error = get_log_header(jd, start, &lh); 324 error = get_log_header(jd, start, &lh);
325 if (!error) { 325 if (!error) {
326 gfs2_replay_incr_blk(sdp, &start); 326 gfs2_replay_incr_blk(sdp, &start);
@@ -363,7 +363,7 @@ static int foreach_descriptor(struct gfs2_jdesc *jd, unsigned int start,
363 * Returns: errno 363 * Returns: errno
364 */ 364 */
365 365
366static int clean_journal(struct gfs2_jdesc *jd, struct gfs2_log_header *head) 366static int clean_journal(struct gfs2_jdesc *jd, struct gfs2_log_header_host *head)
367{ 367{
368 struct gfs2_inode *ip = GFS2_I(jd->jd_inode); 368 struct gfs2_inode *ip = GFS2_I(jd->jd_inode);
369 struct gfs2_sbd *sdp = GFS2_SB(jd->jd_inode); 369 struct gfs2_sbd *sdp = GFS2_SB(jd->jd_inode);
@@ -425,7 +425,7 @@ int gfs2_recover_journal(struct gfs2_jdesc *jd)
425{ 425{
426 struct gfs2_inode *ip = GFS2_I(jd->jd_inode); 426 struct gfs2_inode *ip = GFS2_I(jd->jd_inode);
427 struct gfs2_sbd *sdp = GFS2_SB(jd->jd_inode); 427 struct gfs2_sbd *sdp = GFS2_SB(jd->jd_inode);
428 struct gfs2_log_header head; 428 struct gfs2_log_header_host head;
429 struct gfs2_holder j_gh, ji_gh, t_gh; 429 struct gfs2_holder j_gh, ji_gh, t_gh;
430 unsigned long t; 430 unsigned long t;
431 int ro = 0; 431 int ro = 0;
diff --git a/fs/gfs2/recovery.h b/fs/gfs2/recovery.h
index 961feedf4d8b..f7235e61c723 100644
--- a/fs/gfs2/recovery.h
+++ b/fs/gfs2/recovery.h
@@ -26,7 +26,7 @@ int gfs2_revoke_check(struct gfs2_sbd *sdp, u64 blkno, unsigned int where);
26void gfs2_revoke_clean(struct gfs2_sbd *sdp); 26void gfs2_revoke_clean(struct gfs2_sbd *sdp);
27 27
28int gfs2_find_jhead(struct gfs2_jdesc *jd, 28int gfs2_find_jhead(struct gfs2_jdesc *jd,
29 struct gfs2_log_header *head); 29 struct gfs2_log_header_host *head);
30int gfs2_recover_journal(struct gfs2_jdesc *gfs2_jd); 30int gfs2_recover_journal(struct gfs2_jdesc *gfs2_jd);
31void gfs2_check_journals(struct gfs2_sbd *sdp); 31void gfs2_check_journals(struct gfs2_sbd *sdp);
32 32
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 52aa3221fc99..0faf563c83a9 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -508,7 +508,7 @@ int gfs2_make_fs_rw(struct gfs2_sbd *sdp)
508 struct gfs2_inode *ip = GFS2_I(sdp->sd_jdesc->jd_inode); 508 struct gfs2_inode *ip = GFS2_I(sdp->sd_jdesc->jd_inode);
509 struct gfs2_glock *j_gl = ip->i_gl; 509 struct gfs2_glock *j_gl = ip->i_gl;
510 struct gfs2_holder t_gh; 510 struct gfs2_holder t_gh;
511 struct gfs2_log_header head; 511 struct gfs2_log_header_host head;
512 int error; 512 int error;
513 513
514 error = gfs2_glock_nq_init(sdp->sd_trans_gl, LM_ST_SHARED, 514 error = gfs2_glock_nq_init(sdp->sd_trans_gl, LM_ST_SHARED,
@@ -873,7 +873,7 @@ static int gfs2_lock_fs_check_clean(struct gfs2_sbd *sdp,
873 struct gfs2_jdesc *jd; 873 struct gfs2_jdesc *jd;
874 struct lfcc *lfcc; 874 struct lfcc *lfcc;
875 LIST_HEAD(list); 875 LIST_HEAD(list);
876 struct gfs2_log_header lh; 876 struct gfs2_log_header_host lh;
877 int error; 877 int error;
878 878
879 error = gfs2_jindex_hold(sdp, &ji_gh); 879 error = gfs2_jindex_hold(sdp, &ji_gh);
diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h
index c035587d066e..fb69a64c70cd 100644
--- a/include/linux/gfs2_ondisk.h
+++ b/include/linux/gfs2_ondisk.h
@@ -405,6 +405,16 @@ struct gfs2_log_header {
405 __be32 lh_hash; 405 __be32 lh_hash;
406}; 406};
407 407
408struct gfs2_log_header_host {
409 struct gfs2_meta_header lh_header;
410
411 __u64 lh_sequence; /* Sequence number of this transaction */
412 __u32 lh_flags; /* GFS2_LOG_HEAD_... */
413 __u32 lh_tail; /* Block number of log tail */
414 __u32 lh_blkno;
415 __u32 lh_hash;
416};
417
408/* 418/*
409 * Log type descriptor 419 * Log type descriptor
410 */ 420 */
@@ -492,7 +502,7 @@ extern void gfs2_dinode_in(struct gfs2_dinode_host *di, const void *buf);
492extern void gfs2_dinode_out(const struct gfs2_dinode_host *di, void *buf); 502extern void gfs2_dinode_out(const struct gfs2_dinode_host *di, void *buf);
493extern void gfs2_ea_header_in(struct gfs2_ea_header *ea, const void *buf); 503extern void gfs2_ea_header_in(struct gfs2_ea_header *ea, const void *buf);
494extern void gfs2_ea_header_out(const struct gfs2_ea_header *ea, void *buf); 504extern void gfs2_ea_header_out(const struct gfs2_ea_header *ea, void *buf);
495extern void gfs2_log_header_in(struct gfs2_log_header *lh, const void *buf); 505extern void gfs2_log_header_in(struct gfs2_log_header_host *lh, const void *buf);
496extern void gfs2_inum_range_in(struct gfs2_inum_range_host *ir, const void *buf); 506extern void gfs2_inum_range_in(struct gfs2_inum_range_host *ir, const void *buf);
497extern void gfs2_inum_range_out(const struct gfs2_inum_range_host *ir, void *buf); 507extern void gfs2_inum_range_out(const struct gfs2_inum_range_host *ir, void *buf);
498extern void gfs2_statfs_change_in(struct gfs2_statfs_change *sc, const void *buf); 508extern void gfs2_statfs_change_in(struct gfs2_statfs_change *sc, const void *buf);