linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anton Altaparmakov <aia21@cam.ac.uk>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org,
	linux-ntfs-dev@lists.sourceforge.net
Subject: [PATCH 16/37] Re: [2.6-BK-URL] NTFS: 2.1.21 - Big update with race/bug fixes
Date: Tue, 19 Oct 2004 10:42:43 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.60.0410191042320.24986@hermes-1.csi.cam.ac.uk> (raw)
In-Reply-To: <Pine.LNX.4.60.0410191042200.24986@hermes-1.csi.cam.ac.uk>

This is patch 16/37 in the series.  It contains the following ChangeSet:

<aia21@cantab.net> (04/10/05 1.2022.1.2)
   NTFS: Switch fs/ntfs/index.h::ntfs_index_entry_mark_dirty() to using the
         new helper fs/ntfs/aops.c::mark_ntfs_record_dirty() and remove the no
         longer needed fs/ntfs/index.[hc]::__ntfs_index_entry_mark_dirty().
   
   Signed-off-by: Anton Altaparmakov <aia21@cantab.net>

Best regards,

	Anton
-- 
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/, http://www-stu.christs.cam.ac.uk/~aia21/

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

diff -Nru a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog
--- a/fs/ntfs/ChangeLog	2004-10-19 10:14:04 +01:00
+++ b/fs/ntfs/ChangeLog	2004-10-19 10:14:04 +01:00
@@ -51,6 +51,9 @@
 	  marks all buffers belonging to an ntfs record dirty, followed by
 	  marking the page the ntfs record is in dirty and also marking the vfs
 	  inode containing the ntfs record dirty (I_DIRTY_PAGES).
+	- Switch fs/ntfs/index.h::ntfs_index_entry_mark_dirty() to using the
+	  new helper fs/ntfs/aops.c::mark_ntfs_record_dirty() and remove the no
+	  longer needed fs/ntfs/index.[hc]::__ntfs_index_entry_mark_dirty().
 
 2.1.20 - Fix two stupid bugs introduced in 2.1.18 release.
 
diff -Nru a/fs/ntfs/index.c b/fs/ntfs/index.c
--- a/fs/ntfs/index.c	2004-10-19 10:14:04 +01:00
+++ b/fs/ntfs/index.c	2004-10-19 10:14:04 +01:00
@@ -459,58 +459,3 @@
 	err = -EIO;
 	goto err_out;
 }
-
-#ifdef NTFS_RW
-
-/**
- * __ntfs_index_entry_mark_dirty - mark an index allocation entry dirty
- * @ictx:	ntfs index context describing the index entry
- *
- * NOTE: You want to use fs/ntfs/index.h::ntfs_index_entry_mark_dirty() instead!
- * 
- * Mark the index allocation entry described by the index entry context @ictx
- * dirty.
- *
- * The index entry must be in an index block belonging to the index allocation
- * attribute.  Mark the buffers belonging to the index record as well as the
- * page cache page the index block is in dirty.  This automatically marks the
- * VFS inode of the ntfs index inode to which the index entry belongs dirty,
- * too (I_DIRTY_PAGES) and this in turn ensures the page buffers, and hence the
- * dirty index block, will be written out to disk later.
- */
-void __ntfs_index_entry_mark_dirty(ntfs_index_context *ictx)
-{
-	ntfs_inode *ni;
-	struct page *page;
-	struct buffer_head *bh, *head;
-	unsigned int rec_start, rec_end, bh_size, bh_start, bh_end;
-
-	BUG_ON(ictx->is_in_root);
-	ni = ictx->idx_ni;
-	page = ictx->page;
-	BUG_ON(!page_has_buffers(page));
-	/*
-	 * If the index block is the same size as the page cache page, set all
-	 * the buffers in the page, as well as the page itself, dirty.
-	 */
-	if (ni->itype.index.block_size == PAGE_CACHE_SIZE) {
-		__set_page_dirty_buffers(page);
-		return;
-	}
-	/* Set only the buffers in which the index block is located dirty. */
-	rec_start = (unsigned int)((u8*)ictx->ia - (u8*)page_address(page));
-	rec_end = rec_start + ni->itype.index.block_size;
-	bh_size = ni->vol->sb->s_blocksize;
-	bh_start = 0;
-	bh = head = page_buffers(page);
-	do {
-		bh_end = bh_start + bh_size;
-		if ((bh_start >= rec_start) && (bh_end <= rec_end))
-			set_buffer_dirty(bh);
-		bh_start = bh_end;
-	} while ((bh = bh->b_this_page) != head);
-	/* Finally, set the page itself dirty, too. */
-	__set_page_dirty_nobuffers(page);
-}
-
-#endif /* NTFS_RW */
diff -Nru a/fs/ntfs/index.h b/fs/ntfs/index.h
--- a/fs/ntfs/index.h	2004-10-19 10:14:04 +01:00
+++ b/fs/ntfs/index.h	2004-10-19 10:14:04 +01:00
@@ -30,6 +30,7 @@
 #include "inode.h"
 #include "attrib.h"
 #include "mft.h"
