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 ...
This commit is contained in:
@@ -252,7 +252,7 @@ static int jffs2_link (struct dentry *old_dentry, struct inode *dir_i, struct de
|
||||
if (!f->inocache)
|
||||
return -EIO;
|
||||
|
||||
if (S_ISDIR(old_dentry->d_inode->i_mode))
|
||||
if (d_is_dir(old_dentry))
|
||||
return -EPERM;
|
||||
|
||||
/* XXX: This is ugly */
|
||||
@@ -772,7 +772,7 @@ static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry,
|
||||
*/
|
||||
if (new_dentry->d_inode) {
|
||||
victim_f = JFFS2_INODE_INFO(new_dentry->d_inode);
|
||||
if (S_ISDIR(new_dentry->d_inode->i_mode)) {
|
||||
if (d_is_dir(new_dentry)) {
|
||||
struct jffs2_full_dirent *fd;
|
||||
|
||||
mutex_lock(&victim_f->sem);
|
||||
@@ -807,7 +807,7 @@ static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry,
|
||||
|
||||
if (victim_f) {
|
||||
/* There was a victim. Kill it off nicely */
|
||||
if (S_ISDIR(new_dentry->d_inode->i_mode))
|
||||
if (d_is_dir(new_dentry))
|
||||
clear_nlink(new_dentry->d_inode);
|
||||
else
|
||||
drop_nlink(new_dentry->d_inode);
|
||||
@@ -815,7 +815,7 @@ static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry,
|
||||
inode which didn't exist. */
|
||||
if (victim_f->inocache) {
|
||||
mutex_lock(&victim_f->sem);
|
||||
if (S_ISDIR(new_dentry->d_inode->i_mode))
|
||||
if (d_is_dir(new_dentry))
|
||||
victim_f->inocache->pino_nlink = 0;
|
||||
else
|
||||
victim_f->inocache->pino_nlink--;
|
||||
@@ -825,7 +825,7 @@ static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry,
|
||||
|
||||
/* If it was a directory we moved, and there was no victim,
|
||||
increase i_nlink on its new parent */
|
||||
if (S_ISDIR(old_dentry->d_inode->i_mode) && !victim_f)
|
||||
if (d_is_dir(old_dentry) && !victim_f)
|
||||
inc_nlink(new_dir_i);
|
||||
|
||||
/* Unlink the original */
|
||||
@@ -839,7 +839,7 @@ static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry,
|
||||
struct jffs2_inode_info *f = JFFS2_INODE_INFO(old_dentry->d_inode);
|
||||
mutex_lock(&f->sem);
|
||||
inc_nlink(old_dentry->d_inode);
|
||||
if (f->inocache && !S_ISDIR(old_dentry->d_inode->i_mode))
|
||||
if (f->inocache && !d_is_dir(old_dentry))
|
||||
f->inocache->pino_nlink++;
|
||||
mutex_unlock(&f->sem);
|
||||
|
||||
@@ -852,7 +852,7 @@ static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry,
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (S_ISDIR(old_dentry->d_inode->i_mode))
|
||||
if (d_is_dir(old_dentry))
|
||||
drop_nlink(old_dir_i);
|
||||
|
||||
new_dir_i->i_mtime = new_dir_i->i_ctime = old_dir_i->i_mtime = old_dir_i->i_ctime = ITIME(now);
|
||||
|
@@ -138,7 +138,7 @@ static struct dentry *jffs2_get_parent(struct dentry *child)
|
||||
struct jffs2_inode_info *f;
|
||||
uint32_t pino;
|
||||
|
||||
BUG_ON(!S_ISDIR(child->d_inode->i_mode));
|
||||
BUG_ON(!d_is_dir(child));
|
||||
|
||||
f = JFFS2_INODE_INFO(child->d_inode);
|
||||
|
||||
|
Reference in New Issue
Block a user