aboutsummaryrefslogtreecommitdiffstats
path: root/fs/libfs.c
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2006-06-29 16:01:54 -0400
committerDave Jones <davej@redhat.com>2006-06-29 16:01:54 -0400
commit55b4d6a52195a8f277ffddf755ddaff359878f41 (patch)
tree06a3183a562f8da4688f65023f7a18dcad702956 /fs/libfs.c
parentadf8a287150667feb5747f8beade62acacc17d4e (diff)
parent1f1332f727c3229eb2166a83fec5d3de6a73dce2 (diff)
Merge ../linus
Conflicts: drivers/char/agp/Kconfig
Diffstat (limited to 'fs/libfs.c')
-rw-r--r--fs/libfs.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/fs/libfs.c b/fs/libfs.c
index 7145ba7a48d0..ac02ea602c3d 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -20,9 +20,9 @@ int simple_getattr(struct vfsmount *mnt, struct dentry *dentry,
20 return 0; 20 return 0;
21} 21}
22 22
23int simple_statfs(struct super_block *sb, struct kstatfs *buf) 23int simple_statfs(struct dentry *dentry, struct kstatfs *buf)
24{ 24{
25 buf->f_type = sb->s_magic; 25 buf->f_type = dentry->d_sb->s_magic;
26 buf->f_bsize = PAGE_CACHE_SIZE; 26 buf->f_bsize = PAGE_CACHE_SIZE;
27 buf->f_namelen = NAME_MAX; 27 buf->f_namelen = NAME_MAX;
28 return 0; 28 return 0;
@@ -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 }
@@ -196,9 +194,9 @@ struct inode_operations simple_dir_inode_operations = {
196 * Common helper for pseudo-filesystems (sockfs, pipefs, bdev - stuff that 194 * Common helper for pseudo-filesystems (sockfs, pipefs, bdev - stuff that
197 * will never be mountable) 195 * will never be mountable)
198 */ 196 */
199struct super_block * 197int get_sb_pseudo(struct file_system_type *fs_type, char *name,
200get_sb_pseudo(struct file_system_type *fs_type, char *name, 198 struct super_operations *ops, unsigned long magic,
201 struct super_operations *ops, unsigned long magic) 199 struct vfsmount *mnt)
202{ 200{
203 struct super_block *s = sget(fs_type, NULL, set_anon_super, NULL); 201 struct super_block *s = sget(fs_type, NULL, set_anon_super, NULL);
204 static struct super_operations default_ops = {.statfs = simple_statfs}; 202 static struct super_operations default_ops = {.statfs = simple_statfs};
@@ -207,7 +205,7 @@ get_sb_pseudo(struct file_system_type *fs_type, char *name,
207 struct qstr d_name = {.name = name, .len = strlen(name)}; 205 struct qstr d_name = {.name = name, .len = strlen(name)};
208 206
209 if (IS_ERR(s)) 207 if (IS_ERR(s))
210 return s; 208 return PTR_ERR(s);
211 209
212 s->s_flags = MS_NOUSER; 210 s->s_flags = MS_NOUSER;
213 s->s_maxbytes = ~0ULL; 211 s->s_maxbytes = ~0ULL;
@@ -232,12 +230,12 @@ get_sb_pseudo(struct file_system_type *fs_type, char *name,
232 d_instantiate(dentry, root); 230 d_instantiate(dentry, root);
233 s->s_root = dentry; 231 s->s_root = dentry;
234 s->s_flags |= MS_ACTIVE; 232 s->s_flags |= MS_ACTIVE;
235 return s; 233 return simple_set_mnt(mnt, s);
236 234
237Enomem: 235Enomem:
238 up_write(&s->s_umount); 236 up_write(&s->s_umount);
239 deactivate_super(s); 237 deactivate_super(s);
240 return ERR_PTR(-ENOMEM); 238 return -ENOMEM;
241} 239}
242 240
243int simple_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry) 241int simple_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry)
@@ -424,13 +422,13 @@ out:
424 422
425static DEFINE_SPINLOCK(pin_fs_lock); 423static DEFINE_SPINLOCK(pin_fs_lock);
426 424
427int simple_pin_fs(char *name, struct vfsmount **mount, int *count) 425int simple_pin_fs(struct file_system_type *type, struct vfsmount **mount, int *count)
428{ 426{
429 struct vfsmount *mnt = NULL; 427 struct vfsmount *mnt = NULL;
430 spin_lock(&pin_fs_lock); 428 spin_lock(&pin_fs_lock);
431 if (unlikely(!*mount)) { 429 if (unlikely(!*mount)) {
432 spin_unlock(&pin_fs_lock); 430 spin_unlock(&pin_fs_lock);
433 mnt = do_kern_mount(name, 0, name, NULL); 431 mnt = vfs_kern_mount(type, 0, type->name, NULL);
434 if (IS_ERR(mnt)) 432 if (IS_ERR(mnt))
435 return PTR_ERR(mnt); 433 return PTR_ERR(mnt);
436 spin_lock(&pin_fs_lock); 434 spin_lock(&pin_fs_lock);