Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 188698
b: refs/heads/master
c: 972f0d3
h: refs/heads/master
v: v3
  • Loading branch information
Yehuda Sadeh authored and Sage Weil committed Feb 11, 2010
1 parent 78b76d7 commit 3ba8fc0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 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: 02f90c61096ec3ad691e808a4aa7ca5a06e550ec
refs/heads/master: 972f0d3ab1a15cb5d790dd8c53903066084b28f2
18 changes: 9 additions & 9 deletions trunk/fs/ceph/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,23 +395,22 @@ static void zero_page_vector_range(int off, int len, struct page **pages)
{
int i = off >> PAGE_CACHE_SHIFT;

off &= ~PAGE_CACHE_MASK;

dout("zero_page_vector_page %u~%u\n", off, len);
BUG_ON(len < PAGE_CACHE_SIZE);

/* leading partial page? */
if (off & ~PAGE_CACHE_MASK) {
if (off) {
int end = min((int)PAGE_CACHE_SIZE, off + len);
dout("zeroing %d %p head from %d\n", i, pages[i],
(int)(off & ~PAGE_CACHE_MASK));
zero_user_segment(pages[i], off & ~PAGE_CACHE_MASK,
PAGE_CACHE_SIZE);
off += PAGE_CACHE_SIZE;
off &= PAGE_CACHE_MASK;
(int)off);
zero_user_segment(pages[i], off, end);
len -= (end - off);
i++;
}
while (len >= PAGE_CACHE_SIZE) {
dout("zeroing %d %p\n", i, pages[i]);
zero_user_segment(pages[i], 0, PAGE_CACHE_SIZE);
off += PAGE_CACHE_SIZE;
len -= PAGE_CACHE_SIZE;
i++;
}
Expand All @@ -437,7 +436,7 @@ static int striped_read(struct inode *inode,
struct ceph_client *client = ceph_inode_to_client(inode);
struct ceph_inode_info *ci = ceph_inode(inode);
u64 pos, this_len;
int page_off = off & ~PAGE_CACHE_SIZE; /* first byte's offset in page */
int page_off = off & ~PAGE_CACHE_MASK; /* first byte's offset in page */
int left, pages_left;
int read;
struct page **page_pos;
Expand Down Expand Up @@ -493,6 +492,7 @@ static int striped_read(struct inode *inode,
dout("zero tail\n");
zero_page_vector_range(page_off + read, len - read,
pages);
read = len;
goto out;
}

Expand Down

0 comments on commit 3ba8fc0

Please sign in to comment.