aboutsummaryrefslogtreecommitdiffstats
path: root/fs/libfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/libfs.c')
-rw-r--r--fs/libfs.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/fs/libfs.c b/fs/libfs.c
index 1b1156381787..3793aaa14577 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -149,10 +149,9 @@ int dcache_readdir(struct file * filp, void * dirent, filldir_t filldir)
149 /* fallthrough */ 149 /* fallthrough */
150 default: 150 default:
151 spin_lock(&dcache_lock); 151 spin_lock(&dcache_lock);
152 if (filp->f_pos == 2) { 152 if (filp->f_pos == 2)
153 list_del(q); 153 list_move(q, &dentry->d_subdirs);
154 list_add(q, &dentry->d_subdirs); 154
155 }
156 for (p=q->next; p != &dentry->d_subdirs; p=p->next) { 155 for (p=q->next; p != &dentry->d_subdirs; p=p->next) {
157 struct dentry *next; 156 struct dentry *next;
158 next = list_entry(p, struct dentry, d_u.d_child); 157 next = list_entry(p, struct dentry, d_u.d_child);
@@ -164,8 +163,7 @@ int dcache_readdir(struct file * filp, void * dirent, filldir_t filldir)
164 return 0; 163 return 0;
165 spin_lock(&dcache_lock); 164 spin_lock(&dcache_lock);
166 /* next is still alive */ 165 /* next is still alive */
167 list_del(q); 166 list_move(q, p);
168 list_add(q, p);
169 p = q; 167 p = q;
170 filp->f_pos++; 168 filp->f_pos++;
171 } 169 }
@@ -319,17 +317,9 @@ int simple_rename(struct inode *old_dir, struct dentry *old_dentry,
319 317
320int simple_readpage(struct file *file, struct page *page) 318int simple_readpage(struct file *file, struct page *page)
321{ 319{
322 void *kaddr; 320 clear_highpage(page);
323
324 if (PageUptodate(page))
325 goto out;
326
327 kaddr = kmap_atomic(page, KM_USER0);
328 memset(kaddr, 0, PAGE_CACHE_SIZE);
329 kunmap_atomic(kaddr, KM_USER0);
330 flush_dcache_page(page); 321 flush_dcache_page(page);
331 SetPageUptodate(page); 322 SetPageUptodate(page);
332out:
333 unlock_page(page); 323 unlock_page(page);
334 return 0; 324 return 0;
335} 325}
@@ -385,7 +375,6 @@ int simple_fill_super(struct super_block *s, int magic, struct tree_descr *files
385 return -ENOMEM; 375 return -ENOMEM;
386 inode->i_mode = S_IFDIR | 0755; 376 inode->i_mode = S_IFDIR | 0755;
387 inode->i_uid = inode->i_gid = 0; 377 inode->i_uid = inode->i_gid = 0;
388 inode->i_blksize = PAGE_CACHE_SIZE;
389 inode->i_blocks = 0; 378 inode->i_blocks = 0;
390 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 379 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
391 inode->i_op = &simple_dir_inode_operations; 380 inode->i_op = &simple_dir_inode_operations;
@@ -407,7 +396,6 @@ int simple_fill_super(struct super_block *s, int magic, struct tree_descr *files
407 goto out; 396 goto out;
408 inode->i_mode = S_IFREG | files->mode; 397 inode->i_mode = S_IFREG | files->mode;
409 inode->i_uid = inode->i_gid = 0; 398 inode->i_uid = inode->i_gid = 0;
410 inode->i_blksize = PAGE_CACHE_SIZE;
411 inode->i_blocks = 0; 399 inode->i_blocks = 0;
412 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 400 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
413 inode->i_fop = files->ops; 401 inode->i_fop = files->ops;
@@ -424,13 +412,13 @@ out:
424 412
425static DEFINE_SPINLOCK(pin_fs_lock); 413static DEFINE_SPINLOCK(pin_fs_lock);
426 414
427int simple_pin_fs(char *name, struct vfsmount **mount, int *count) 415int simple_pin_fs(struct file_system_type *type, struct vfsmount **mount, int *count)
428{ 416{
429 struct vfsmount *mnt = NULL; 417 struct vfsmount *mnt = NULL;
430 spin_lock(&pin_fs_lock); 418 spin_lock(&pin_fs_lock);
431 if (unlikely(!*mount)) { 419 if (unlikely(!*mount)) {
432 spin_unlock(&pin_fs_lock); 420 spin_unlock(&pin_fs_lock);
433 mnt = do_kern_mount(name, 0, name, NULL); 421 mnt = vfs_kern_mount(type, 0, type->name, NULL);
434 if (IS_ERR(mnt)) 422 if (IS_ERR(mnt))
435 return PTR_ERR(mnt); 423 return PTR_ERR(mnt);
436 spin_lock(&pin_fs_lock); 424 spin_lock(&pin_fs_lock);
@@ -549,7 +537,7 @@ int simple_attr_open(struct inode *inode, struct file *file,
549 537
550 attr->get = get; 538 attr->get = get;
551 attr->set = set; 539 attr->set = set;
552 attr->data = inode->u.generic_ip; 540 attr->data = inode->i_private;
553 attr->fmt = fmt; 541 attr->fmt = fmt;
554 mutex_init(&attr->mutex); 542 mutex_init(&attr->mutex);
555 543