linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: nickpiggin@yahoo.com.au, hch@infradead.org
Cc: dhowells@redhat.com, nfsv4@linux-nfs.org,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: [PATCH 2/4] CacheFiles: Revert the addition of write_one_page()
Date: Fri, 03 Apr 2009 10:41:43 +0100	[thread overview]
Message-ID: <20090403094143.9510.80474.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <20090403094138.9510.80681.stgit@warthog.procyon.org.uk>

Revert the addition of the write_one_page() address space op as CacheFiles now
uses the write() file op instead.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 fs/ext2/inode.c    |    2 --
 fs/ext3/inode.c    |    3 ---
 include/linux/fs.h |    7 ------
 mm/filemap.c       |   61 ----------------------------------------------------
 4 files changed, 0 insertions(+), 73 deletions(-)


diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
index 2366895..b43b955 100644
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -799,7 +799,6 @@ const struct address_space_operations ext2_aops = {
 	.writepages		= ext2_writepages,
 	.migratepage		= buffer_migrate_page,
 	.is_partially_uptodate	= block_is_partially_uptodate,
-	.write_one_page		= generic_file_buffered_write_one_page,
 };
 
 const struct address_space_operations ext2_aops_xip = {
@@ -818,7 +817,6 @@ const struct address_space_operations ext2_nobh_aops = {
 	.direct_IO		= ext2_direct_IO,
 	.writepages		= ext2_writepages,
 	.migratepage		= buffer_migrate_page,
-	.write_one_page		= generic_file_buffered_write_one_page,
 };
 
 /*
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index 41e5d2d..716f964 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -1812,7 +1812,6 @@ static const struct address_space_operations ext3_ordered_aops = {
 	.direct_IO		= ext3_direct_IO,
 	.migratepage		= buffer_migrate_page,
 	.is_partially_uptodate  = block_is_partially_uptodate,
-	.write_one_page		= generic_file_buffered_write_one_page,
 };
 
 static const struct address_space_operations ext3_writeback_aops = {
@@ -1828,7 +1827,6 @@ static const struct address_space_operations ext3_writeback_aops = {
 	.direct_IO		= ext3_direct_IO,
 	.migratepage		= buffer_migrate_page,
 	.is_partially_uptodate  = block_is_partially_uptodate,
-	.write_one_page		= generic_file_buffered_write_one_page,
 };
 
 static const struct address_space_operations ext3_journalled_aops = {
@@ -1843,7 +1841,6 @@ static const struct address_space_operations ext3_journalled_aops = {
 	.invalidatepage		= ext3_invalidatepage,
 	.releasepage		= ext3_releasepage,
 	.is_partially_uptodate  = block_is_partially_uptodate,
-	.write_one_page		= generic_file_buffered_write_one_page,
 };
 
 void ext3_set_aops(struct inode *inode)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 0bf1f1e..a09e17c 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -532,11 +532,6 @@ struct address_space_operations {
 	int (*launder_page) (struct page *);
 	int (*is_partially_uptodate) (struct page *, read_descriptor_t *,
 					unsigned long);
-
-	/* write the contents of the source page over the page at the specified
-	 * index in the target address space (the source page does not need to
-	 * be related to the target address space) */
-	int (*write_one_page)(struct address_space *, pgoff_t, struct page *);
 };
 
 /*
@@ -2138,8 +2133,6 @@ extern ssize_t generic_file_direct_write(struct kiocb *, const struct iovec *,
 		unsigned long *, loff_t, loff_t *, size_t, size_t);
 extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *,
 		unsigned long, loff_t, loff_t *, size_t, ssize_t);
-extern int generic_file_buffered_write_one_page(struct address_space *,
-						pgoff_t, struct page *);
 extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos);
 extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos);
 extern int generic_segment_checks(const struct iovec *iov,
diff --git a/mm/filemap.c b/mm/filemap.c
index 15dda3c..a07d714 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2338,67 +2338,6 @@ generic_file_buffered_write(struct kiocb *iocb, const struct iovec *iov,
 }
 EXPORT_SYMBOL(generic_file_buffered_write);
 
-/**
- * generic_file_buffered_write_one_page - Write a single page of data to an
- *	inode
- * @mapping - The address space of the target inode
- * @index - The target page in the target inode to fill
- * @source - The data to write into the target page
- *
- * Write the data from the source page to the page in the nominated address
- * space at the @index specified.  Note that the file will not be extended if
- * the page crosses the EOF marker, in which case only the first part of the
- * page will be written.
- *
- * The @source page does not need to have any association with the file or the
- * target page offset.
- */
-int generic_file_buffered_write_one_page(struct address_space *mapping,
-					 pgoff_t index,
-					 struct page *source)
-{
-	const struct address_space_operations *a_ops = mapping->a_ops;
-	struct page *page;
-	unsigned len;
-	loff_t isize, pos;
-	void *fsdata;
-	int ret;
-
-	pos = index;
-	pos <<= PAGE_CACHE_SHIFT;
-
-	len = PAGE_CACHE_SIZE;
-	isize = i_size_read(mapping->host);
-	if ((isize >> PAGE_CACHE_SHIFT) == index)
-		len = isize & (PAGE_CACHE_SIZE - 1);
-
-	ret = pagecache_write_begin(NULL, mapping, pos, len,
-				    AOP_FLAG_UNINTERRUPTIBLE, &page, &fsdata);
-	if (ret < 0)
-		goto sync;
-
-	copy_highpage(page, source);
-
-	ret = pagecache_write_end(NULL, mapping, pos, len, len, page, fsdata);
-	if (ret < 0)
-		goto sync;
-
-	balance_dirty_pages_ratelimited(mapping);
-	cond_resched();
-
-sync:
-	/* the caller must handle O_SYNC themselves, but we handle S_SYNC and
-	 * MS_SYNCHRONOUS here */
-	if (unlikely(IS_SYNC(mapping->host)) && !a_ops->writepage)
-		ret = generic_osync_inode(mapping->host, mapping,
-					     OSYNC_METADATA | OSYNC_DATA);
-
-	/* the caller must handle O_DIRECT for themselves */
-
-	return ret;
-}
-EXPORT_SYMBOL(generic_file_buffered_write_one_page);
-
 static ssize_t
 __generic_file_aio_write_nolock(struct kiocb *iocb, const struct iovec *iov,
 				unsigned long nr_segs, loff_t *ppos)


  reply	other threads:[~2009-04-03  9:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-03  9:41 [PATCH 1/4] CacheFiles: Use the ->write() file op rather than a special kernel aop David Howells
2009-04-03  9:41 ` David Howells [this message]
2009-04-03 13:50   ` [PATCH 2/4] CacheFiles: Revert the addition of write_one_page() Christoph Hellwig
2009-04-03 13:53   ` David Howells
2009-04-04  5:55     ` Nick Piggin
2009-04-03  9:41 ` [PATCH 3/4] FS-Cache: Use a radix tree to track pages being written rather than a page flag David Howells
2009-04-03  9:41 ` [PATCH 4/4] FS-Cache: Revert the addition of PG_owner_priv2/PG_fscache_write David Howells
2009-04-03  9:51 ` [PATCH 1/4] CacheFiles: Use the ->write() file op rather than a special kernel aop David Howells
2009-04-03 13:49 ` Christoph Hellwig
2009-04-03 13:57 ` David Howells

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=20090403094143.9510.80474.stgit@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nfsv4@linux-nfs.org \
    --cc=nickpiggin@yahoo.com.au \
    /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).