Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 336197
b: refs/heads/master
c: ab73857
h: refs/heads/master
i:
  336195: 87c82d1
v: v3
  • Loading branch information
Linus Torvalds committed Nov 29, 2012
1 parent 877c5b6 commit 569b191
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1e8b33328a5407b447ff80953655a47014a6dcb9
refs/heads/master: ab73857e354ab9e317613cba7db714e2c12c6547
8 changes: 5 additions & 3 deletions trunk/fs/direct-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ static int get_more_blocks(struct dio *dio, struct dio_submit *sdio,
sector_t fs_endblk; /* Into file, in filesystem-sized blocks */
unsigned long fs_count; /* Number of filesystem-sized blocks */
int create;
unsigned int i_blkbits = sdio->blkbits + sdio->blkfactor;

/*
* If there was a memory error and we've overwritten all the
Expand All @@ -554,7 +555,7 @@ static int get_more_blocks(struct dio *dio, struct dio_submit *sdio,
fs_count = fs_endblk - fs_startblk + 1;

map_bh->b_state = 0;
map_bh->b_size = fs_count << dio->inode->i_blkbits;
map_bh->b_size = fs_count << i_blkbits;

/*
* For writes inside i_size on a DIO_SKIP_HOLES filesystem we
Expand Down Expand Up @@ -1053,7 +1054,8 @@ do_blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
int seg;
size_t size;
unsigned long addr;
unsigned blkbits = inode->i_blkbits;
unsigned i_blkbits = ACCESS_ONCE(inode->i_blkbits);
unsigned blkbits = i_blkbits;
unsigned blocksize_mask = (1 << blkbits) - 1;
ssize_t retval = -EINVAL;
loff_t end = offset;
Expand Down Expand Up @@ -1149,7 +1151,7 @@ do_blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
dio->inode = inode;
dio->rw = rw;
sdio.blkbits = blkbits;
sdio.blkfactor = inode->i_blkbits - blkbits;
sdio.blkfactor = i_blkbits - blkbits;
sdio.block_in_file = offset >> blkbits;

sdio.get_block = get_block;
Expand Down

0 comments on commit 569b191

Please sign in to comment.