Btrfs: avoid syncing log in the fast fsync path when not necessary
[deliverable/linux.git] / fs / btrfs / ordered-data.c
index 47966cb3d4b6272be7f961c264452b0bf9dc2cf2..ceccd078c93dd24480ae547f68148af4ea405993 100644 (file)
@@ -837,6 +837,20 @@ out:
        return entry;
 }
 
+bool btrfs_have_ordered_extents_in_range(struct inode *inode,
+                                        u64 file_offset,
+                                        u64 len)
+{
+       struct btrfs_ordered_extent *oe;
+
+       oe = btrfs_lookup_ordered_range(inode, file_offset, len);
+       if (oe) {
+               btrfs_put_ordered_extent(oe);
+               return true;
+       }
+       return false;
+}
+
 /*
  * lookup and return any extent before 'file_offset'.  NULL is returned
  * if none is found
This page took 0.025965 seconds and 5 git commands to generate.