Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 286748
b: refs/heads/master
c: 684a3ff
h: refs/heads/master
v: v3
  • Loading branch information
Li Wang authored and Tyler Hicks committed Jan 25, 2012
1 parent e4d8502 commit e33b64e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 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: 48399c0b0e6172888a2e2e36df1595ab1e049ba8
refs/heads/master: 684a3ff7e69acc7c678d1a1394fe9e757993fd34
4 changes: 2 additions & 2 deletions trunk/fs/ecryptfs/read_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@ int ecryptfs_write(struct inode *ecryptfs_inode, char *data, loff_t offset,
pgoff_t ecryptfs_page_idx = (pos >> PAGE_CACHE_SHIFT);
size_t start_offset_in_page = (pos & ~PAGE_CACHE_MASK);
size_t num_bytes = (PAGE_CACHE_SIZE - start_offset_in_page);
size_t total_remaining_bytes = ((offset + size) - pos);
loff_t total_remaining_bytes = ((offset + size) - pos);

if (num_bytes > total_remaining_bytes)
num_bytes = total_remaining_bytes;
if (pos < offset) {
/* remaining zeros to write, up to destination offset */
size_t total_remaining_zeros = (offset - pos);
loff_t total_remaining_zeros = (offset - pos);

if (num_bytes > total_remaining_zeros)
num_bytes = total_remaining_zeros;
Expand Down

0 comments on commit e33b64e

Please sign in to comment.