aboutsummaryrefslogtreecommitdiffstats
path: root/fs/configfs/inode.c
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/configfs/inode.c
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/configfs/inode.c')
-rw-r--r--fs/configfs/inode.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c
index 65af86147154..5423a6a6ecc8 100644
--- a/fs/configfs/inode.c
+++ b/fs/configfs/inode.c
@@ -176,7 +176,7 @@ static void configfs_set_inode_lock_class(struct configfs_dirent *sd,
176 176
177#endif /* CONFIG_LOCKDEP */ 177#endif /* CONFIG_LOCKDEP */
178 178
179int configfs_create(struct dentry * dentry, umode_t mode, int (*init)(struct inode *)) 179int configfs_create(struct dentry * dentry, umode_t mode, void (*init)(struct inode *))
180{ 180{
181 int error = 0; 181 int error = 0;
182 struct inode *inode = NULL; 182 struct inode *inode = NULL;
@@ -198,13 +198,7 @@ int configfs_create(struct dentry * dentry, umode_t mode, int (*init)(struct ino
198 p_inode->i_mtime = p_inode->i_ctime = CURRENT_TIME; 198 p_inode->i_mtime = p_inode->i_ctime = CURRENT_TIME;
199 configfs_set_inode_lock_class(sd, inode); 199 configfs_set_inode_lock_class(sd, inode);
200 200
201 if (init) { 201 init(inode);
202 error = init(inode);
203 if (error) {
204 iput(inode);
205 return error;
206 }
207 }
208 d_instantiate(dentry, inode); 202 d_instantiate(dentry, inode);
209 if (S_ISDIR(mode) || S_ISLNK(mode)) 203 if (S_ISDIR(mode) || S_ISLNK(mode))
210 dget(dentry); /* pin link and directory dentries in core */ 204 dget(dentry); /* pin link and directory dentries in core */
@@ -242,7 +236,7 @@ void configfs_drop_dentry(struct configfs_dirent * sd, struct dentry * parent)
242 236
243 if (dentry) { 237 if (dentry) {
244 spin_lock(&dentry->d_lock); 238 spin_lock(&dentry->d_lock);
245 if (!(d_unhashed(dentry) && dentry->d_inode)) { 239 if (!d_unhashed(dentry) && dentry->d_inode) {
246 dget_dlock(dentry); 240 dget_dlock(dentry);
247 __d_drop(dentry); 241 __d_drop(dentry);
248 spin_unlock(&dentry->d_lock); 242 spin_unlock(&dentry->d_lock);