mirror of https://gitee.com/openkylin/linux.git
[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>
This commit is contained in:
parent
e697264709
commit
5516762261
|
@ -491,7 +491,7 @@ static void trans_go_xmote_bh(struct gfs2_glock *gl)
|
|||
struct gfs2_sbd *sdp = gl->gl_sbd;
|
||||
struct gfs2_inode *ip = GFS2_I(sdp->sd_jdesc->jd_inode);
|
||||
struct gfs2_glock *j_gl = ip->i_gl;
|
||||
struct gfs2_log_header head;
|
||||
struct gfs2_log_header_host head;
|
||||
int error;
|
||||
|
||||
if (gl->gl_state != LM_ST_UNLOCKED &&
|
||||
|
|
|
@ -41,7 +41,7 @@ struct gfs2_log_operations {
|
|||
void (*lo_before_commit) (struct gfs2_sbd *sdp);
|
||||
void (*lo_after_commit) (struct gfs2_sbd *sdp, struct gfs2_ail *ai);
|
||||
void (*lo_before_scan) (struct gfs2_jdesc *jd,
|
||||
struct gfs2_log_header *head, int pass);
|
||||
struct gfs2_log_header_host *head, int pass);
|
||||
int (*lo_scan_elements) (struct gfs2_jdesc *jd, unsigned int start,
|
||||
struct gfs2_log_descriptor *ld, __be64 *ptr,
|
||||
int pass);
|
||||
|
|
|
@ -182,7 +182,7 @@ static void buf_lo_after_commit(struct gfs2_sbd *sdp, struct gfs2_ail *ai)
|
|||
}
|
||||
|
||||
static void buf_lo_before_scan(struct gfs2_jdesc *jd,
|
||||
struct gfs2_log_header *head, int pass)
|
||||
struct gfs2_log_header_host *head, int pass)
|
||||
{
|
||||
struct gfs2_sbd *sdp = GFS2_SB(jd->jd_inode);
|
||||
|
||||
|
@ -328,7 +328,7 @@ static void revoke_lo_before_commit(struct gfs2_sbd *sdp)
|
|||
}
|
||||
|
||||
static void revoke_lo_before_scan(struct gfs2_jdesc *jd,
|
||||
struct gfs2_log_header *head, int pass)
|
||||
struct gfs2_log_header_host *head, int pass)
|
||||
{
|
||||
struct gfs2_sbd *sdp = GFS2_SB(jd->jd_inode);
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ static inline void lops_after_commit(struct gfs2_sbd *sdp, struct gfs2_ail *ai)
|
|||
}
|
||||
|
||||
static inline void lops_before_scan(struct gfs2_jdesc *jd,
|
||||
struct gfs2_log_header *head,
|
||||
struct gfs2_log_header_host *head,
|
||||
unsigned int pass)
|
||||
{
|
||||
int x;
|
||||
|
|
|
@ -251,7 +251,7 @@ void gfs2_dinode_print(const struct gfs2_dinode_host *di)
|
|||
printk(KERN_INFO " di_eattr = %llu\n", (unsigned long long)di->di_eattr);
|
||||
}
|
||||
|
||||
void gfs2_log_header_in(struct gfs2_log_header *lh, const void *buf)
|
||||
void gfs2_log_header_in(struct gfs2_log_header_host *lh, const void *buf)
|
||||
{
|
||||
const struct gfs2_log_header *str = buf;
|
||||
|
||||
|
|
|
@ -132,10 +132,10 @@ void gfs2_revoke_clean(struct gfs2_sbd *sdp)
|
|||
*/
|
||||
|
||||
static int get_log_header(struct gfs2_jdesc *jd, unsigned int blk,
|
||||
struct gfs2_log_header *head)
|
||||
struct gfs2_log_header_host *head)
|
||||
{
|
||||
struct buffer_head *bh;
|
||||
struct gfs2_log_header lh;
|
||||
struct gfs2_log_header_host lh;
|
||||
u32 hash;
|
||||
int error;
|
||||
|
||||
|
@ -143,7 +143,7 @@ static int get_log_header(struct gfs2_jdesc *jd, unsigned int blk,
|
|||
if (error)
|
||||
return error;
|
||||
|
||||
memcpy(&lh, bh->b_data, sizeof(struct gfs2_log_header));
|
||||
memcpy(&lh, bh->b_data, sizeof(struct gfs2_log_header)); /* XXX */
|
||||
lh.lh_hash = 0;
|
||||
hash = gfs2_disk_hash((char *)&lh, sizeof(struct gfs2_log_header));
|
||||
gfs2_log_header_in(&lh, bh->b_data);
|
||||
|
@ -174,7 +174,7 @@ static int get_log_header(struct gfs2_jdesc *jd, unsigned int blk,
|
|||
*/
|
||||
|
||||
static int find_good_lh(struct gfs2_jdesc *jd, unsigned int *blk,
|
||||
struct gfs2_log_header *head)
|
||||
struct gfs2_log_header_host *head)
|
||||
{
|
||||
unsigned int orig_blk = *blk;
|
||||
int error;
|
||||
|
@ -205,10 +205,10 @@ static int find_good_lh(struct gfs2_jdesc *jd, unsigned int *blk,
|
|||
* Returns: errno
|
||||
*/
|
||||
|
||||
static int jhead_scan(struct gfs2_jdesc *jd, struct gfs2_log_header *head)
|
||||
static int jhead_scan(struct gfs2_jdesc *jd, struct gfs2_log_header_host *head)
|
||||
{
|
||||
unsigned int blk = head->lh_blkno;
|
||||
struct gfs2_log_header lh;
|
||||
struct gfs2_log_header_host lh;
|
||||
int error;
|
||||
|
||||
for (;;) {
|
||||
|
@ -245,9 +245,9 @@ static int jhead_scan(struct gfs2_jdesc *jd, struct gfs2_log_header *head)
|
|||
* Returns: errno
|
||||
*/
|
||||
|
||||
int gfs2_find_jhead(struct gfs2_jdesc *jd, struct gfs2_log_header *head)
|
||||
int gfs2_find_jhead(struct gfs2_jdesc *jd, struct gfs2_log_header_host *head)
|
||||
{
|
||||
struct gfs2_log_header lh_1, lh_m;
|
||||
struct gfs2_log_header_host lh_1, lh_m;
|
||||
u32 blk_1, blk_2, blk_m;
|
||||
int error;
|
||||
|
||||
|
@ -320,7 +320,7 @@ static int foreach_descriptor(struct gfs2_jdesc *jd, unsigned int start,
|
|||
length = be32_to_cpu(ld->ld_length);
|
||||
|
||||
if (be32_to_cpu(ld->ld_header.mh_type) == GFS2_METATYPE_LH) {
|
||||
struct gfs2_log_header lh;
|
||||
struct gfs2_log_header_host lh;
|
||||
error = get_log_header(jd, start, &lh);
|
||||
if (!error) {
|
||||
gfs2_replay_incr_blk(sdp, &start);
|
||||
|
@ -363,7 +363,7 @@ static int foreach_descriptor(struct gfs2_jdesc *jd, unsigned int start,
|
|||
* Returns: errno
|
||||
*/
|
||||
|
||||
static int clean_journal(struct gfs2_jdesc *jd, struct gfs2_log_header *head)
|
||||
static int clean_journal(struct gfs2_jdesc *jd, struct gfs2_log_header_host *head)
|
||||
{
|
||||
struct gfs2_inode *ip = GFS2_I(jd->jd_inode);
|
||||
struct gfs2_sbd *sdp = GFS2_SB(jd->jd_inode);
|
||||
|
@ -425,7 +425,7 @@ int gfs2_recover_journal(struct gfs2_jdesc *jd)
|
|||
{
|
||||
struct gfs2_inode *ip = GFS2_I(jd->jd_inode);
|
||||
struct gfs2_sbd *sdp = GFS2_SB(jd->jd_inode);
|
||||
struct gfs2_log_header head;
|
||||
struct gfs2_log_header_host head;
|
||||
struct gfs2_holder j_gh, ji_gh, t_gh;
|
||||
unsigned long t;
|
||||
int ro = 0;
|
||||
|
|
|
@ -26,7 +26,7 @@ int gfs2_revoke_check(struct gfs2_sbd *sdp, u64 blkno, unsigned int where);
|
|||
void gfs2_revoke_clean(struct gfs2_sbd *sdp);
|
||||
|
||||
int gfs2_find_jhead(struct gfs2_jdesc *jd,
|
||||
struct gfs2_log_header *head);
|
||||
struct gfs2_log_header_host *head);
|
||||
int gfs2_recover_journal(struct gfs2_jdesc *gfs2_jd);
|
||||
void gfs2_check_journals(struct gfs2_sbd *sdp);
|
||||
|
||||
|
|
|
@ -508,7 +508,7 @@ int gfs2_make_fs_rw(struct gfs2_sbd *sdp)
|
|||
struct gfs2_inode *ip = GFS2_I(sdp->sd_jdesc->jd_inode);
|
||||
struct gfs2_glock *j_gl = ip->i_gl;
|
||||
struct gfs2_holder t_gh;
|
||||
struct gfs2_log_header head;
|
||||
struct gfs2_log_header_host head;
|
||||
int error;
|
||||
|
||||
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,
|
|||
struct gfs2_jdesc *jd;
|
||||
struct lfcc *lfcc;
|
||||
LIST_HEAD(list);
|
||||
struct gfs2_log_header lh;
|
||||
struct gfs2_log_header_host lh;
|
||||
int error;
|
||||
|
||||
error = gfs2_jindex_hold(sdp, &ji_gh);
|
||||
|
|
|
@ -405,6 +405,16 @@ struct gfs2_log_header {
|
|||
__be32 lh_hash;
|
||||
};
|
||||
|
||||
struct gfs2_log_header_host {
|
||||
struct gfs2_meta_header lh_header;
|
||||
|
||||
__u64 lh_sequence; /* Sequence number of this transaction */
|
||||
__u32 lh_flags; /* GFS2_LOG_HEAD_... */
|
||||
__u32 lh_tail; /* Block number of log tail */
|
||||
__u32 lh_blkno;
|
||||
__u32 lh_hash;
|
||||
};
|
||||
|
||||
/*
|
||||
* Log type descriptor
|
||||
*/
|
||||
|
@ -492,7 +502,7 @@ extern void gfs2_dinode_in(struct gfs2_dinode_host *di, const void *buf);
|
|||
extern void gfs2_dinode_out(const struct gfs2_dinode_host *di, void *buf);
|
||||
extern void gfs2_ea_header_in(struct gfs2_ea_header *ea, const void *buf);
|
||||
extern void gfs2_ea_header_out(const struct gfs2_ea_header *ea, void *buf);
|
||||
extern void gfs2_log_header_in(struct gfs2_log_header *lh, const void *buf);
|
||||
extern void gfs2_log_header_in(struct gfs2_log_header_host *lh, const void *buf);
|
||||
extern void gfs2_inum_range_in(struct gfs2_inum_range_host *ir, const void *buf);
|
||||
extern void gfs2_inum_range_out(const struct gfs2_inum_range_host *ir, void *buf);
|
||||
extern void gfs2_statfs_change_in(struct gfs2_statfs_change *sc, const void *buf);
|
||||
|
|
Loading…
Reference in New Issue