diff options
Diffstat (limited to 'fs/ntfs/aops.c')
-rw-r--r-- | fs/ntfs/aops.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/ntfs/aops.c b/fs/ntfs/aops.c index 6241c4cfbe28..24c46c200337 100644 --- a/fs/ntfs/aops.c +++ b/fs/ntfs/aops.c | |||
@@ -825,17 +825,15 @@ static int ntfs_write_mst_block(struct page *page, | |||
825 | ntfs_inode *ni = NTFS_I(vi); | 825 | ntfs_inode *ni = NTFS_I(vi); |
826 | ntfs_volume *vol = ni->vol; | 826 | ntfs_volume *vol = ni->vol; |
827 | u8 *kaddr; | 827 | u8 *kaddr; |
828 | unsigned char bh_size_bits = vi->i_blkbits; | ||
829 | unsigned int bh_size = 1 << bh_size_bits; | ||
830 | unsigned int rec_size = ni->itype.index.block_size; | 828 | unsigned int rec_size = ni->itype.index.block_size; |
831 | ntfs_inode *locked_nis[PAGE_CACHE_SIZE / rec_size]; | 829 | ntfs_inode *locked_nis[PAGE_CACHE_SIZE / rec_size]; |
832 | struct buffer_head *bh, *head, *tbh, *rec_start_bh; | 830 | struct buffer_head *bh, *head, *tbh, *rec_start_bh; |
833 | int max_bhs = PAGE_CACHE_SIZE / bh_size; | 831 | struct buffer_head *bhs[MAX_BUF_PER_PAGE]; |
834 | struct buffer_head *bhs[max_bhs]; | ||
835 | runlist_element *rl; | 832 | runlist_element *rl; |
836 | int i, nr_locked_nis, nr_recs, nr_bhs, bhs_per_rec, err, err2; | 833 | int i, nr_locked_nis, nr_recs, nr_bhs, max_bhs, bhs_per_rec, err, err2; |
837 | unsigned rec_size_bits; | 834 | unsigned bh_size, rec_size_bits; |
838 | BOOL sync, is_mft, page_is_dirty, rec_is_dirty; | 835 | BOOL sync, is_mft, page_is_dirty, rec_is_dirty; |
836 | unsigned char bh_size_bits; | ||
839 | 837 | ||
840 | ntfs_debug("Entering for inode 0x%lx, attribute type 0x%x, page index " | 838 | ntfs_debug("Entering for inode 0x%lx, attribute type 0x%x, page index " |
841 | "0x%lx.", vi->i_ino, ni->type, page->index); | 839 | "0x%lx.", vi->i_ino, ni->type, page->index); |
@@ -850,7 +848,11 @@ static int ntfs_write_mst_block(struct page *page, | |||
850 | */ | 848 | */ |
851 | BUG_ON(!(is_mft || S_ISDIR(vi->i_mode) || | 849 | BUG_ON(!(is_mft || S_ISDIR(vi->i_mode) || |
852 | (NInoAttr(ni) && ni->type == AT_INDEX_ALLOCATION))); | 850 | (NInoAttr(ni) && ni->type == AT_INDEX_ALLOCATION))); |
851 | bh_size_bits = vi->i_blkbits; | ||
852 | bh_size = 1 << bh_size_bits; | ||
853 | max_bhs = PAGE_CACHE_SIZE / bh_size; | ||
853 | BUG_ON(!max_bhs); | 854 | BUG_ON(!max_bhs); |
855 | BUG_ON(max_bhs > MAX_BUF_PER_PAGE); | ||
854 | 856 | ||
855 | /* Were we called for sync purposes? */ | 857 | /* Were we called for sync purposes? */ |
856 | sync = (wbc->sync_mode == WB_SYNC_ALL); | 858 | sync = (wbc->sync_mode == WB_SYNC_ALL); |