Page MenuHomeFreeBSD

D22616.id65456.diff
No OneTemporary

D22616.id65456.diff

Index: head/sys/ufs/ufs/ufs_extern.h
===================================================================
--- head/sys/ufs/ufs/ufs_extern.h
+++ head/sys/ufs/ufs/ufs_extern.h
@@ -79,6 +79,7 @@
int ufs_init(struct vfsconf *);
void ufs_itimes(struct vnode *vp);
int ufs_lookup(struct vop_cachedlookup_args *);
+int ufs_need_inactive(struct vop_need_inactive_args *);
int ufs_readdir(struct vop_readdir_args *);
int ufs_reclaim(struct vop_reclaim_args *);
void ffs_snapgone(struct inode *);
Index: head/sys/ufs/ufs/ufs_inode.c
===================================================================
--- head/sys/ufs/ufs/ufs_inode.c
+++ head/sys/ufs/ufs/ufs_inode.c
@@ -63,6 +63,40 @@
#include <ufs/ufs/gjournal.h>
#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.
*/
Index: head/sys/ufs/ufs/ufs_vnops.c
===================================================================
--- head/sys/ufs/ufs/ufs_vnops.c
+++ head/sys/ufs/ufs/ufs_vnops.c
@@ -2742,6 +2742,7 @@
.vop_markatime = ufs_markatime,
.vop_mkdir = ufs_mkdir,
.vop_mknod = ufs_mknod,
+ .vop_need_inactive = ufs_need_inactive,
.vop_open = ufs_open,
.vop_pathconf = ufs_pathconf,
.vop_poll = vop_stdpoll,

File Metadata

Mime Type
text/plain
Expires
Wed, Apr 8, 9:59 AM (17 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31093337
Default Alt Text
D22616.id65456.diff (1 KB)

Event Timeline