All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@zip.com.au>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: [patch 6/18] relax nr_to_write requirements
Date: Sun, 26 May 2002 13:41:04 -0700	[thread overview]
Message-ID: <3CF14860.30A48829@zip.com.au> (raw)



Relax the requirements on the writeback_mapping a_op.

This function is passed the number of pages which it should write.  The
current fs-writeback.c code will get confused if the address_space
writes back more pages than it was asked to.

With this change the address_space may write more pages than required
if that is convenient.  Extent-based fileystems may wish to do this.

=====================================

--- 2.5.18/fs/fs-writeback.c~relax-nr-to_write	Sat May 25 23:26:46 2002
+++ 2.5.18-akpm/fs/fs-writeback.c	Sun May 26 00:50:19 2002
@@ -257,7 +257,7 @@ static void sync_sb_inodes(struct super_
 		if (current_is_pdflush())
 			writeback_release(bdi);
 
-		if (nr_to_write && *nr_to_write == 0)
+		if (nr_to_write && *nr_to_write <= 0)
 			break;
 	}
 out:
@@ -301,7 +301,7 @@ void writeback_unlocked_inodes(int *nr_t
 					older_than_this);
 			spin_lock(&sb_lock);
 		}
-		if (nr_to_write && *nr_to_write == 0)
+		if (nr_to_write && *nr_to_write <= 0)
 			break;
 	}
 	spin_unlock(&sb_lock);
--- 2.5.18/Documentation/filesystems/Locking~relax-nr-to_write	Sat May 25 23:26:46 2002
+++ 2.5.18-akpm/Documentation/filesystems/Locking	Sun May 26 00:50:22 2002
@@ -179,11 +179,12 @@ existing instances of this method ->sync
 well-defined...
 
 	->writeback_mapping() is used for periodic writeback and for
-systemcall-initiated sync operations. The address_space should start
-I/O against at least *nr_to_write pages.  *nr_to_write must be decremented
-for each page which is written.  *nr_to_write must not go negative (this
-will be relaxed later).  If nr_to_write is NULL, all dirty pages must
-be written.
+systemcall-initiated sync operations.  The address_space should start
+I/O against at least *nr_to_write pages.  *nr_to_write must be
+decremented for each page which is written.  The address_space
+implementation may write more (or less) pages than *nr_to_write asks
+for, but it should try to be reasonably close.  If nr_to_write is NULL,
+all dirty pages must be written.
 
 	->vm_writeback() is called from the VM.  The address_space should
 start I/O against at least *nr_to_write pages, including the passed page. As


-

                 reply	other threads:[~2002-05-26 20:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3CF14860.30A48829@zip.com.au \
    --to=akpm@zip.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.