Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/unionfs/union_vnops.c
| Show First 20 Lines • Show All 808 Lines • ▼ Show 20 Lines | unionfs_close(struct vop_close_args *ap) | ||||
| */ | */ | ||||
| lkstatus = unionfs_upgrade_lock(vp); | lkstatus = unionfs_upgrade_lock(vp); | ||||
| if (lkstatus == UNIONFS_LKUPGRADE_DOOMED) | if (lkstatus == UNIONFS_LKUPGRADE_DOOMED) | ||||
| goto unionfs_close_cleanup; | goto unionfs_close_cleanup; | ||||
| unp = VTOUNIONFS(vp); | unp = VTOUNIONFS(vp); | ||||
| lvp = unp->un_lowervp; | lvp = unp->un_lowervp; | ||||
| uvp = unp->un_uppervp; | uvp = unp->un_uppervp; | ||||
| unsp = unionfs_find_node_status(unp, td); | unsp = (td != NULL) ? unionfs_find_node_status(unp, td) : NULL; | ||||
olce: Matter of taste, but for a single assignment in `if` branches, I would rather use the ternary… | |||||
| if (unsp == NULL || | if (unsp == NULL || | ||||
| (unsp->uns_lower_opencnt <= 0 && unsp->uns_upper_opencnt <= 0)) { | (unsp->uns_lower_opencnt <= 0 && unsp->uns_upper_opencnt <= 0)) { | ||||
| #ifdef DIAGNOSTIC | #ifdef DIAGNOSTIC | ||||
| if (unsp != NULL) | if (unsp != NULL) | ||||
| printf("unionfs_close: warning: open count is 0\n"); | printf("unionfs_close: warning: open count is 0\n"); | ||||
| #endif | #endif | ||||
| if (uvp != NULL) | if (uvp != NULL) | ||||
| ovp = uvp; | ovp = uvp; | ||||
| ▲ Show 20 Lines • Show All 2,221 Lines • Show Last 20 Lines | |||||
Matter of taste, but for a single assignment in if branches, I would rather use the ternary operator. Else, I would prefer that the superfluous braces are removed.