Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 346718
b: refs/heads/master
c: 797f427
h: refs/heads/master
v: v3
  • Loading branch information
Miao Xie authored and Chris Mason committed Dec 17, 2012
1 parent 8fc3fe8 commit e8c99b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 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: af1be4f851db4f4975f0139211a6561776ef37c0
refs/heads/master: 797f4277113bff142b6c64a55abaef64d7d67d5c
8 changes: 4 additions & 4 deletions trunk/fs/btrfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -2054,12 +2054,12 @@ static long btrfs_fallocate(struct file *file, int mode,
u64 alloc_end;
u64 alloc_hint = 0;
u64 locked_end;
u64 mask = BTRFS_I(inode)->root->sectorsize - 1;
struct extent_map *em;
int blocksize = BTRFS_I(inode)->root->sectorsize;
int ret;

alloc_start = offset & ~mask;
alloc_end = (offset + len + mask) & ~mask;
alloc_start = round_down(offset, blocksize);
alloc_end = round_up(offset + len, blocksize);

/* Make sure we aren't being give some crap mode */
if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))
Expand Down Expand Up @@ -2140,7 +2140,7 @@ static long btrfs_fallocate(struct file *file, int mode,
}
last_byte = min(extent_map_end(em), alloc_end);
actual_end = min_t(u64, extent_map_end(em), offset + len);
last_byte = (last_byte + mask) & ~mask;
last_byte = ALIGN(last_byte, blocksize);

if (em->block_start == EXTENT_MAP_HOLE ||
(cur_offset >= inode->i_size &&
Expand Down

0 comments on commit e8c99b5

Please sign in to comment.