Changes  page->mapping handling in UFS

Signed-off-by: KAMEZAWA Hiroyuki <[EMAIL PROTECTED]>

---
 fs/ufs/dir.c  |   10 +++++-----
 fs/ufs/util.c |    2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

Index: test-2.6.23-rc4-mm1/fs/ufs/dir.c
===================================================================
--- test-2.6.23-rc4-mm1.orig/fs/ufs/dir.c
+++ test-2.6.23-rc4-mm1/fs/ufs/dir.c
@@ -42,7 +42,7 @@ static inline int ufs_match(struct super
 
 static int ufs_commit_chunk(struct page *page, loff_t pos, unsigned len)
 {
-       struct address_space *mapping = page->mapping;
+       struct address_space *mapping = page_mapping_cache(page);
        struct inode *dir = mapping->host;
        int err = 0;
 
@@ -95,7 +95,7 @@ void ufs_set_link(struct inode *dir, str
        int err;
 
        lock_page(page);
-       err = __ufs_write_begin(NULL, page->mapping, pos, len,
+       err = __ufs_write_begin(NULL, page_mapping_cache(page), pos, len,
                                AOP_FLAG_UNINTERRUPTIBLE, &page, NULL);
        BUG_ON(err);
 
@@ -111,7 +111,7 @@ void ufs_set_link(struct inode *dir, str
 
 static void ufs_check_page(struct page *page)
 {
-       struct inode *dir = page->mapping->host;
+       struct inode *dir = page_inode(page);
        struct super_block *sb = dir->i_sb;
        char *kaddr = page_address(page);
        unsigned offs, rec_len;
@@ -381,7 +381,7 @@ int ufs_add_link(struct dentry *dentry, 
 got_it:
        pos = page_offset(page) +
                        (char*)de - (char*)page_address(page);
-       err = __ufs_write_begin(NULL, page->mapping, pos, rec_len,
+       err = __ufs_write_begin(NULL, page_mapping_cache(page), pos, rec_len,
                                AOP_FLAG_UNINTERRUPTIBLE, &page, NULL);
        if (err)
                goto out_unlock;
@@ -518,7 +518,7 @@ int ufs_delete_entry(struct inode *inode
                     struct page * page)
 {
        struct super_block *sb = inode->i_sb;
-       struct address_space *mapping = page->mapping;
+       struct address_space *mapping = page_mapping_cache(page);
        char *kaddr = page_address(page);
        unsigned from = ((char*)dir - kaddr) & 
~(UFS_SB(sb)->s_uspi->s_dirblksize - 1);
        unsigned to = ((char*)dir - kaddr) + fs16_to_cpu(sb, dir->d_reclen);
Index: test-2.6.23-rc4-mm1/fs/ufs/util.c
===================================================================
--- test-2.6.23-rc4-mm1.orig/fs/ufs/util.c
+++ test-2.6.23-rc4-mm1/fs/ufs/util.c
@@ -263,7 +263,7 @@ struct page *ufs_get_locked_page(struct 
 
                lock_page(page);
 
-               if (unlikely(page->mapping == NULL)) {
+               if (unlikely(!page_is_pagecache(page))) {
                        /* Truncate got there first */
                        unlock_page(page);
                        page_cache_release(page);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to