Changeset View
Changeset View
Standalone View
Standalone View
head/sys/ufs/ufs/ufs_inode.c
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | |||||
#ifdef UFS_DIRHASH | #ifdef UFS_DIRHASH | ||||
#include <ufs/ufs/dir.h> | #include <ufs/ufs/dir.h> | ||||
#include <ufs/ufs/dirhash.h> | #include <ufs/ufs/dirhash.h> | ||||
#endif | #endif | ||||
#ifdef UFS_GJOURNAL | #ifdef UFS_GJOURNAL | ||||
#include <ufs/ufs/gjournal.h> | #include <ufs/ufs/gjournal.h> | ||||
#endif | #endif | ||||
int | |||||
ufs_need_inactive(ap) | |||||
struct vop_need_inactive_args *ap; | |||||
{ | |||||
struct vnode *vp; | |||||
struct inode *ip; | |||||
#ifdef QUOTA | |||||
int i; | |||||
#endif | |||||
vp = ap->a_vp; | |||||
ip = VTOI(vp); | |||||
if (UFS_RDONLY(ip)) | |||||
return (0); | |||||
if (ip->i_mode == 0 || ip->i_nlink <= 0 || | |||||
(ip->i_effnlink == 0 && DOINGSOFTDEP(vp)) || | |||||
(ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_MODIFIED | | |||||
IN_UPDATE)) != 0 || | |||||
(ip->i_effnlink <= 0 && (ip->i_size != 0 || (I_IS_UFS2(ip) && | |||||
ip->i_din2->di_extsize != 0)))) | |||||
return (1); | |||||
#ifdef QUOTA | |||||
for (i = 0; i < MAXQUOTAS; i++) { | |||||
if (ip->i_dquot[i] != NULL) | |||||
return (1); | |||||
} | |||||
#endif | |||||
/* | |||||
* No need to check ufs_gjournal_close() condition since we | |||||
* return 1 if only i_nlink <= 0. | |||||
*/ | |||||
return (0); | |||||
} | |||||
/* | /* | ||||
* Last reference to an inode. If necessary, write or delete it. | * Last reference to an inode. If necessary, write or delete it. | ||||
*/ | */ | ||||
int | int | ||||
ufs_inactive(ap) | ufs_inactive(ap) | ||||
struct vop_inactive_args /* { | struct vop_inactive_args /* { | ||||
struct vnode *a_vp; | struct vnode *a_vp; | ||||
struct thread *a_td; | struct thread *a_td; | ||||
▲ Show 20 Lines • Show All 153 Lines • Show Last 20 Lines |