Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 201749
b: refs/heads/master
c: f2bde9b
h: refs/heads/master
i:
  201747: fa62491
v: v3
  • Loading branch information
Christoph Hellwig authored and Alex Elder committed Jul 26, 2010
1 parent 86ccf36 commit f712410
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 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: 3070451eea1ed8e3bde0573183c7d8ac25fd5e97
refs/heads/master: f2bde9b89b4d67c9bc3b963cb996f449ddcd27a4
17 changes: 9 additions & 8 deletions trunk/fs/xfs/linux-2.6/xfs_aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -1295,9 +1295,9 @@ __xfs_get_blocks(
sector_t iblock,
struct buffer_head *bh_result,
int create,
int direct,
bmapi_flags_t flags)
int direct)
{
int flags = create ? BMAPI_WRITE : BMAPI_READ;
struct xfs_bmbt_irec imap;
xfs_off_t offset;
ssize_t size;
Expand All @@ -1312,8 +1312,11 @@ __xfs_get_blocks(
if (!create && direct && offset >= i_size_read(inode))
return 0;

error = xfs_iomap(XFS_I(inode), offset, size,
create ? flags : BMAPI_READ, &imap, &nimap, &new);
if (direct && create)
flags |= BMAPI_DIRECT;

error = xfs_iomap(XFS_I(inode), offset, size, flags, &imap, &nimap,
&new);
if (error)
return -error;
if (nimap == 0)
Expand Down Expand Up @@ -1393,8 +1396,7 @@ xfs_get_blocks(
struct buffer_head *bh_result,
int create)
{
return __xfs_get_blocks(inode, iblock,
bh_result, create, 0, BMAPI_WRITE);
return __xfs_get_blocks(inode, iblock, bh_result, create, 0);
}

STATIC int
Expand All @@ -1404,8 +1406,7 @@ xfs_get_blocks_direct(
struct buffer_head *bh_result,
int create)
{
return __xfs_get_blocks(inode, iblock,
bh_result, create, 1, BMAPI_WRITE|BMAPI_DIRECT);
return __xfs_get_blocks(inode, iblock, bh_result, create, 1);
}

STATIC void
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/xfs/xfs_iomap.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ xfs_iomap(
break;
}

if (flags & (BMAPI_DIRECT|BMAPI_MMAP)) {
if (flags & BMAPI_DIRECT) {
error = xfs_iomap_write_direct(ip, offset, count, flags,
imap, nimaps);
} else {
Expand Down
2 changes: 0 additions & 2 deletions trunk/fs/xfs/xfs_iomap.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ typedef enum {
/* modifiers */
BMAPI_IGNSTATE = (1 << 4), /* ignore unwritten state on read */
BMAPI_DIRECT = (1 << 5), /* direct instead of buffered write */
BMAPI_MMAP = (1 << 6), /* allocate for mmap write */
BMAPI_TRYLOCK = (1 << 7), /* non-blocking request */
} bmapi_flags_t;

Expand All @@ -36,7 +35,6 @@ typedef enum {
{ BMAPI_ALLOCATE, "ALLOCATE" }, \
{ BMAPI_IGNSTATE, "IGNSTATE" }, \
{ BMAPI_DIRECT, "DIRECT" }, \
{ BMAPI_MMAP, "MMAP" }, \
{ BMAPI_TRYLOCK, "TRYLOCK" }

struct xfs_inode;
Expand Down

0 comments on commit f712410

Please sign in to comment.