Changeset View
Changeset View
Standalone View
Standalone View
head/sys/fs/ext2fs/ext2_inode.c
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
#include <vm/vm.h> | #include <vm/vm.h> | ||||
#include <vm/vm_extern.h> | #include <vm/vm_extern.h> | ||||
#include <fs/ext2fs/inode.h> | #include <fs/ext2fs/inode.h> | ||||
#include <fs/ext2fs/ext2_mount.h> | #include <fs/ext2fs/ext2_mount.h> | ||||
#include <fs/ext2fs/ext2fs.h> | #include <fs/ext2fs/ext2fs.h> | ||||
#include <fs/ext2fs/fs.h> | #include <fs/ext2fs/fs.h> | ||||
#include <fs/ext2fs/ext2_extern.h> | #include <fs/ext2fs/ext2_extern.h> | ||||
#include <fs/ext2fs/ext2_extattr.h> | |||||
static int ext2_indirtrunc(struct inode *, daddr_t, daddr_t, | static int ext2_indirtrunc(struct inode *, daddr_t, daddr_t, | ||||
daddr_t, int, e4fs_daddr_t *); | daddr_t, int, e4fs_daddr_t *); | ||||
/* | /* | ||||
* Update the access, modified, and inode change times as specified by the | * Update the access, modified, and inode change times as specified by the | ||||
* IN_ACCESS, IN_UPDATE, and IN_CHANGE flags respectively. Write the inode | * IN_ACCESS, IN_UPDATE, and IN_CHANGE flags respectively. Write the inode | ||||
* to disk if the IN_MODIFIED flag is set (it may be set initially, or by | * to disk if the IN_MODIFIED flag is set (it may be set initially, or by | ||||
▲ Show 20 Lines • Show All 419 Lines • ▼ Show 20 Lines | ext2_inactive(struct vop_inactive_args *ap) | ||||
int mode, error = 0; | int mode, error = 0; | ||||
/* | /* | ||||
* Ignore inodes related to stale file handles. | * Ignore inodes related to stale file handles. | ||||
*/ | */ | ||||
if (ip->i_mode == 0) | if (ip->i_mode == 0) | ||||
goto out; | goto out; | ||||
if (ip->i_nlink <= 0) { | if (ip->i_nlink <= 0) { | ||||
ext2_extattr_free(ip); | |||||
error = ext2_truncate(vp, (off_t)0, 0, NOCRED, td); | error = ext2_truncate(vp, (off_t)0, 0, NOCRED, td); | ||||
ip->i_rdev = 0; | ip->i_rdev = 0; | ||||
mode = ip->i_mode; | mode = ip->i_mode; | ||||
ip->i_mode = 0; | ip->i_mode = 0; | ||||
ip->i_flag |= IN_CHANGE | IN_UPDATE; | ip->i_flag |= IN_CHANGE | IN_UPDATE; | ||||
ext2_vfree(vp, ip->i_number, mode); | ext2_vfree(vp, ip->i_number, mode); | ||||
} | } | ||||
if (ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) | if (ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) | ||||
Show All 31 Lines |