Lines Matching refs:dentry
87 struct dentry *dentry; in rpc_timeout_upcall_queue() local
95 dentry = dget(pipe->dentry); in rpc_timeout_upcall_queue()
97 rpc_purge_list(dentry ? &RPC_I(dentry->d_inode)->waitq : NULL, in rpc_timeout_upcall_queue()
99 dput(dentry); in rpc_timeout_upcall_queue()
136 struct dentry *dentry; in rpc_queue_upcall() local
152 dentry = dget(pipe->dentry); in rpc_queue_upcall()
154 if (dentry) { in rpc_queue_upcall()
155 wake_up(&RPC_I(dentry->d_inode)->waitq); in rpc_queue_upcall()
156 dput(dentry); in rpc_queue_upcall()
182 pipe->dentry = NULL; in rpc_close_pipes()
428 spin_lock(&file->f_path.dentry->d_lock); in rpc_info_open()
429 if (!d_unhashed(file->f_path.dentry)) in rpc_info_open()
432 spin_unlock(&file->f_path.dentry->d_lock); in rpc_info_open()
435 spin_unlock(&file->f_path.dentry->d_lock); in rpc_info_open()
492 static int __rpc_create_common(struct inode *dir, struct dentry *dentry, in __rpc_create_common() argument
499 d_drop(dentry); in __rpc_create_common()
508 d_add(dentry, inode); in __rpc_create_common()
512 __FILE__, __func__, dentry); in __rpc_create_common()
513 dput(dentry); in __rpc_create_common()
517 static int __rpc_create(struct inode *dir, struct dentry *dentry, in __rpc_create() argument
524 err = __rpc_create_common(dir, dentry, S_IFREG | mode, i_fop, private); in __rpc_create()
527 fsnotify_create(dir, dentry); in __rpc_create()
531 static int __rpc_mkdir(struct inode *dir, struct dentry *dentry, in __rpc_mkdir() argument
538 err = __rpc_create_common(dir, dentry, S_IFDIR | mode, i_fop, private); in __rpc_mkdir()
542 fsnotify_mkdir(dir, dentry); in __rpc_mkdir()
559 pipe->dentry = NULL; in init_pipe()
582 static int __rpc_mkpipe_dentry(struct inode *dir, struct dentry *dentry, in __rpc_mkpipe_dentry() argument
591 err = __rpc_create_common(dir, dentry, S_IFIFO | mode, i_fop, private); in __rpc_mkpipe_dentry()
594 rpci = RPC_I(dentry->d_inode); in __rpc_mkpipe_dentry()
597 fsnotify_create(dir, dentry); in __rpc_mkpipe_dentry()
601 static int __rpc_rmdir(struct inode *dir, struct dentry *dentry) in __rpc_rmdir() argument
605 dget(dentry); in __rpc_rmdir()
606 ret = simple_rmdir(dir, dentry); in __rpc_rmdir()
607 d_delete(dentry); in __rpc_rmdir()
608 dput(dentry); in __rpc_rmdir()
612 int rpc_rmdir(struct dentry *dentry) in rpc_rmdir() argument
614 struct dentry *parent; in rpc_rmdir()
618 parent = dget_parent(dentry); in rpc_rmdir()
621 error = __rpc_rmdir(dir, dentry); in rpc_rmdir()
628 static int __rpc_unlink(struct inode *dir, struct dentry *dentry) in __rpc_unlink() argument
632 dget(dentry); in __rpc_unlink()
633 ret = simple_unlink(dir, dentry); in __rpc_unlink()
634 d_delete(dentry); in __rpc_unlink()
635 dput(dentry); in __rpc_unlink()
639 static int __rpc_rmpipe(struct inode *dir, struct dentry *dentry) in __rpc_rmpipe() argument
641 struct inode *inode = dentry->d_inode; in __rpc_rmpipe()
644 return __rpc_unlink(dir, dentry); in __rpc_rmpipe()
647 static struct dentry *__rpc_lookup_create_exclusive(struct dentry *parent, in __rpc_lookup_create_exclusive()
651 struct dentry *dentry = d_hash_and_lookup(parent, &q); in __rpc_lookup_create_exclusive() local
652 if (!dentry) { in __rpc_lookup_create_exclusive()
653 dentry = d_alloc(parent, &q); in __rpc_lookup_create_exclusive()
654 if (!dentry) in __rpc_lookup_create_exclusive()
657 if (dentry->d_inode == NULL) in __rpc_lookup_create_exclusive()
658 return dentry; in __rpc_lookup_create_exclusive()
659 dput(dentry); in __rpc_lookup_create_exclusive()
666 static void __rpc_depopulate(struct dentry *parent, in __rpc_depopulate()
671 struct dentry *dentry; in __rpc_depopulate() local
678 dentry = d_hash_and_lookup(parent, &name); in __rpc_depopulate()
680 if (dentry == NULL) in __rpc_depopulate()
682 if (dentry->d_inode == NULL) in __rpc_depopulate()
684 switch (dentry->d_inode->i_mode & S_IFMT) { in __rpc_depopulate()
688 __rpc_unlink(dir, dentry); in __rpc_depopulate()
691 __rpc_rmdir(dir, dentry); in __rpc_depopulate()
694 dput(dentry); in __rpc_depopulate()
698 static void rpc_depopulate(struct dentry *parent, in rpc_depopulate()
709 static int rpc_populate(struct dentry *parent, in rpc_populate()
715 struct dentry *dentry; in rpc_populate() local
720 dentry = __rpc_lookup_create_exclusive(parent, files[i].name); in rpc_populate()
721 err = PTR_ERR(dentry); in rpc_populate()
722 if (IS_ERR(dentry)) in rpc_populate()
728 err = __rpc_create(dir, dentry, in rpc_populate()
734 err = __rpc_mkdir(dir, dentry, in rpc_populate()
752 static struct dentry *rpc_mkdir_populate(struct dentry *parent, in rpc_mkdir_populate()
754 int (*populate)(struct dentry *, void *), void *args_populate) in rpc_mkdir_populate() argument
756 struct dentry *dentry; in rpc_mkdir_populate() local
761 dentry = __rpc_lookup_create_exclusive(parent, name); in rpc_mkdir_populate()
762 if (IS_ERR(dentry)) in rpc_mkdir_populate()
764 error = __rpc_mkdir(dir, dentry, mode, NULL, private); in rpc_mkdir_populate()
768 error = populate(dentry, args_populate); in rpc_mkdir_populate()
774 return dentry; in rpc_mkdir_populate()
776 __rpc_rmdir(dir, dentry); in rpc_mkdir_populate()
778 dentry = ERR_PTR(error); in rpc_mkdir_populate()
782 static int rpc_rmdir_depopulate(struct dentry *dentry, in rpc_rmdir_depopulate() argument
783 void (*depopulate)(struct dentry *)) in rpc_rmdir_depopulate() argument
785 struct dentry *parent; in rpc_rmdir_depopulate()
789 parent = dget_parent(dentry); in rpc_rmdir_depopulate()
793 depopulate(dentry); in rpc_rmdir_depopulate()
794 error = __rpc_rmdir(dir, dentry); in rpc_rmdir_depopulate()
818 struct dentry *rpc_mkpipe_dentry(struct dentry *parent, const char *name, in rpc_mkpipe_dentry()
821 struct dentry *dentry; in rpc_mkpipe_dentry() local
832 dentry = __rpc_lookup_create_exclusive(parent, name); in rpc_mkpipe_dentry()
833 if (IS_ERR(dentry)) in rpc_mkpipe_dentry()
835 err = __rpc_mkpipe_dentry(dir, dentry, umode, &rpc_pipe_fops, in rpc_mkpipe_dentry()
841 return dentry; in rpc_mkpipe_dentry()
843 dentry = ERR_PTR(err); in rpc_mkpipe_dentry()
860 rpc_unlink(struct dentry *dentry) in rpc_unlink() argument
862 struct dentry *parent; in rpc_unlink()
866 parent = dget_parent(dentry); in rpc_unlink()
869 error = __rpc_rmpipe(dir, dentry); in rpc_unlink()
1013 struct dentry *dir = pdh->pdh_dentry; in rpc_create_pipe_dir_objects()
1023 struct dentry *dir = pdh->pdh_dentry; in rpc_destroy_pipe_dir_objects()
1042 static int rpc_clntdir_populate(struct dentry *dentry, void *private) in rpc_clntdir_populate() argument
1044 return rpc_populate(dentry, in rpc_clntdir_populate()
1049 static void rpc_clntdir_depopulate(struct dentry *dentry) in rpc_clntdir_depopulate() argument
1051 rpc_depopulate(dentry, authfiles, RPCAUTH_info, RPCAUTH_EOF); in rpc_clntdir_depopulate()
1065 struct dentry *rpc_create_client_dir(struct dentry *dentry, in rpc_create_client_dir() argument
1069 struct dentry *ret; in rpc_create_client_dir()
1071 ret = rpc_mkdir_populate(dentry, name, S_IRUGO | S_IXUGO, NULL, in rpc_create_client_dir()
1086 struct dentry *dentry = rpc_client->cl_pipedir_objects.pdh_dentry; in rpc_remove_client_dir() local
1088 if (dentry == NULL) in rpc_remove_client_dir()
1092 return rpc_rmdir_depopulate(dentry, rpc_clntdir_depopulate); in rpc_remove_client_dir()
1113 static int rpc_cachedir_populate(struct dentry *dentry, void *private) in rpc_cachedir_populate() argument
1115 return rpc_populate(dentry, in rpc_cachedir_populate()
1120 static void rpc_cachedir_depopulate(struct dentry *dentry) in rpc_cachedir_depopulate() argument
1122 rpc_depopulate(dentry, cache_pipefs_files, 0, 3); in rpc_cachedir_depopulate()
1125 struct dentry *rpc_create_cache_dir(struct dentry *parent, const char *name, in rpc_create_cache_dir()
1132 void rpc_remove_cache_dir(struct dentry *dentry) in rpc_remove_cache_dir() argument
1134 rpc_rmdir_depopulate(dentry, rpc_cachedir_depopulate); in rpc_remove_cache_dir()
1206 struct dentry *rpc_d_lookup_sb(const struct super_block *sb, in rpc_d_lookup_sb()
1325 static struct dentry *
1326 rpc_gssd_dummy_populate(struct dentry *root, struct rpc_pipe *pipe_data) in rpc_gssd_dummy_populate()
1329 struct dentry *gssd_dentry; in rpc_gssd_dummy_populate()
1330 struct dentry *clnt_dentry = NULL; in rpc_gssd_dummy_populate()
1331 struct dentry *pipe_dentry = NULL; in rpc_gssd_dummy_populate()
1373 rpc_gssd_dummy_depopulate(struct dentry *pipe_dentry) in rpc_gssd_dummy_depopulate()
1375 struct dentry *clnt_dir = pipe_dentry->d_parent; in rpc_gssd_dummy_depopulate()
1376 struct dentry *gssd_dir = clnt_dir->d_parent; in rpc_gssd_dummy_depopulate()
1388 struct dentry *root, *gssd_dentry; in rpc_fill_super()
1447 static struct dentry *