]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: use truncate_inode_pages instead of vmtruncate
authorSage Weil <sage@newdream.net>
Tue, 9 Sep 2008 14:53:41 +0000 (07:53 -0700)
committerSage Weil <sage@newdream.net>
Tue, 9 Sep 2008 18:32:57 +0000 (11:32 -0700)
src/kernel/addr.c
src/kernel/inode.c

index 296ce137dcf419ffcff975af7775fc8a77cd633b..671ab127be5994418e8e7baf83f894ee90f0ea22 100644 (file)
@@ -172,10 +172,14 @@ static void ceph_invalidatepage(struct page *page, unsigned long offset)
                ClearPageChecked(page);
        if (!PageDirty(page)) {
                BUG_ON(snapc);
+               dout(20, "invalidatepage %p idx %lu clean\n", page,
+                    page->index);
                return;
        }
        if (!page->mapping) {
                BUG_ON(snapc);
+               dout(20, "invalidatepage %p idx %lu unmapped\n", page,
+                    page->index);
                return;
        }
        inode = page->mapping->host;
index d05ced34587ad9d7daaa89e35358b5a11f9b55a7..2b778324cecba41730e744a04391a9e24c12570e 100644 (file)
@@ -1183,6 +1183,9 @@ void ceph_vmtruncate_work(struct work_struct *work)
        mutex_unlock(&inode->i_mutex);
 }
 
+/*
+ * called with i_mutex held
+ */
 void __ceph_do_pending_vmtruncate(struct inode *inode)
 {
        struct ceph_inode_info *ci = ceph_inode(inode);
@@ -1197,7 +1200,7 @@ void __ceph_do_pending_vmtruncate(struct inode *inode)
 
        if (to >= 0) {
                dout(10, "__do_pending_vmtruncate %p to %lld\n", inode, to);
-               vmtruncate(inode, to);
+               truncate_inode_pages(inode->i_mapping, to);
                if (wrbuffer_refs == 0)
                        ceph_check_caps(ci, 0);
        } else