Lines Matching refs:dentry

45 static void configfs_d_iput(struct dentry * dentry,  in configfs_d_iput()  argument
48 struct configfs_dirent *sd = dentry->d_fsdata; in configfs_d_iput()
59 if (sd->s_dentry == dentry) in configfs_d_iput()
243 struct dentry * dentry, void * element, in configfs_make_dirent() argument
253 sd->s_dentry = dentry; in configfs_make_dirent()
254 if (dentry) in configfs_make_dirent()
255 dentry->d_fsdata = configfs_get(sd); in configfs_make_dirent()
260 static void configfs_remove_dirent(struct dentry *dentry) in configfs_remove_dirent() argument
262 struct configfs_dirent *sd = dentry->d_fsdata; in configfs_remove_dirent()
282 static int configfs_create_dir(struct config_item *item, struct dentry *dentry, in configfs_create_dir() argument
287 struct dentry *p = dentry->d_parent; in configfs_create_dir()
292 error = configfs_dirent_exists(p->d_fsdata, dentry->d_name.name); in configfs_create_dir()
296 error = configfs_make_dirent(p->d_fsdata, dentry, item, mode, in configfs_create_dir()
302 configfs_set_dir_dirent_depth(p->d_fsdata, dentry->d_fsdata); in configfs_create_dir()
303 inode = configfs_create(dentry, mode); in configfs_create_dir()
311 d_instantiate(dentry, inode); in configfs_create_dir()
313 dget(dentry); /* pin directory dentries in core */ in configfs_create_dir()
315 item->ci_dentry = dentry; in configfs_create_dir()
319 configfs_put(dentry->d_fsdata); in configfs_create_dir()
320 configfs_remove_dirent(dentry); in configfs_create_dir()
362 int configfs_create_link(struct configfs_dirent *target, struct dentry *parent, in configfs_create_link()
363 struct dentry *dentry, char *body) in configfs_create_link() argument
370 err = configfs_make_dirent(p, dentry, target, mode, CONFIGFS_ITEM_LINK, in configfs_create_link()
375 inode = configfs_create(dentry, mode); in configfs_create_link()
381 d_instantiate(dentry, inode); in configfs_create_link()
382 dget(dentry); /* pin link dentries in core */ in configfs_create_link()
386 configfs_put(dentry->d_fsdata); in configfs_create_link()
387 configfs_remove_dirent(dentry); in configfs_create_link()
391 static void remove_dir(struct dentry * d) in remove_dir()
393 struct dentry * parent = dget(d->d_parent); in remove_dir()
418 struct dentry * dentry = dget(item->ci_dentry); in configfs_remove_dir() local
420 if (!dentry) in configfs_remove_dir()
423 remove_dir(dentry); in configfs_remove_dir()
427 dput(dentry); in configfs_remove_dir()
430 static struct dentry * configfs_lookup(struct inode *dir, in configfs_lookup()
431 struct dentry *dentry, in configfs_lookup() argument
434 struct configfs_dirent * parent_sd = dentry->d_parent->d_fsdata; in configfs_lookup()
438 if (dentry->d_name.len > NAME_MAX) in configfs_lookup()
455 !strcmp(configfs_get_name(sd), dentry->d_name.name)) { in configfs_lookup()
459 dentry->d_fsdata = configfs_get(sd); in configfs_lookup()
460 sd->s_dentry = dentry; in configfs_lookup()
463 inode = configfs_create(dentry, mode); in configfs_lookup()
480 d_add(dentry, inode); in configfs_lookup()
492 static int configfs_detach_prep(struct dentry *dentry, struct dentry **wait) in configfs_detach_prep() argument
494 struct configfs_dirent *parent_sd = dentry->d_fsdata; in configfs_detach_prep()
539 static void configfs_detach_rollback(struct dentry *dentry) in configfs_detach_rollback() argument
541 struct configfs_dirent *parent_sd = dentry->d_fsdata; in configfs_detach_rollback()
553 struct dentry * dentry = dget(item->ci_dentry); in detach_attrs() local
557 if (!dentry) in detach_attrs()
561 dentry->d_name.name); in detach_attrs()
563 parent_sd = dentry->d_fsdata; in detach_attrs()
570 configfs_drop_dentry(sd, dentry); in detach_attrs()
577 dput(dentry); in detach_attrs()
612 struct dentry *dentry,
618 struct dentry * dentry = dget(group->cg_item.ci_dentry); in detach_groups() local
619 struct dentry *child; in detach_groups()
623 if (!dentry) in detach_groups()
626 parent_sd = dentry->d_fsdata; in detach_groups()
649 dput(dentry); in detach_groups()
667 struct dentry *child, *parent = parent_group->cg_item.ci_dentry; in create_default_group()
813 struct dentry *dentry, in configfs_attach_item() argument
818 ret = configfs_create_dir(item, dentry, frag); in configfs_attach_item()
827 inode_lock(d_inode(dentry)); in configfs_attach_item()
829 d_inode(dentry)->i_flags |= S_DEAD; in configfs_attach_item()
830 dont_mount(dentry); in configfs_attach_item()
831 inode_unlock(d_inode(dentry)); in configfs_attach_item()
832 d_delete(dentry); in configfs_attach_item()
848 struct dentry *dentry, in configfs_attach_group() argument
854 ret = configfs_attach_item(parent_item, item, dentry, frag); in configfs_attach_group()
856 sd = dentry->d_fsdata; in configfs_attach_group()
868 inode_lock_nested(d_inode(dentry), I_MUTEX_CHILD); in configfs_attach_group()
873 d_inode(dentry)->i_flags |= S_DEAD; in configfs_attach_group()
874 dont_mount(dentry); in configfs_attach_group()
877 inode_unlock(d_inode(dentry)); in configfs_attach_group()
879 d_delete(dentry); in configfs_attach_group()
1034 static int configfs_depend_prep(struct dentry *origin, in configfs_depend_prep()
1064 static int configfs_do_depend_item(struct dentry *subsys_dentry, in configfs_do_depend_item()
1114 struct dentry *root; in configfs_depend_item()
1255 struct dentry *dentry, umode_t mode) in configfs_mkdir() argument
1269 sd = dentry->d_parent->d_fsdata; in configfs_mkdir()
1292 parent_item = configfs_get_config_item(dentry->d_parent); in configfs_mkdir()
1319 name = kmalloc(dentry->d_name.len + 1, GFP_KERNEL); in configfs_mkdir()
1325 snprintf(name, dentry->d_name.len + 1, "%s", dentry->d_name.name); in configfs_mkdir()
1393 ret = configfs_attach_group(parent_item, item, dentry, frag); in configfs_mkdir()
1395 ret = configfs_attach_item(parent_item, item, dentry, frag); in configfs_mkdir()
1400 configfs_dir_set_ready(dentry->d_fsdata); in configfs_mkdir()
1438 static int configfs_rmdir(struct inode *dir, struct dentry *dentry) in configfs_rmdir() argument
1448 sd = dentry->d_fsdata; in configfs_rmdir()
1453 parent_item = configfs_get_config_item(dentry->d_parent); in configfs_rmdir()
1471 struct dentry *wait; in configfs_rmdir()
1482 ret = configfs_detach_prep(dentry, &wait); in configfs_rmdir()
1484 configfs_detach_rollback(dentry); in configfs_rmdir()
1505 configfs_detach_rollback(dentry); in configfs_rmdir()
1514 item = configfs_get_config_item(dentry); in configfs_rmdir()
1564 struct dentry * dentry = file->f_path.dentry; in configfs_dir_open() local
1565 struct configfs_dirent * parent_sd = dentry->d_fsdata; in configfs_dir_open()
1568 inode_lock(d_inode(dentry)); in configfs_dir_open()
1581 inode_unlock(d_inode(dentry)); in configfs_dir_open()
1588 struct dentry * dentry = file->f_path.dentry; in configfs_dir_close() local
1591 inode_lock(d_inode(dentry)); in configfs_dir_close()
1595 inode_unlock(d_inode(dentry)); in configfs_dir_close()
1604 struct dentry *dentry = file->f_path.dentry; in configfs_readdir() local
1605 struct super_block *sb = dentry->d_sb; in configfs_readdir()
1606 struct configfs_dirent * parent_sd = dentry->d_fsdata; in configfs_readdir()
1639 dentry = next->s_dentry; in configfs_readdir()
1640 if (dentry) in configfs_readdir()
1641 inode = d_inode(dentry); in configfs_readdir()
1666 struct dentry * dentry = file->f_path.dentry; in configfs_dir_lseek() local
1682 struct configfs_dirent *sd = dentry->d_fsdata; in configfs_dir_lseek()
1727 struct dentry *parent; in configfs_register_group()
1771 struct dentry *dentry = group->cg_item.ci_dentry; in configfs_unregister_group() local
1772 struct dentry *parent = group->cg_item.ci_parent->ci_dentry; in configfs_unregister_group()
1773 struct configfs_dirent *sd = dentry->d_fsdata; in configfs_unregister_group()
1782 configfs_detach_prep(dentry, NULL); in configfs_unregister_group()
1786 d_inode(dentry)->i_flags |= S_DEAD; in configfs_unregister_group()
1787 dont_mount(dentry); in configfs_unregister_group()
1788 d_drop(dentry); in configfs_unregister_group()
1789 fsnotify_rmdir(d_inode(parent), dentry); in configfs_unregister_group()
1792 dput(dentry); in configfs_unregister_group()
1848 struct dentry *dentry; in configfs_register_subsystem() local
1849 struct dentry *root; in configfs_register_subsystem()
1874 dentry = d_alloc_name(root, group->cg_item.ci_name); in configfs_register_subsystem()
1875 if (dentry) { in configfs_register_subsystem()
1876 d_add(dentry, NULL); in configfs_register_subsystem()
1879 dentry, frag); in configfs_register_subsystem()
1881 BUG_ON(d_inode(dentry)); in configfs_register_subsystem()
1882 d_drop(dentry); in configfs_register_subsystem()
1883 dput(dentry); in configfs_register_subsystem()
1886 configfs_dir_set_ready(dentry->d_fsdata); in configfs_register_subsystem()
1907 struct dentry *dentry = group->cg_item.ci_dentry; in configfs_unregister_subsystem() local
1908 struct dentry *root = dentry->d_sb->s_root; in configfs_unregister_subsystem()
1909 struct configfs_dirent *sd = dentry->d_fsdata; in configfs_unregister_subsystem()
1912 if (dentry->d_parent != root) { in configfs_unregister_subsystem()
1923 inode_lock_nested(d_inode(dentry), I_MUTEX_CHILD); in configfs_unregister_subsystem()
1926 if (configfs_detach_prep(dentry, NULL)) { in configfs_unregister_subsystem()
1932 d_inode(dentry)->i_flags |= S_DEAD; in configfs_unregister_subsystem()
1933 dont_mount(dentry); in configfs_unregister_subsystem()
1934 inode_unlock(d_inode(dentry)); in configfs_unregister_subsystem()
1936 d_drop(dentry); in configfs_unregister_subsystem()
1937 fsnotify_rmdir(d_inode(root), dentry); in configfs_unregister_subsystem()
1941 dput(dentry); in configfs_unregister_subsystem()