aboutsummaryrefslogtreecommitdiffstats
path: root/fs/configfs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-03-19 21:52:29 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-03-19 21:52:29 -0400
commit3c2de27d793bf55167804fc47954711e94f27be7 (patch)
treeb554e41e350adc47cf983b3103f4b4b79451f67b /fs/configfs
parent51b3eae8dbe5e6fa9657b21388ad6642d6934952 (diff)
parent8b23a8ce1094f25a85826e25217c5b9779a4f5aa (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs updates from Al Viro: - Preparations of parallel lookups (the remaining main obstacle is the need to move security_d_instantiate(); once that becomes safe, the rest will be a matter of rather short series local to fs/*.c - preadv2/pwritev2 series from Christoph - assorted fixes * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (32 commits) splice: handle zero nr_pages in splice_to_pipe() vfs: show_vfsstat: do not ignore errors from show_devname method dcache.c: new helper: __d_add() don't bother with __d_instantiate(dentry, NULL) untangle fsnotify_d_instantiate() a bit uninline d_add() replace d_add_unique() with saner primitive quota: use lookup_one_len_unlocked() cifs_get_root(): use lookup_one_len_unlocked() nfs_lookup: don't bother with d_instantiate(dentry, NULL) kill dentry_unhash() ceph_fill_trace(): don't bother with d_instantiate(dn, NULL) autofs4: don't bother with d_instantiate(dentry, NULL) in ->lookup() configfs: move d_rehash() into configfs_create() for regular files ceph: don't bother with d_rehash() in splice_dentry() namei: teach lookup_slow() to skip revalidate namei: massage lookup_slow() to be usable by lookup_one_len_unlocked() lookup_one_len_unlocked(): use lookup_dcache() namei: simplify invalidation logics in lookup_dcache() namei: change calling conventions for lookup_{fast,slow} and follow_managed() ...
Diffstat (limited to 'fs/configfs')
-rw-r--r--fs/configfs/dir.c9
-rw-r--r--fs/configfs/inode.c12
2 files changed, 12 insertions, 9 deletions
diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c
index b51ce6778145..ea59c891fc53 100644
--- a/fs/configfs/dir.c
+++ b/fs/configfs/dir.c
@@ -432,14 +432,9 @@ static int configfs_attach_attr(struct configfs_dirent * sd, struct dentry * den
432 (sd->s_type & CONFIGFS_ITEM_BIN_ATTR) ? 432 (sd->s_type & CONFIGFS_ITEM_BIN_ATTR) ?
433 configfs_init_bin_file : 433 configfs_init_bin_file :
434 configfs_init_file); 434 configfs_init_file);
435 if (error) { 435 if (error)
436 configfs_put(sd); 436 configfs_put(sd);
437 return error; 437 return error;
438 }
439
440 d_rehash(dentry);
441
442 return 0;
443} 438}
444 439
445static struct dentry * configfs_lookup(struct inode *dir, 440static struct dentry * configfs_lookup(struct inode *dir,
diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c
index 5f24ad3ecba4..03d124ae27d7 100644
--- a/fs/configfs/inode.c
+++ b/fs/configfs/inode.c
@@ -201,9 +201,17 @@ int configfs_create(struct dentry * dentry, umode_t mode, void (*init)(struct in
201 configfs_set_inode_lock_class(sd, inode); 201 configfs_set_inode_lock_class(sd, inode);
202 202
203 init(inode); 203 init(inode);
204 d_instantiate(dentry, inode); 204 if (S_ISDIR(mode) || S_ISLNK(mode)) {
205 if (S_ISDIR(mode) || S_ISLNK(mode)) 205 /*
206 * ->symlink(), ->mkdir(), configfs_register_subsystem() or
207 * create_default_group() - already hashed.
208 */
209 d_instantiate(dentry, inode);
206 dget(dentry); /* pin link and directory dentries in core */ 210 dget(dentry); /* pin link and directory dentries in core */
211 } else {
212 /* ->lookup() */
213 d_add(dentry, inode);
214 }
207 return error; 215 return error;
208} 216}
209 217