aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-02-22 20:42:14 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-22 20:42:14 -0500
commitbe5e6616dd74e17fdd8e16ca015cfef94d49b467 (patch)
treea18826e557f0d6636f1e05a4ec30d584ed981a2b /fs/jffs2
parent90c453ca2214394eec602d98e6cb92d151908493 (diff)
parent0a280962dc6e117e0e4baa668453f753579265d9 (diff)
Merge branch 'for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull more vfs updates from Al Viro: "Assorted stuff from this cycle. The big ones here are multilayer overlayfs from Miklos and beginning of sorting ->d_inode accesses out from David" * 'for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (51 commits) autofs4 copy_dev_ioctl(): keep the value of ->size we'd used for allocation procfs: fix race between symlink removals and traversals debugfs: leave freeing a symlink body until inode eviction Documentation/filesystems/Locking: ->get_sb() is long gone trylock_super(): replacement for grab_super_passive() fanotify: Fix up scripted S_ISDIR/S_ISREG/S_ISLNK conversions Cachefiles: Fix up scripted S_ISDIR/S_ISREG/S_ISLNK conversions VFS: (Scripted) Convert S_ISLNK/DIR/REG(dentry->d_inode) to d_is_*(dentry) SELinux: Use d_is_positive() rather than testing dentry->d_inode Smack: Use d_is_positive() rather than testing dentry->d_inode TOMOYO: Use d_is_dir() rather than d_inode and S_ISDIR() Apparmor: Use d_is_positive/negative() rather than testing dentry->d_inode Apparmor: mediated_filesystem() should use dentry->d_sb not inode->i_sb VFS: Split DCACHE_FILE_TYPE into regular and special types VFS: Add a fallthrough flag for marking virtual dentries VFS: Add a whiteout dentry type VFS: Introduce inode-getting helpers for layered/unioned fs environments Infiniband: Fix potential NULL d_inode dereference posix_acl: fix reference leaks in posix_acl_create autofs4: Wrong format for printing dentry ...
Diffstat (limited to 'fs/jffs2')
-rw-r--r--fs/jffs2/dir.c14
-rw-r--r--fs/jffs2/super.c2
2 files changed, 8 insertions, 8 deletions
diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c
index 938556025d64..f21b6fb5e4c4 100644
--- a/fs/jffs2/dir.c
+++ b/fs/jffs2/dir.c
@@ -252,7 +252,7 @@ static int jffs2_link (struct dentry *old_dentry, struct inode *dir_i, struct de
252 if (!f->inocache) 252 if (!f->inocache)
253 return -EIO; 253 return -EIO;
254 254
255 if (S_ISDIR(old_dentry->d_inode->i_mode)) 255 if (d_is_dir(old_dentry))
256 return -EPERM; 256 return -EPERM;
257 257
258 /* XXX: This is ugly */ 258 /* XXX: This is ugly */
@@ -772,7 +772,7 @@ static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry,
772 */ 772 */
773 if (new_dentry->d_inode) { 773 if (new_dentry->d_inode) {
774 victim_f = JFFS2_INODE_INFO(new_dentry->d_inode); 774 victim_f = JFFS2_INODE_INFO(new_dentry->d_inode);
775 if (S_ISDIR(new_dentry->d_inode->i_mode)) { 775 if (d_is_dir(new_dentry)) {
776 struct jffs2_full_dirent *fd; 776 struct jffs2_full_dirent *fd;
777 777
778 mutex_lock(&victim_f->sem); 778 mutex_lock(&victim_f->sem);
@@ -807,7 +807,7 @@ static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry,
807 807
808 if (victim_f) { 808 if (victim_f) {
809 /* There was a victim. Kill it off nicely */ 809 /* There was a victim. Kill it off nicely */
810 if (S_ISDIR(new_dentry->d_inode->i_mode)) 810 if (d_is_dir(new_dentry))
811 clear_nlink(new_dentry->d_inode); 811 clear_nlink(new_dentry->d_inode);
812 else 812 else
813 drop_nlink(new_dentry->d_inode); 813 drop_nlink(new_dentry->d_inode);
@@ -815,7 +815,7 @@ static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry,
815 inode which didn't exist. */ 815 inode which didn't exist. */
816 if (victim_f->inocache) { 816 if (victim_f->inocache) {
817 mutex_lock(&victim_f->sem); 817 mutex_lock(&victim_f->sem);
818 if (S_ISDIR(new_dentry->d_inode->i_mode)) 818 if (d_is_dir(new_dentry))
819 victim_f->inocache->pino_nlink = 0; 819 victim_f->inocache->pino_nlink = 0;
820 else 820 else
821 victim_f->inocache->pino_nlink--; 821 victim_f->inocache->pino_nlink--;
@@ -825,7 +825,7 @@ static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry,
825 825
826 /* If it was a directory we moved, and there was no victim, 826 /* If it was a directory we moved, and there was no victim,
827 increase i_nlink on its new parent */ 827 increase i_nlink on its new parent */
828 if (S_ISDIR(old_dentry->d_inode->i_mode) && !victim_f) 828 if (d_is_dir(old_dentry) && !victim_f)
829 inc_nlink(new_dir_i); 829 inc_nlink(new_dir_i);
830 830
831 /* Unlink the original */ 831 /* Unlink the original */
@@ -839,7 +839,7 @@ static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry,
839 struct jffs2_inode_info *f = JFFS2_INODE_INFO(old_dentry->d_inode); 839 struct jffs2_inode_info *f = JFFS2_INODE_INFO(old_dentry->d_inode);
840 mutex_lock(&f->sem); 840 mutex_lock(&f->sem);
841 inc_nlink(old_dentry->d_inode); 841 inc_nlink(old_dentry->d_inode);
842 if (f->inocache && !S_ISDIR(old_dentry->d_inode->i_mode)) 842 if (f->inocache && !d_is_dir(old_dentry))
843 f->inocache->pino_nlink++; 843 f->inocache->pino_nlink++;
844 mutex_unlock(&f->sem); 844 mutex_unlock(&f->sem);
845 845
@@ -852,7 +852,7 @@ static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry,
852 return ret; 852 return ret;
853 } 853 }
854 854
855 if (S_ISDIR(old_dentry->d_inode->i_mode)) 855 if (d_is_dir(old_dentry))
856 drop_nlink(old_dir_i); 856 drop_nlink(old_dir_i);
857 857
858 new_dir_i->i_mtime = new_dir_i->i_ctime = old_dir_i->i_mtime = old_dir_i->i_ctime = ITIME(now); 858 new_dir_i->i_mtime = new_dir_i->i_ctime = old_dir_i->i_mtime = old_dir_i->i_ctime = ITIME(now);
diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c
index 0918f0e2e266..3d76f28a2ba9 100644
--- a/fs/jffs2/super.c
+++ b/fs/jffs2/super.c
@@ -138,7 +138,7 @@ static struct dentry *jffs2_get_parent(struct dentry *child)
138 struct jffs2_inode_info *f; 138 struct jffs2_inode_info *f;
139 uint32_t pino; 139 uint32_t pino;
140 140
141 BUG_ON(!S_ISDIR(child->d_inode->i_mode)); 141 BUG_ON(!d_is_dir(child));
142 142
143 f = JFFS2_INODE_INFO(child->d_inode); 143 f = JFFS2_INODE_INFO(child->d_inode);
144 144