patch-2.2.17 linux/fs/affs/file.c

Next file: linux/fs/buffer.c
Previous file: linux/drivers/video/vfb.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.16/fs/affs/file.c linux/fs/affs/file.c
@@ -221,6 +221,8 @@
 
 	for (index = 0; index < 4; index++) {
 		kc = &inode->u.affs_i.i_ec->kc[index];
+		if (kc->kc_last == -1)		/* don't look in cache if invalid */
+			continue;
 		if (*ext == kc->kc_this_seq) {
 			return kc->kc_this_key;
 		} else if (*ext == kc->kc_this_seq + 1) {
@@ -893,7 +895,7 @@
 	/* Invalidate cache */
 	if (inode->u.affs_i.i_ec) {
 		inode->u.affs_i.i_ec->max_ext = 0;
-		for (key = 0; key < 3; key++) {
+		for (key = 0; key < 4; key++) {
 			inode->u.affs_i.i_ec->kc[key].kc_next_key = 0;
 			inode->u.affs_i.i_ec->kc[key].kc_last     = -1;
 		}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)