Merge branch 'master' into upstream
[sfrench/cifs-2.6.git] / include / linux / pagemap.h
index 0a2f5d27f60e71b8630d5bd71e9f2821e6251b33..64f95092515120a517ba53c97a606c600a66e40c 100644 (file)
@@ -130,14 +130,29 @@ static inline pgoff_t linear_page_index(struct vm_area_struct *vma,
 }
 
 extern void FASTCALL(__lock_page(struct page *page));
+extern void FASTCALL(__lock_page_nosync(struct page *page));
 extern void FASTCALL(unlock_page(struct page *page));
 
+/*
+ * lock_page may only be called if we have the page's inode pinned.
+ */
 static inline void lock_page(struct page *page)
 {
        might_sleep();
        if (TestSetPageLocked(page))
                __lock_page(page);
 }
+
+/*
+ * lock_page_nosync should only be used if we can't pin the page's inode.
+ * Doesn't play quite so well with block device plugging.
+ */
+static inline void lock_page_nosync(struct page *page)
+{
+       might_sleep();
+       if (TestSetPageLocked(page))
+               __lock_page_nosync(page);
+}
        
 /*
  * This is exported only for wait_on_page_locked/wait_on_page_writeback.