Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 373460
b: refs/heads/master
c: 1ac0fc8
h: refs/heads/master
v: v3
  • Loading branch information
Yan, Zheng authored and Sage Weil committed May 2, 2013
1 parent 5802ae4 commit f2a33b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 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: 03d254edebe51949a569c38df6b4b05b7f3c50f9
refs/heads/master: 1ac0fc8adfc725660ee53a953b06855f64f8e792
14 changes: 7 additions & 7 deletions trunk/fs/ceph/addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ static int ceph_writepages_start(struct address_space *mapping,
unsigned wsize = 1 << inode->i_blkbits;
struct ceph_osd_request *req = NULL;
int do_sync;
u64 snap_size = 0;
u64 snap_size;

/*
* Include a 'sync' in the OSD request if this is a data
Expand Down Expand Up @@ -717,13 +717,16 @@ static int ceph_writepages_start(struct address_space *mapping,
retry:
/* find oldest snap context with dirty data */
ceph_put_snap_context(snapc);
snap_size = 0;
snapc = get_oldest_context(inode, &snap_size);
if (!snapc) {
/* hmm, why does writepages get called when there
is no dirty data? */
dout(" no snap context with dirty data?\n");
goto out;
}
if (snap_size == 0)
snap_size = i_size_read(inode);
dout(" oldest snapc is %p seq %lld (%d snaps)\n",
snapc, snapc->seq, snapc->num_snaps);
if (last_snapc && snapc != last_snapc) {
Expand Down Expand Up @@ -795,11 +798,8 @@ static int ceph_writepages_start(struct address_space *mapping,
dout("waiting on writeback %p\n", page);
wait_on_page_writeback(page);
}
if ((snap_size && page_offset(page) > snap_size) ||
(!snap_size &&
page_offset(page) > i_size_read(inode))) {
dout("%p page eof %llu\n", page, snap_size ?
snap_size : i_size_read(inode));
if (page_offset(page) >= snap_size) {
dout("%p page eof %llu\n", page, snap_size);
done = 1;
unlock_page(page);
break;
Expand Down Expand Up @@ -911,7 +911,7 @@ static int ceph_writepages_start(struct address_space *mapping,
/* Format the osd request message and submit the write */

offset = page_offset(pages[0]);
len = min((snap_size ? snap_size : i_size_read(inode)) - offset,
len = min(snap_size - offset,
(u64)locked_pages << PAGE_CACHE_SHIFT);
dout("writepages got %d pages at %llu~%llu\n",
locked_pages, offset, len);
Expand Down

0 comments on commit f2a33b1

Please sign in to comment.