Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7771
b: refs/heads/master
c: 8dcdeba
h: refs/heads/master
i:
  7769: fde31c8
  7767: b5158bf
v: v3
  • Loading branch information
Anton Altaparmakov committed Sep 8, 2005
1 parent bf9284e commit be04979
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 67bb103725e4cde322cb4ddb160a12933c5c7072
refs/heads/master: 8dcdebafb848415eae25924b00c4f0b9ec907da0
2 changes: 2 additions & 0 deletions trunk/fs/ntfs/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ ToDo/Notes:
updating the times in the inode in ntfs_setattr().
- Fixup handling of sparse, compressed, and encrypted attributes in
fs/ntfs/inode.c::ntfs_read_locked_{,attr_,index_}inode().
- Make ntfs_write_block() not instantiate sparse blocks if they contain
only zeroes.

2.1.23 - Implement extension of resident files and make writing safe as well as
many bug fixes, cleanups, and enhancements...
Expand Down
21 changes: 21 additions & 0 deletions trunk/fs/ntfs/aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,27 @@ static int ntfs_write_block(struct page *page, struct writeback_control *wbc)
}
/* It is a hole, need to instantiate it. */
if (lcn == LCN_HOLE) {
u8 *kaddr;
unsigned long *bpos, *bend;

/* Check if the buffer is zero. */
kaddr = kmap_atomic(page, KM_USER0);
bpos = (unsigned long *)(kaddr + bh_offset(bh));
bend = (unsigned long *)((u8*)bpos + blocksize);
do {
if (unlikely(*bpos))
break;
} while (likely(++bpos < bend));
kunmap_atomic(kaddr, KM_USER0);
if (bpos == bend) {
/*
* Buffer is zero and sparse, no need to write
* it.
*/
bh->b_blocknr = -1;
clear_buffer_dirty(bh);
continue;
}
// TODO: Instantiate the hole.
// clear_buffer_new(bh);
// unmap_underlying_metadata(bh->b_bdev, bh->b_blocknr);
Expand Down

0 comments on commit be04979

Please sign in to comment.