summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/bmap.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2019-06-17 12:00:22 +0200
committerIngo Molnar <mingo@kernel.org>2019-06-17 12:00:22 +0200
commit7b347ad4938ddca1a22b983e36b9ef825a72d230 (patch)
tree93b6262da516cda28465a8dc0c4a6a95525cbbd8 /fs/gfs2/bmap.c
parent9db9b76767f133d0e1ce19f01117c83221641899 (diff)
parent9e0babf2c06c73cda2c0cd37a1653d823adb40ec (diff)
downloadtalos-op-linux-7b347ad4938ddca1a22b983e36b9ef825a72d230.tar.gz
talos-op-linux-7b347ad4938ddca1a22b983e36b9ef825a72d230.zip
Merge tag 'v5.2-rc5' into x86/asm, to refresh the branch
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'fs/gfs2/bmap.c')
-rw-r--r--fs/gfs2/bmap.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index f42718dd292f..93ea1d529aa3 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -1,10 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
- *
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU General Public License version 2.
*/
#include <linux/spinlock.h>
@@ -994,9 +991,12 @@ static void gfs2_write_unlock(struct inode *inode)
static int gfs2_iomap_page_prepare(struct inode *inode, loff_t pos,
unsigned len, struct iomap *iomap)
{
+ unsigned int blockmask = i_blocksize(inode) - 1;
struct gfs2_sbd *sdp = GFS2_SB(inode);
+ unsigned int blocks;
- return gfs2_trans_begin(sdp, RES_DINODE + (len >> inode->i_blkbits), 0);
+ blocks = ((pos & blockmask) + len + blockmask) >> inode->i_blkbits;
+ return gfs2_trans_begin(sdp, RES_DINODE + blocks, 0);
}
static void gfs2_iomap_page_done(struct inode *inode, loff_t pos,
OpenPOWER on IntegriCloud