diff options
Diffstat (limited to 'fs/ntfs/aops.c')
| -rw-r--r-- | fs/ntfs/aops.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/fs/ntfs/aops.c b/fs/ntfs/aops.c index 78adad7a988d..f3ad36d8b8c9 100644 --- a/fs/ntfs/aops.c +++ b/fs/ntfs/aops.c | |||
| @@ -670,6 +670,27 @@ lock_retry_remap: | |||
| 670 | } | 670 | } |
| 671 | /* It is a hole, need to instantiate it. */ | 671 | /* It is a hole, need to instantiate it. */ |
| 672 | if (lcn == LCN_HOLE) { | 672 | if (lcn == LCN_HOLE) { |
| 673 | u8 *kaddr; | ||
| 674 | unsigned long *bpos, *bend; | ||
| 675 | |||
| 676 | /* Check if the buffer is zero. */ | ||
| 677 | kaddr = kmap_atomic(page, KM_USER0); | ||
| 678 | bpos = (unsigned long *)(kaddr + bh_offset(bh)); | ||
| 679 | bend = (unsigned long *)((u8*)bpos + blocksize); | ||
| 680 | do { | ||
| 681 | if (unlikely(*bpos)) | ||
| 682 | break; | ||
| 683 | } while (likely(++bpos < bend)); | ||
| 684 | kunmap_atomic(kaddr, KM_USER0); | ||
| 685 | if (bpos == bend) { | ||
| 686 | /* | ||
| 687 | * Buffer is zero and sparse, no need to write | ||
| 688 | * it. | ||
| 689 | */ | ||
| 690 | bh->b_blocknr = -1; | ||
| 691 | clear_buffer_dirty(bh); | ||
| 692 | continue; | ||
| 693 | } | ||
| 673 | // TODO: Instantiate the hole. | 694 | // TODO: Instantiate the hole. |
| 674 | // clear_buffer_new(bh); | 695 | // clear_buffer_new(bh); |
| 675 | // unmap_underlying_metadata(bh->b_bdev, bh->b_blocknr); | 696 | // unmap_underlying_metadata(bh->b_bdev, bh->b_blocknr); |