+#include "aops.h"
 
 /**
  * @idx_ni:	index inode containing the @entry described by this context
@@ -115,8 +116,6 @@
 		flush_dcache_page(ictx->page);
 }
 
-extern void __ntfs_index_entry_mark_dirty(ntfs_index_context *ictx);
-
 /**
  * ntfs_index_entry_mark_dirty - mark an index entry dirty
  * @ictx:	ntfs index context describing the index entry
@@ -140,7 +139,8 @@
 	if (ictx->is_in_root)
 		mark_mft_record_dirty(ictx->actx->ntfs_ino);
 	else
-		__ntfs_index_entry_mark_dirty(ictx);
+		mark_ntfs_record_dirty(ictx->idx_ni, ictx->page,
+			(u8*)ictx->ia - (u8*)page_address(ictx->page));
 }
 
 #endif /* NTFS_RW */

  reply	other threads:[~2004-10-19 10:00 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-19  9:37 [2.6-BK-URL] NTFS: 2.1.21 - Big update with race/bug fixes Anton Altaparmakov
2004-10-19  9:38 ` [PATCH 1/37] " Anton Altaparmakov
2004-10-19  9:39   ` [PATCH 2/37] " Anton Altaparmakov
2004-10-19  9:39     ` [PATCH 3/37] " Anton Altaparmakov
2004-10-19  9:39       ` [PATCH 4/37] " Anton Altaparmakov
2004-10-19  9:40         ` [PATCH 5/37] " Anton Altaparmakov
2004-10-19  9:40           ` [PATCH 6/37] " Anton Altaparmakov
2004-10-19  9:40             ` [PATCH 7/37] " Anton Altaparmakov
2004-10-19  9:40               ` [PATCH 8/37] " Anton Altaparmakov
2004-10-19  9:41                 ` [PATCH 9/37] " Anton Altaparmakov
2004-10-19  9:41                   ` [PATCH 10/37] " Anton Altaparmakov
2004-10-19  9:41                     ` [PATCH 11/37] " Anton Altaparmakov
2004-10-19  9:41                       ` [PATCH 12/37] " Anton Altaparmakov
2004-10-19  9:41                         ` [PATCH 13/37] " Anton Altaparmakov
2004-10-19  9:42                           ` [PATCH 14/37] " Anton Altaparmakov
2004-10-19  9:42                             ` [PATCH 15/37] " Anton Altaparmakov
2004-10-19  9:42                               ` Anton Altaparmakov [this message]
2004-10-19  9:42                                 ` [PATCH 17/37] " Anton Altaparmakov
2004-10-19  9:43                                   ` [PATCH 18/37] " Anton Altaparmakov
2004-10-19  9:43                                     ` [PATCH 19/37] " Anton Altaparmakov
2004-10-19  9:43                                       ` [PATCH 20/37] " Anton Altaparmakov
2004-10-19  9:43                                         ` [PATCH 21/37] " Anton Altaparmakov
2004-10-19  9:44                                           ` [PATCH 22/37] " Anton Altaparmakov
2004-10-19  9:44                                             ` [PATCH 23/37] " Anton Altaparmakov
2004-10-19  9:44                                               ` [PATCH 24/37] " Anton Altaparmakov
2004-10-19  9:44                                                 ` [PATCH 25/37] " Anton Altaparmakov
2004-10-19  9:45                                                   ` [PATCH 26/37] " Anton Altaparmakov
2004-10-19  9:45                                                     ` [PATCH 27/37] " Anton Altaparmakov
2004-10-19  9:45                                                       ` [PATCH 28/37] " Anton Altaparmakov
2004-10-19  9:45                                                         ` [PATCH 29/37] " Anton Altaparmakov
2004-10-19  9:46                                                           ` [PATCH 30/37] " Anton Altaparmakov
2004-10-19  9:46                                                             ` [PATCH 31/37] " Anton Altaparmakov
2004-10-19  9:46                                                               ` [PATCH 32/37] " Anton Altaparmakov
2004-10-19  9:46                                                                 ` [PATCH 33/37] " Anton Altaparmakov
2004-10-19  9:47                                                                   ` [PATCH 34/37] " Anton Altaparmakov
2004-10-19  9:47                                                                     ` [PATCH 35/37] " Anton Altaparmakov
2004-10-19  9:47                                                                       ` [PATCH 36/37] " Anton Altaparmakov
2004-10-19  9:48                                                                         ` [PATCH 37/37] " Anton Altaparmakov

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=Pine.LNX.4.60.0410191042320.24986@hermes-1.csi.cam.ac.uk \
    --to=aia21@cam.ac.uk \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-ntfs-dev@lists.sourceforge.net \
    --cc=torvalds@osdl.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).