diff options
-rw-r--r-- | fs/gfs2/lock_dlm.c | 8 | ||||
-rw-r--r-- | fs/gfs2/quota.c | 23 | ||||
-rw-r--r-- | fs/gfs2/rgrp.c | 4 |
3 files changed, 16 insertions, 19 deletions
diff --git a/fs/gfs2/lock_dlm.c b/fs/gfs2/lock_dlm.c index c8423d6de6c3..2a6ba06bee6f 100644 --- a/fs/gfs2/lock_dlm.c +++ b/fs/gfs2/lock_dlm.c | |||
@@ -466,19 +466,19 @@ static void gdlm_cancel(struct gfs2_glock *gl) | |||
466 | static void control_lvb_read(struct lm_lockstruct *ls, uint32_t *lvb_gen, | 466 | static void control_lvb_read(struct lm_lockstruct *ls, uint32_t *lvb_gen, |
467 | char *lvb_bits) | 467 | char *lvb_bits) |
468 | { | 468 | { |
469 | uint32_t gen; | 469 | __le32 gen; |
470 | memcpy(lvb_bits, ls->ls_control_lvb, GDLM_LVB_SIZE); | 470 | memcpy(lvb_bits, ls->ls_control_lvb, GDLM_LVB_SIZE); |
471 | memcpy(&gen, lvb_bits, sizeof(uint32_t)); | 471 | memcpy(&gen, lvb_bits, sizeof(__le32)); |
472 | *lvb_gen = le32_to_cpu(gen); | 472 | *lvb_gen = le32_to_cpu(gen); |
473 | } | 473 | } |
474 | 474 | ||
475 | static void control_lvb_write(struct lm_lockstruct *ls, uint32_t lvb_gen, | 475 | static void control_lvb_write(struct lm_lockstruct *ls, uint32_t lvb_gen, |
476 | char *lvb_bits) | 476 | char *lvb_bits) |
477 | { | 477 | { |
478 | uint32_t gen; | 478 | __le32 gen; |
479 | memcpy(ls->ls_control_lvb, lvb_bits, GDLM_LVB_SIZE); | 479 | memcpy(ls->ls_control_lvb, lvb_bits, GDLM_LVB_SIZE); |
480 | gen = cpu_to_le32(lvb_gen); | 480 | gen = cpu_to_le32(lvb_gen); |
481 | memcpy(ls->ls_control_lvb, &gen, sizeof(uint32_t)); | 481 | memcpy(ls->ls_control_lvb, &gen, sizeof(__le32)); |
482 | } | 482 | } |
483 | 483 | ||
484 | static int all_jid_bits_clear(char *lvb) | 484 | static int all_jid_bits_clear(char *lvb) |
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 453b50eaddec..98236d0df3ca 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c | |||
@@ -667,7 +667,7 @@ static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc, | |||
667 | struct buffer_head *bh; | 667 | struct buffer_head *bh; |
668 | struct page *page; | 668 | struct page *page; |
669 | void *kaddr, *ptr; | 669 | void *kaddr, *ptr; |
670 | struct gfs2_quota q, *qp; | 670 | struct gfs2_quota q; |
671 | int err, nbytes; | 671 | int err, nbytes; |
672 | u64 size; | 672 | u64 size; |
673 | 673 | ||
@@ -683,28 +683,25 @@ static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc, | |||
683 | return err; | 683 | return err; |
684 | 684 | ||
685 | err = -EIO; | 685 | err = -EIO; |
686 | qp = &q; | 686 | be64_add_cpu(&q.qu_value, change); |
687 | qp->qu_value = be64_to_cpu(qp->qu_value); | 687 | qd->qd_qb.qb_value = q.qu_value; |
688 | qp->qu_value += change; | ||
689 | qp->qu_value = cpu_to_be64(qp->qu_value); | ||
690 | qd->qd_qb.qb_value = qp->qu_value; | ||
691 | if (fdq) { | 688 | if (fdq) { |
692 | if (fdq->d_fieldmask & FS_DQ_BSOFT) { | 689 | if (fdq->d_fieldmask & FS_DQ_BSOFT) { |
693 | qp->qu_warn = cpu_to_be64(fdq->d_blk_softlimit >> sdp->sd_fsb2bb_shift); | 690 | q.qu_warn = cpu_to_be64(fdq->d_blk_softlimit >> sdp->sd_fsb2bb_shift); |
694 | qd->qd_qb.qb_warn = qp->qu_warn; | 691 | qd->qd_qb.qb_warn = q.qu_warn; |
695 | } | 692 | } |
696 | if (fdq->d_fieldmask & FS_DQ_BHARD) { | 693 | if (fdq->d_fieldmask & FS_DQ_BHARD) { |
697 | qp->qu_limit = cpu_to_be64(fdq->d_blk_hardlimit >> sdp->sd_fsb2bb_shift); | 694 | q.qu_limit = cpu_to_be64(fdq->d_blk_hardlimit >> sdp->sd_fsb2bb_shift); |
698 | qd->qd_qb.qb_limit = qp->qu_limit; | 695 | qd->qd_qb.qb_limit = q.qu_limit; |
699 | } | 696 | } |
700 | if (fdq->d_fieldmask & FS_DQ_BCOUNT) { | 697 | if (fdq->d_fieldmask & FS_DQ_BCOUNT) { |
701 | qp->qu_value = cpu_to_be64(fdq->d_bcount >> sdp->sd_fsb2bb_shift); | 698 | q.qu_value = cpu_to_be64(fdq->d_bcount >> sdp->sd_fsb2bb_shift); |
702 | qd->qd_qb.qb_value = qp->qu_value; | 699 | qd->qd_qb.qb_value = q.qu_value; |
703 | } | 700 | } |
704 | } | 701 | } |
705 | 702 | ||
706 | /* Write the quota into the quota file on disk */ | 703 | /* Write the quota into the quota file on disk */ |
707 | ptr = qp; | 704 | ptr = &q; |
708 | nbytes = sizeof(struct gfs2_quota); | 705 | nbytes = sizeof(struct gfs2_quota); |
709 | get_a_page: | 706 | get_a_page: |
710 | page = find_or_create_page(mapping, index, GFP_NOFS); | 707 | page = find_or_create_page(mapping, index, GFP_NOFS); |
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index 4d83abdd5635..c8d6161bd682 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c | |||
@@ -1127,7 +1127,7 @@ int gfs2_rgrp_bh_get(struct gfs2_rgrpd *rgd) | |||
1127 | rgd->rd_flags |= (GFS2_RDF_UPTODATE | GFS2_RDF_CHECK); | 1127 | rgd->rd_flags |= (GFS2_RDF_UPTODATE | GFS2_RDF_CHECK); |
1128 | rgd->rd_free_clone = rgd->rd_free; | 1128 | rgd->rd_free_clone = rgd->rd_free; |
1129 | } | 1129 | } |
1130 | if (be32_to_cpu(GFS2_MAGIC) != rgd->rd_rgl->rl_magic) { | 1130 | if (cpu_to_be32(GFS2_MAGIC) != rgd->rd_rgl->rl_magic) { |
1131 | rgd->rd_rgl->rl_unlinked = cpu_to_be32(count_unlinked(rgd)); | 1131 | rgd->rd_rgl->rl_unlinked = cpu_to_be32(count_unlinked(rgd)); |
1132 | gfs2_rgrp_ondisk2lvb(rgd->rd_rgl, | 1132 | gfs2_rgrp_ondisk2lvb(rgd->rd_rgl, |
1133 | rgd->rd_bits[0].bi_bh->b_data); | 1133 | rgd->rd_bits[0].bi_bh->b_data); |
@@ -1161,7 +1161,7 @@ int update_rgrp_lvb(struct gfs2_rgrpd *rgd) | |||
1161 | if (rgd->rd_flags & GFS2_RDF_UPTODATE) | 1161 | if (rgd->rd_flags & GFS2_RDF_UPTODATE) |
1162 | return 0; | 1162 | return 0; |
1163 | 1163 | ||
1164 | if (be32_to_cpu(GFS2_MAGIC) != rgd->rd_rgl->rl_magic) | 1164 | if (cpu_to_be32(GFS2_MAGIC) != rgd->rd_rgl->rl_magic) |
1165 | return gfs2_rgrp_bh_get(rgd); | 1165 | return gfs2_rgrp_bh_get(rgd); |
1166 | 1166 | ||
1167 | rl_flags = be32_to_cpu(rgd->rd_rgl->rl_flags); | 1167 | rl_flags = be32_to_cpu(rgd->rd_rgl->rl_flags); |