diff options
-rw-r--r-- | fs/reiserfs/xattr.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c index 59b0850e885f..132d901da08f 100644 --- a/fs/reiserfs/xattr.c +++ b/fs/reiserfs/xattr.c | |||
@@ -376,14 +376,14 @@ static inline void reiserfs_put_page(struct page *page) | |||
376 | page_cache_release(page); | 376 | page_cache_release(page); |
377 | } | 377 | } |
378 | 378 | ||
379 | static struct page *reiserfs_get_page(struct inode *dir, unsigned long n) | 379 | static struct page *reiserfs_get_page(struct inode *dir, size_t n) |
380 | { | 380 | { |
381 | struct address_space *mapping = dir->i_mapping; | 381 | struct address_space *mapping = dir->i_mapping; |
382 | struct page *page; | 382 | struct page *page; |
383 | /* We can deadlock if we try to free dentries, | 383 | /* We can deadlock if we try to free dentries, |
384 | and an unlink/rmdir has just occured - GFP_NOFS avoids this */ | 384 | and an unlink/rmdir has just occured - GFP_NOFS avoids this */ |
385 | mapping_set_gfp_mask(mapping, GFP_NOFS); | 385 | mapping_set_gfp_mask(mapping, GFP_NOFS); |
386 | page = read_mapping_page(mapping, n, NULL); | 386 | page = read_mapping_page(mapping, n >> PAGE_CACHE_SHIFT, NULL); |
387 | if (!IS_ERR(page)) { | 387 | if (!IS_ERR(page)) { |
388 | kmap(page); | 388 | kmap(page); |
389 | if (PageError(page)) | 389 | if (PageError(page)) |
@@ -470,8 +470,7 @@ reiserfs_xattr_set(struct inode *inode, const char *name, const void *buffer, | |||
470 | else | 470 | else |
471 | chunk = buffer_size - buffer_pos; | 471 | chunk = buffer_size - buffer_pos; |
472 | 472 | ||
473 | page = reiserfs_get_page(dentry->d_inode, | 473 | page = reiserfs_get_page(dentry->d_inode, file_pos); |
474 | file_pos >> PAGE_CACHE_SHIFT); | ||
475 | if (IS_ERR(page)) { | 474 | if (IS_ERR(page)) { |
476 | err = PTR_ERR(page); | 475 | err = PTR_ERR(page); |
477 | goto out_filp; | 476 | goto out_filp; |
@@ -577,8 +576,7 @@ reiserfs_xattr_get(const struct inode *inode, const char *name, void *buffer, | |||
577 | else | 576 | else |
578 | chunk = isize - file_pos; | 577 | chunk = isize - file_pos; |
579 | 578 | ||
580 | page = reiserfs_get_page(dentry->d_inode, | 579 | page = reiserfs_get_page(dentry->d_inode, file_pos); |
581 | file_pos >> PAGE_CACHE_SHIFT); | ||
582 | if (IS_ERR(page)) { | 580 | if (IS_ERR(page)) { |
583 | err = PTR_ERR(page); | 581 | err = PTR_ERR(page); |
584 | goto out_dput; | 582 | goto out_dput; |