Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/unionfs/union_subr.c
| Show First 20 Lines • Show All 581 Lines • ▼ Show 20 Lines | |||||
| * for the process that owns td. Return NULL if no such object exists. | * for the process that owns td. Return NULL if no such object exists. | ||||
| */ | */ | ||||
| struct unionfs_node_status * | struct unionfs_node_status * | ||||
| unionfs_find_node_status(struct unionfs_node *unp, struct thread *td) | unionfs_find_node_status(struct unionfs_node *unp, struct thread *td) | ||||
| { | { | ||||
| struct unionfs_node_status *unsp; | struct unionfs_node_status *unsp; | ||||
| pid_t pid; | pid_t pid; | ||||
| MPASS(td != NULL); | |||||
| pid = td->td_proc->p_pid; | pid = td->td_proc->p_pid; | ||||
| ASSERT_VOP_ELOCKED(UNIONFSTOV(unp), __func__); | ASSERT_VOP_ELOCKED(UNIONFSTOV(unp), __func__); | ||||
| LIST_FOREACH(unsp, &(unp->un_unshead), uns_list) { | LIST_FOREACH(unsp, &(unp->un_unshead), uns_list) { | ||||
| if (unsp->uns_pid == pid) { | if (unsp->uns_pid == pid) { | ||||
| return (unsp); | return (unsp); | ||||
| } | } | ||||
| Show All 9 Lines | |||||
| */ | */ | ||||
| void | void | ||||
| unionfs_get_node_status(struct unionfs_node *unp, struct thread *td, | unionfs_get_node_status(struct unionfs_node *unp, struct thread *td, | ||||
| struct unionfs_node_status **unspp) | struct unionfs_node_status **unspp) | ||||
| { | { | ||||
| struct unionfs_node_status *unsp; | struct unionfs_node_status *unsp; | ||||
| pid_t pid; | pid_t pid; | ||||
| MPASS(td != NULL); | |||||
| pid = td->td_proc->p_pid; | pid = td->td_proc->p_pid; | ||||
| KASSERT(NULL != unspp, ("%s: NULL status", __func__)); | KASSERT(NULL != unspp, ("%s: NULL status", __func__)); | ||||
| unsp = unionfs_find_node_status(unp, td); | unsp = unionfs_find_node_status(unp, td); | ||||
| if (unsp == NULL) { | if (unsp == NULL) { | ||||
| /* create a new unionfs node status */ | /* create a new unionfs node status */ | ||||
| unsp = malloc(sizeof(struct unionfs_node_status), | unsp = malloc(sizeof(struct unionfs_node_status), | ||||
| M_TEMP, M_WAITOK | M_ZERO); | M_TEMP, M_WAITOK | M_ZERO); | ||||
| ▲ Show 20 Lines • Show All 1,041 Lines • Show Last 20 Lines | |||||