diff options
Diffstat (limited to 'fs/reiserfs/inode.c')
-rw-r--r-- | fs/reiserfs/inode.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index 145c2d3e5e01..55fce92cdf18 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c | |||
@@ -1782,6 +1782,12 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, | |||
1782 | goto out_bad_inode; | 1782 | goto out_bad_inode; |
1783 | } | 1783 | } |
1784 | args.objectid = inode->i_ino = le32_to_cpu(ih.ih_key.k_objectid); | 1784 | args.objectid = inode->i_ino = le32_to_cpu(ih.ih_key.k_objectid); |
1785 | if (old_format_only(sb)) | ||
1786 | make_le_item_head(&ih, NULL, KEY_FORMAT_3_5, SD_OFFSET, | ||
1787 | TYPE_STAT_DATA, SD_V1_SIZE, MAX_US_INT); | ||
1788 | else | ||
1789 | make_le_item_head(&ih, NULL, KEY_FORMAT_3_6, SD_OFFSET, | ||
1790 | TYPE_STAT_DATA, SD_SIZE, MAX_US_INT); | ||
1785 | memcpy(INODE_PKEY(inode), &(ih.ih_key), KEY_SIZE); | 1791 | memcpy(INODE_PKEY(inode), &(ih.ih_key), KEY_SIZE); |
1786 | args.dirid = le32_to_cpu(ih.ih_key.k_dir_id); | 1792 | args.dirid = le32_to_cpu(ih.ih_key.k_dir_id); |
1787 | if (insert_inode_locked4(inode, args.objectid, | 1793 | if (insert_inode_locked4(inode, args.objectid, |
@@ -1834,13 +1840,6 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, | |||
1834 | reiserfs_init_acl_default(inode); | 1840 | reiserfs_init_acl_default(inode); |
1835 | reiserfs_init_xattr_rwsem(inode); | 1841 | reiserfs_init_xattr_rwsem(inode); |
1836 | 1842 | ||
1837 | if (old_format_only(sb)) | ||
1838 | make_le_item_head(&ih, NULL, KEY_FORMAT_3_5, SD_OFFSET, | ||
1839 | TYPE_STAT_DATA, SD_V1_SIZE, MAX_US_INT); | ||
1840 | else | ||
1841 | make_le_item_head(&ih, NULL, KEY_FORMAT_3_6, SD_OFFSET, | ||
1842 | TYPE_STAT_DATA, SD_SIZE, MAX_US_INT); | ||
1843 | |||
1844 | /* key to search for correct place for new stat data */ | 1843 | /* key to search for correct place for new stat data */ |
1845 | _make_cpu_key(&key, KEY_FORMAT_3_6, le32_to_cpu(ih.ih_key.k_dir_id), | 1844 | _make_cpu_key(&key, KEY_FORMAT_3_6, le32_to_cpu(ih.ih_key.k_dir_id), |
1846 | le32_to_cpu(ih.ih_key.k_objectid), SD_OFFSET, | 1845 | le32_to_cpu(ih.ih_key.k_objectid), SD_OFFSET, |
@@ -2561,7 +2560,7 @@ static int reiserfs_write_begin(struct file *file, | |||
2561 | } | 2560 | } |
2562 | 2561 | ||
2563 | index = pos >> PAGE_CACHE_SHIFT; | 2562 | index = pos >> PAGE_CACHE_SHIFT; |
2564 | page = __grab_cache_page(mapping, index); | 2563 | page = grab_cache_page_write_begin(mapping, index, flags); |
2565 | if (!page) | 2564 | if (!page) |
2566 | return -ENOMEM; | 2565 | return -ENOMEM; |
2567 | *pagep = page; | 2566 | *pagep = page; |