Skip to content

Commit 15e1c96

Browse files
AstralBobswhiteho
authored andcommitted
GFS2: Eliminate 64-bit divides
This patch removes the 64-bit divides introduced in the previous patch in favor of shifting, so that it will compile properly on 32-bit machines. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
1 parent 8e2e004 commit 15e1c96

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎fs/gfs2/file.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
384384
return ret;
385385

386386
atomic_set(&ip->i_res->rs_sizehint,
387-
PAGE_CACHE_SIZE / sdp->sd_sb.sb_bsize);
387+
PAGE_CACHE_SIZE >> sdp->sd_sb.sb_bsize_shift);
388388

389389
gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);
390390
ret = gfs2_glock_nq(&gh);
@@ -669,7 +669,7 @@ static ssize_t gfs2_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
669669
if (ret)
670670
return ret;
671671

672-
atomic_set(&ip->i_res->rs_sizehint, writesize / sdp->sd_sb.sb_bsize);
672+
atomic_set(&ip->i_res->rs_sizehint, writesize >> sdp->sd_sb.sb_bsize_shift);
673673
if (file->f_flags & O_APPEND) {
674674
struct gfs2_holder gh;
675675

@@ -795,7 +795,7 @@ static long gfs2_fallocate(struct file *file, int mode, loff_t offset,
795795
if (unlikely(error))
796796
goto out_uninit;
797797

798-
atomic_set(&ip->i_res->rs_sizehint, len / sdp->sd_sb.sb_bsize);
798+
atomic_set(&ip->i_res->rs_sizehint, len >> sdp->sd_sb.sb_bsize_shift);
799799

800800
while (len > 0) {
801801
if (len < bytes)

0 commit comments

Comments
 (0)