#define VN_HOLD(V) ((vnode_t *) V)->i_count++
#endif
-#if defined(AFS_LINUX26_ENV)
+#if defined(AFS_LINUX24_ENV)
#define VN_RELE(V) iput((struct inode *) V)
#else
#define VN_RELE(V) osi_iput((struct inode *) V)
}
}
+#if !defined(AFS_LINUX24_ENV)
void
osi_clear_inode(struct inode *ip)
{
cred_t *credp = crref();
struct vcache *vcp = ITOAFS(ip);
-#if defined(AFS_LINUX24_ENV)
- if (atomic_read(&ip->i_count) > 1)
- printf("afs_put_inode: ino %ld (0x%lx) has count %ld\n",
- (long)ip->i_ino, (unsigned long)ip,
- (long)atomic_read(&ip->i_count));
-#else
if (ip->i_count > 1)
printf("afs_put_inode: ino %ld (0x%lx) has count %ld\n",
(long)ip->i_ino, (unsigned long)ip, (long)ip->i_count);
-#endif
afs_InactiveVCache(vcp, credp);
ObtainWriteLock(&vcp->lock, 504);
crfree(credp);
}
-#if !defined(AFS_LINUX26_ENV)
/* iput an inode. Since we still have a separate inode pool, we don't want
* to call iput on AFS inodes, since they would then end up on Linux's
* inode_unsed list.
#endif
}
-#if defined(AFS_LINUX26_ENV)
-static void
-afs_drop_inode(struct inode *ip)
-{
- generic_delete_inode(ip);
- AFS_GUNLOCK(); /* locked by afs_delete_inode() */
-}
-#endif
-
static void
afs_destroy_inode(struct inode *ip)
{
+ cred_t *credp = crref();
+
+ /* locked by clear_inode() */
+ put_inode_on_dummy_list(ip);
ip->i_state = 0;
+ afs_InactiveVCache(ITOAFS(ip), credp); /* afs_FlushVCache()? */
+ AFS_GUNLOCK();
+ crfree(credp);
}
* That will trigger the call to delete routine.
*/
+#if defined(AFS_LINUX24_ENV)
+static void
+afs_clear_inode(struct inode *ip)
+{
+ AFS_GLOCK(); /* unlocked by destroy_inode() */
+}
+#else
static void
afs_delete_inode(struct inode *ip)
{
-#if defined(AFS_LINUX26_ENV)
AFS_GLOCK(); /* after spin_unlock(inode_lock) */
- put_inode_on_dummy_list(ip);
- osi_clear_inode(ip);
-#else
- AFS_GLOCK();
osi_clear_inode(ip);
AFS_GUNLOCK();
-#endif
}
-
+#endif
/* afs_put_super
* Called from unmount to release super_block. */
}
struct super_operations afs_sops = {
-#if defined(AFS_LINUX26_ENV)
- .drop_inode = afs_drop_inode,
+#if defined(AFS_LINUX24_ENV)
.destroy_inode = afs_destroy_inode,
+ .clear_inode = afs_clear_inode,
+#else
+ .delete_inode = afs_delete_inode,
#endif
- .delete_inode = afs_delete_inode,
.write_inode = afs_write_inode,
.put_super = afs_put_super,
.statfs = afs_statfs,
goto done;
}
-#if !defined(AFS_LINUX26_ENV)
+#if !defined(AFS_LINUX24_ENV)
/* afs_dentry_iput */
static void
afs_dentry_iput(struct dentry *dp, struct inode *ip)
struct dentry_operations afs_dentry_operations = {
.d_revalidate = afs_linux_dentry_revalidate,
.d_delete = afs_dentry_delete,
-#if !defined(AFS_LINUX26_ENV)
+#if !defined(AFS_LINUX24_ENV)
.d_iput = afs_dentry_iput,
#endif
};