diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /fs/jffs2/dir.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'fs/jffs2/dir.c')
-rw-r--r-- | fs/jffs2/dir.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c index ed78a3cf3cb0..4bca6a2e5c07 100644 --- a/fs/jffs2/dir.c +++ b/fs/jffs2/dir.c | |||
@@ -75,7 +75,6 @@ static struct dentry *jffs2_lookup(struct inode *dir_i, struct dentry *target, | |||
75 | struct nameidata *nd) | 75 | struct nameidata *nd) |
76 | { | 76 | { |
77 | struct jffs2_inode_info *dir_f; | 77 | struct jffs2_inode_info *dir_f; |
78 | struct jffs2_sb_info *c; | ||
79 | struct jffs2_full_dirent *fd = NULL, *fd_list; | 78 | struct jffs2_full_dirent *fd = NULL, *fd_list; |
80 | uint32_t ino = 0; | 79 | uint32_t ino = 0; |
81 | struct inode *inode = NULL; | 80 | struct inode *inode = NULL; |
@@ -86,7 +85,6 @@ static struct dentry *jffs2_lookup(struct inode *dir_i, struct dentry *target, | |||
86 | return ERR_PTR(-ENAMETOOLONG); | 85 | return ERR_PTR(-ENAMETOOLONG); |
87 | 86 | ||
88 | dir_f = JFFS2_INODE_INFO(dir_i); | 87 | dir_f = JFFS2_INODE_INFO(dir_i); |
89 | c = JFFS2_SB_INFO(dir_i->i_sb); | ||
90 | 88 | ||
91 | mutex_lock(&dir_f->sem); | 89 | mutex_lock(&dir_f->sem); |
92 | 90 | ||
@@ -119,7 +117,6 @@ static struct dentry *jffs2_lookup(struct inode *dir_i, struct dentry *target, | |||
119 | static int jffs2_readdir(struct file *filp, void *dirent, filldir_t filldir) | 117 | static int jffs2_readdir(struct file *filp, void *dirent, filldir_t filldir) |
120 | { | 118 | { |
121 | struct jffs2_inode_info *f; | 119 | struct jffs2_inode_info *f; |
122 | struct jffs2_sb_info *c; | ||
123 | struct inode *inode = filp->f_path.dentry->d_inode; | 120 | struct inode *inode = filp->f_path.dentry->d_inode; |
124 | struct jffs2_full_dirent *fd; | 121 | struct jffs2_full_dirent *fd; |
125 | unsigned long offset, curofs; | 122 | unsigned long offset, curofs; |
@@ -127,7 +124,6 @@ static int jffs2_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
127 | D1(printk(KERN_DEBUG "jffs2_readdir() for dir_i #%lu\n", filp->f_path.dentry->d_inode->i_ino)); | 124 | D1(printk(KERN_DEBUG "jffs2_readdir() for dir_i #%lu\n", filp->f_path.dentry->d_inode->i_ino)); |
128 | 125 | ||
129 | f = JFFS2_INODE_INFO(inode); | 126 | f = JFFS2_INODE_INFO(inode); |
130 | c = JFFS2_SB_INFO(inode->i_sb); | ||
131 | 127 | ||
132 | offset = filp->f_pos; | 128 | offset = filp->f_pos; |
133 | 129 | ||
@@ -215,8 +211,7 @@ static int jffs2_create(struct inode *dir_i, struct dentry *dentry, int mode, | |||
215 | no chance of AB-BA deadlock involving its f->sem). */ | 211 | no chance of AB-BA deadlock involving its f->sem). */ |
216 | mutex_unlock(&f->sem); | 212 | mutex_unlock(&f->sem); |
217 | 213 | ||
218 | ret = jffs2_do_create(c, dir_f, f, ri, | 214 | ret = jffs2_do_create(c, dir_f, f, ri, &dentry->d_name); |
219 | dentry->d_name.name, dentry->d_name.len); | ||
220 | if (ret) | 215 | if (ret) |
221 | goto fail; | 216 | goto fail; |
222 | 217 | ||
@@ -289,7 +284,7 @@ static int jffs2_link (struct dentry *old_dentry, struct inode *dir_i, struct de | |||
289 | mutex_unlock(&f->sem); | 284 | mutex_unlock(&f->sem); |
290 | d_instantiate(dentry, old_dentry->d_inode); | 285 | d_instantiate(dentry, old_dentry->d_inode); |
291 | dir_i->i_mtime = dir_i->i_ctime = ITIME(now); | 286 | dir_i->i_mtime = dir_i->i_ctime = ITIME(now); |
292 | atomic_inc(&old_dentry->d_inode->i_count); | 287 | ihold(old_dentry->d_inode); |
293 | } | 288 | } |
294 | return ret; | 289 | return ret; |
295 | } | 290 | } |
@@ -367,7 +362,7 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char | |||
367 | } | 362 | } |
368 | 363 | ||
369 | /* We use f->target field to store the target path. */ | 364 | /* We use f->target field to store the target path. */ |
370 | f->target = kmalloc(targetlen + 1, GFP_KERNEL); | 365 | f->target = kmemdup(target, targetlen + 1, GFP_KERNEL); |
371 | if (!f->target) { | 366 | if (!f->target) { |
372 | printk(KERN_WARNING "Can't allocate %d bytes of memory\n", targetlen + 1); | 367 | printk(KERN_WARNING "Can't allocate %d bytes of memory\n", targetlen + 1); |
373 | mutex_unlock(&f->sem); | 368 | mutex_unlock(&f->sem); |
@@ -376,7 +371,6 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char | |||
376 | goto fail; | 371 | goto fail; |
377 | } | 372 | } |
378 | 373 | ||
379 | memcpy(f->target, target, targetlen + 1); | ||
380 | D1(printk(KERN_DEBUG "jffs2_symlink: symlink's target '%s' cached\n", (char *)f->target)); | 374 | D1(printk(KERN_DEBUG "jffs2_symlink: symlink's target '%s' cached\n", (char *)f->target)); |
381 | 375 | ||
382 | /* No data here. Only a metadata node, which will be | 376 | /* No data here. Only a metadata node, which will be |
@@ -387,7 +381,7 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char | |||
387 | 381 | ||
388 | jffs2_complete_reservation(c); | 382 | jffs2_complete_reservation(c); |
389 | 383 | ||
390 | ret = jffs2_init_security(inode, dir_i); | 384 | ret = jffs2_init_security(inode, dir_i, &dentry->d_name); |
391 | if (ret) | 385 | if (ret) |
392 | goto fail; | 386 | goto fail; |
393 | 387 | ||
@@ -531,7 +525,7 @@ static int jffs2_mkdir (struct inode *dir_i, struct dentry *dentry, int mode) | |||
531 | 525 | ||
532 | jffs2_complete_reservation(c); | 526 | jffs2_complete_reservation(c); |
533 | 527 | ||
534 | ret = jffs2_init_security(inode, dir_i); | 528 | ret = jffs2_init_security(inode, dir_i, &dentry->d_name); |
535 | if (ret) | 529 | if (ret) |
536 | goto fail; | 530 | goto fail; |
537 | 531 | ||
@@ -704,7 +698,7 @@ static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, int mode, de | |||
704 | 698 | ||
705 | jffs2_complete_reservation(c); | 699 | jffs2_complete_reservation(c); |
706 | 700 | ||
707 | ret = jffs2_init_security(inode, dir_i); | 701 | ret = jffs2_init_security(inode, dir_i, &dentry->d_name); |
708 | if (ret) | 702 | if (ret) |
709 | goto fail; | 703 | goto fail; |
710 | 704 | ||
@@ -864,7 +858,7 @@ static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry, | |||
864 | printk(KERN_NOTICE "jffs2_rename(): Link succeeded, unlink failed (err %d). You now have a hard link\n", ret); | 858 | printk(KERN_NOTICE "jffs2_rename(): Link succeeded, unlink failed (err %d). You now have a hard link\n", ret); |
865 | /* Might as well let the VFS know */ | 859 | /* Might as well let the VFS know */ |
866 | d_instantiate(new_dentry, old_dentry->d_inode); | 860 | d_instantiate(new_dentry, old_dentry->d_inode); |
867 | atomic_inc(&old_dentry->d_inode->i_count); | 861 | ihold(old_dentry->d_inode); |
868 | new_dir_i->i_mtime = new_dir_i->i_ctime = ITIME(now); | 862 | new_dir_i->i_mtime = new_dir_i->i_ctime = ITIME(now); |
869 | return ret; | 863 | return ret; |
870 | } | 864 | } |