patch-2.3.7 linux/fs/minix/truncate.c

Next file: linux/fs/msdos/namei.c
Previous file: linux/fs/minix/inode.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.6/linux/fs/minix/truncate.c linux/fs/minix/truncate.c
@@ -32,6 +32,9 @@
  * general case (size = XXX). I hope.
  */
 
+#define DATA_BUFFER_USED(bh) \
+	((bh->b_count > 1) || buffer_locked(bh))
+
 /*
  * The functions for minix V1 fs truncation.
  */
@@ -52,7 +55,7 @@
 			brelse(bh);
 			goto repeat;
 		}
-		if ((bh && bh->b_count != 1) || tmp != *p) {
+		if ((bh && DATA_BUFFER_USED(bh)) || tmp != *p) {
 			retry = 1;
 			brelse(bh);
 			continue;
@@ -103,7 +106,7 @@
 			brelse(bh);
 			goto repeat;
 		}
-		if ((bh && bh->b_count != 1) || tmp != *ind) {
+		if ((bh && DATA_BUFFER_USED(bh)) || tmp != *ind) {
 			retry = 1;
 			brelse(bh);
 			continue;
@@ -216,7 +219,7 @@
 			brelse(bh);
 			goto repeat;
 		}
-		if ((bh && bh->b_count != 1) || tmp != *p) {
+		if ((bh && DATA_BUFFER_USED(bh)) || tmp != *p) {
 			retry = 1;
 			brelse(bh);
 			continue;
@@ -267,7 +270,7 @@
 			brelse(bh);
 			goto repeat;
 		}
-		if ((bh && bh->b_count != 1) || tmp != *ind) {
+		if ((bh && DATA_BUFFER_USED(bh)) || tmp != *ind) {
 			retry = 1;
 			brelse(bh);
 			continue;

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