Lines Matching refs:dentry
89 struct dentry *dentry; in rpc_timeout_upcall_queue() local
97 dentry = dget(pipe->dentry); in rpc_timeout_upcall_queue()
99 rpc_purge_list(dentry ? &RPC_I(d_inode(dentry))->waitq : NULL, in rpc_timeout_upcall_queue()
101 dput(dentry); in rpc_timeout_upcall_queue()
138 struct dentry *dentry; in rpc_queue_upcall() local
154 dentry = dget(pipe->dentry); in rpc_queue_upcall()
156 if (dentry) { in rpc_queue_upcall()
157 wake_up(&RPC_I(d_inode(dentry))->waitq); in rpc_queue_upcall()
158 dput(dentry); in rpc_queue_upcall()
184 pipe->dentry = NULL; in rpc_close_pipes()
423 spin_lock(&file->f_path.dentry->d_lock); in rpc_info_open()
424 if (!d_unhashed(file->f_path.dentry)) in rpc_info_open()
427 spin_unlock(&file->f_path.dentry->d_lock); in rpc_info_open()
430 spin_unlock(&file->f_path.dentry->d_lock); in rpc_info_open()
487 static int __rpc_create_common(struct inode *dir, struct dentry *dentry, in __rpc_create_common() argument
494 d_drop(dentry); in __rpc_create_common()
503 d_add(dentry, inode); in __rpc_create_common()
507 __FILE__, __func__, dentry); in __rpc_create_common()
508 dput(dentry); in __rpc_create_common()
512 static int __rpc_create(struct inode *dir, struct dentry *dentry, in __rpc_create() argument
519 err = __rpc_create_common(dir, dentry, S_IFREG | mode, i_fop, private); in __rpc_create()
522 fsnotify_create(dir, dentry); in __rpc_create()
526 static int __rpc_mkdir(struct inode *dir, struct dentry *dentry, in __rpc_mkdir() argument
533 err = __rpc_create_common(dir, dentry, S_IFDIR | mode, i_fop, private); in __rpc_mkdir()
537 fsnotify_mkdir(dir, dentry); in __rpc_mkdir()
554 pipe->dentry = NULL; in init_pipe()
577 static int __rpc_mkpipe_dentry(struct inode *dir, struct dentry *dentry, in __rpc_mkpipe_dentry() argument
586 err = __rpc_create_common(dir, dentry, S_IFIFO | mode, i_fop, private); in __rpc_mkpipe_dentry()
589 rpci = RPC_I(d_inode(dentry)); in __rpc_mkpipe_dentry()
592 fsnotify_create(dir, dentry); in __rpc_mkpipe_dentry()
596 static int __rpc_rmdir(struct inode *dir, struct dentry *dentry) in __rpc_rmdir() argument
600 dget(dentry); in __rpc_rmdir()
601 ret = simple_rmdir(dir, dentry); in __rpc_rmdir()
603 fsnotify_rmdir(dir, dentry); in __rpc_rmdir()
604 d_delete(dentry); in __rpc_rmdir()
605 dput(dentry); in __rpc_rmdir()
609 static int __rpc_unlink(struct inode *dir, struct dentry *dentry) in __rpc_unlink() argument
613 dget(dentry); in __rpc_unlink()
614 ret = simple_unlink(dir, dentry); in __rpc_unlink()
616 fsnotify_unlink(dir, dentry); in __rpc_unlink()
617 d_delete(dentry); in __rpc_unlink()
618 dput(dentry); in __rpc_unlink()
622 static int __rpc_rmpipe(struct inode *dir, struct dentry *dentry) in __rpc_rmpipe() argument
624 struct inode *inode = d_inode(dentry); in __rpc_rmpipe()
627 return __rpc_unlink(dir, dentry); in __rpc_rmpipe()
630 static struct dentry *__rpc_lookup_create_exclusive(struct dentry *parent, in __rpc_lookup_create_exclusive()
634 struct dentry *dentry = d_hash_and_lookup(parent, &q); in __rpc_lookup_create_exclusive() local
635 if (!dentry) { in __rpc_lookup_create_exclusive()
636 dentry = d_alloc(parent, &q); in __rpc_lookup_create_exclusive()
637 if (!dentry) in __rpc_lookup_create_exclusive()
640 if (d_really_is_negative(dentry)) in __rpc_lookup_create_exclusive()
641 return dentry; in __rpc_lookup_create_exclusive()
642 dput(dentry); in __rpc_lookup_create_exclusive()
649 static void __rpc_depopulate(struct dentry *parent, in __rpc_depopulate()
654 struct dentry *dentry; in __rpc_depopulate() local
661 dentry = d_hash_and_lookup(parent, &name); in __rpc_depopulate()
663 if (dentry == NULL) in __rpc_depopulate()
665 if (d_really_is_negative(dentry)) in __rpc_depopulate()
667 switch (d_inode(dentry)->i_mode & S_IFMT) { in __rpc_depopulate()
671 __rpc_unlink(dir, dentry); in __rpc_depopulate()
674 __rpc_rmdir(dir, dentry); in __rpc_depopulate()
677 dput(dentry); in __rpc_depopulate()
681 static void rpc_depopulate(struct dentry *parent, in rpc_depopulate()
692 static int rpc_populate(struct dentry *parent, in rpc_populate()
698 struct dentry *dentry; in rpc_populate() local
703 dentry = __rpc_lookup_create_exclusive(parent, files[i].name); in rpc_populate()
704 err = PTR_ERR(dentry); in rpc_populate()
705 if (IS_ERR(dentry)) in rpc_populate()
711 err = __rpc_create(dir, dentry, in rpc_populate()
717 err = __rpc_mkdir(dir, dentry, in rpc_populate()
735 static struct dentry *rpc_mkdir_populate(struct dentry *parent, in rpc_mkdir_populate()
737 int (*populate)(struct dentry *, void *), void *args_populate) in rpc_mkdir_populate() argument
739 struct dentry *dentry; in rpc_mkdir_populate() local
744 dentry = __rpc_lookup_create_exclusive(parent, name); in rpc_mkdir_populate()
745 if (IS_ERR(dentry)) in rpc_mkdir_populate()
747 error = __rpc_mkdir(dir, dentry, mode, NULL, private); in rpc_mkdir_populate()
751 error = populate(dentry, args_populate); in rpc_mkdir_populate()
757 return dentry; in rpc_mkdir_populate()
759 __rpc_rmdir(dir, dentry); in rpc_mkdir_populate()
761 dentry = ERR_PTR(error); in rpc_mkdir_populate()
765 static int rpc_rmdir_depopulate(struct dentry *dentry, in rpc_rmdir_depopulate() argument
766 void (*depopulate)(struct dentry *)) in rpc_rmdir_depopulate() argument
768 struct dentry *parent; in rpc_rmdir_depopulate()
772 parent = dget_parent(dentry); in rpc_rmdir_depopulate()
776 depopulate(dentry); in rpc_rmdir_depopulate()
777 error = __rpc_rmdir(dir, dentry); in rpc_rmdir_depopulate()
801 struct dentry *rpc_mkpipe_dentry(struct dentry *parent, const char *name, in rpc_mkpipe_dentry()
804 struct dentry *dentry; in rpc_mkpipe_dentry() local
815 dentry = __rpc_lookup_create_exclusive(parent, name); in rpc_mkpipe_dentry()
816 if (IS_ERR(dentry)) in rpc_mkpipe_dentry()
818 err = __rpc_mkpipe_dentry(dir, dentry, umode, &rpc_pipe_fops, in rpc_mkpipe_dentry()
824 return dentry; in rpc_mkpipe_dentry()
826 dentry = ERR_PTR(err); in rpc_mkpipe_dentry()
843 rpc_unlink(struct dentry *dentry) in rpc_unlink() argument
845 struct dentry *parent; in rpc_unlink()
849 parent = dget_parent(dentry); in rpc_unlink()
852 error = __rpc_rmpipe(dir, dentry); in rpc_unlink()
996 struct dentry *dir = pdh->pdh_dentry; in rpc_create_pipe_dir_objects()
1006 struct dentry *dir = pdh->pdh_dentry; in rpc_destroy_pipe_dir_objects()
1025 static int rpc_clntdir_populate(struct dentry *dentry, void *private) in rpc_clntdir_populate() argument
1027 return rpc_populate(dentry, in rpc_clntdir_populate()
1032 static void rpc_clntdir_depopulate(struct dentry *dentry) in rpc_clntdir_depopulate() argument
1034 rpc_depopulate(dentry, authfiles, RPCAUTH_info, RPCAUTH_EOF); in rpc_clntdir_depopulate()
1048 struct dentry *rpc_create_client_dir(struct dentry *dentry, in rpc_create_client_dir() argument
1052 struct dentry *ret; in rpc_create_client_dir()
1054 ret = rpc_mkdir_populate(dentry, name, 0555, NULL, in rpc_create_client_dir()
1069 struct dentry *dentry = rpc_client->cl_pipedir_objects.pdh_dentry; in rpc_remove_client_dir() local
1071 if (dentry == NULL) in rpc_remove_client_dir()
1075 return rpc_rmdir_depopulate(dentry, rpc_clntdir_depopulate); in rpc_remove_client_dir()
1096 static int rpc_cachedir_populate(struct dentry *dentry, void *private) in rpc_cachedir_populate() argument
1098 return rpc_populate(dentry, in rpc_cachedir_populate()
1103 static void rpc_cachedir_depopulate(struct dentry *dentry) in rpc_cachedir_depopulate() argument
1105 rpc_depopulate(dentry, cache_pipefs_files, 0, 3); in rpc_cachedir_depopulate()
1108 struct dentry *rpc_create_cache_dir(struct dentry *parent, const char *name, in rpc_create_cache_dir()
1115 void rpc_remove_cache_dir(struct dentry *dentry) in rpc_remove_cache_dir() argument
1117 rpc_rmdir_depopulate(dentry, rpc_cachedir_depopulate); in rpc_remove_cache_dir()
1189 struct dentry *rpc_d_lookup_sb(const struct super_block *sb, in rpc_d_lookup_sb()
1295 static struct dentry *
1296 rpc_gssd_dummy_populate(struct dentry *root, struct rpc_pipe *pipe_data) in rpc_gssd_dummy_populate()
1299 struct dentry *gssd_dentry; in rpc_gssd_dummy_populate()
1300 struct dentry *clnt_dentry = NULL; in rpc_gssd_dummy_populate()
1301 struct dentry *pipe_dentry = NULL; in rpc_gssd_dummy_populate()
1343 rpc_gssd_dummy_depopulate(struct dentry *pipe_dentry) in rpc_gssd_dummy_depopulate()
1345 struct dentry *clnt_dir = pipe_dentry->d_parent; in rpc_gssd_dummy_depopulate()
1346 struct dentry *gssd_dir = clnt_dir->d_parent; in rpc_gssd_dummy_depopulate()
1359 struct dentry *root, *gssd_dentry; in rpc_fill_super()