aboutsummaryrefslogtreecommitdiffstats
path: root/fs/libfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/libfs.c')
-rw-r--r--fs/libfs.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/libfs.c b/fs/libfs.c
index 0ca80b2af420..f3fa82ce9b70 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -25,7 +25,7 @@ int simple_getattr(struct vfsmount *mnt, struct dentry *dentry,
25{ 25{
26 struct inode *inode = d_inode(dentry); 26 struct inode *inode = d_inode(dentry);
27 generic_fillattr(inode, stat); 27 generic_fillattr(inode, stat);
28 stat->blocks = inode->i_mapping->nrpages << (PAGE_CACHE_SHIFT - 9); 28 stat->blocks = inode->i_mapping->nrpages << (PAGE_SHIFT - 9);
29 return 0; 29 return 0;
30} 30}
31EXPORT_SYMBOL(simple_getattr); 31EXPORT_SYMBOL(simple_getattr);
@@ -33,7 +33,7 @@ EXPORT_SYMBOL(simple_getattr);
33int simple_statfs(struct dentry *dentry, struct kstatfs *buf) 33int simple_statfs(struct dentry *dentry, struct kstatfs *buf)
34{ 34{
35 buf->f_type = dentry->d_sb->s_magic; 35 buf->f_type = dentry->d_sb->s_magic;
36 buf->f_bsize = PAGE_CACHE_SIZE; 36 buf->f_bsize = PAGE_SIZE;
37 buf->f_namelen = NAME_MAX; 37 buf->f_namelen = NAME_MAX;
38 return 0; 38 return 0;
39} 39}
@@ -395,7 +395,7 @@ int simple_write_begin(struct file *file, struct address_space *mapping,
395 struct page *page; 395 struct page *page;
396 pgoff_t index; 396 pgoff_t index;
397 397
398 index = pos >> PAGE_CACHE_SHIFT; 398 index = pos >> PAGE_SHIFT;
399 399
400 page = grab_cache_page_write_begin(mapping, index, flags); 400 page = grab_cache_page_write_begin(mapping, index, flags);
401 if (!page) 401 if (!page)
@@ -403,10 +403,10 @@ int simple_write_begin(struct file *file, struct address_space *mapping,
403 403
404 *pagep = page; 404 *pagep = page;
405 405
406 if (!PageUptodate(page) && (len != PAGE_CACHE_SIZE)) { 406 if (!PageUptodate(page) && (len != PAGE_SIZE)) {
407 unsigned from = pos & (PAGE_CACHE_SIZE - 1); 407 unsigned from = pos & (PAGE_SIZE - 1);
408 408
409 zero_user_segments(page, 0, from, from + len, PAGE_CACHE_SIZE); 409 zero_user_segments(page, 0, from, from + len, PAGE_SIZE);
410 } 410 }
411 return 0; 411 return 0;
412} 412}
@@ -442,7 +442,7 @@ int simple_write_end(struct file *file, struct address_space *mapping,
442 442
443 /* zero the stale part of the page if we did a short copy */ 443 /* zero the stale part of the page if we did a short copy */
444 if (copied < len) { 444 if (copied < len) {
445 unsigned from = pos & (PAGE_CACHE_SIZE - 1); 445 unsigned from = pos & (PAGE_SIZE - 1);
446 446
447 zero_user(page, from + copied, len - copied); 447 zero_user(page, from + copied, len - copied);
448 } 448 }
@@ -458,7 +458,7 @@ int simple_write_end(struct file *file, struct address_space *mapping,
458 458
459 set_page_dirty(page); 459 set_page_dirty(page);
460 unlock_page(page); 460 unlock_page(page);
461 page_cache_release(page); 461 put_page(page);
462 462
463 return copied; 463 return copied;
464} 464}
@@ -477,8 +477,8 @@ int simple_fill_super(struct super_block *s, unsigned long magic,
477 struct dentry *dentry; 477 struct dentry *dentry;
478 int i; 478 int i;
479 479
480 s->s_blocksize = PAGE_CACHE_SIZE; 480 s->s_blocksize = PAGE_SIZE;
481 s->s_blocksize_bits = PAGE_CACHE_SHIFT; 481 s->s_blocksize_bits = PAGE_SHIFT;
482 s->s_magic = magic; 482 s->s_magic = magic;
483 s->s_op = &simple_super_operations; 483 s->s_op = &simple_super_operations;
484 s->s_time_gran = 1; 484 s->s_time_gran = 1;
@@ -994,12 +994,12 @@ int generic_check_addressable(unsigned blocksize_bits, u64 num_blocks)
994{ 994{
995 u64 last_fs_block = num_blocks - 1; 995 u64 last_fs_block = num_blocks - 1;
996 u64 last_fs_page = 996 u64 last_fs_page =
997 last_fs_block >> (PAGE_CACHE_SHIFT - blocksize_bits); 997 last_fs_block >> (PAGE_SHIFT - blocksize_bits);
998 998
999 if (unlikely(num_blocks == 0)) 999 if (unlikely(num_blocks == 0))
1000 return 0; 1000 return 0;
1001 1001
1002 if ((blocksize_bits < 9) || (blocksize_bits > PAGE_CACHE_SHIFT)) 1002 if ((blocksize_bits < 9) || (blocksize_bits > PAGE_SHIFT))
1003 return -EINVAL; 1003 return -EINVAL;
1004 1004
1005 if ((last_fs_block > (sector_t)(~0ULL) >> (blocksize_bits - 9)) || 1005 if ((last_fs_block > (sector_t)(~0ULL) >> (blocksize_bits - 9)) ||