Whamcloud - gitweb
LU-4748 test: get one single qos_threshold_rr number
[fs/lustre-release.git] / lustre / lov / lov_offset.c
index cd13068..d29e87d 100644 (file)
@@ -43,7 +43,6 @@
 #endif
 
 #include <obd_class.h>
-#include <obd_lov.h>
 
 #include "lov_internal.h"
 
@@ -74,6 +73,19 @@ obd_size lov_stripe_size(struct lov_stripe_md *lsm, obd_size ost_size,
         RETURN(lov_size);
 }
 
+/**
+ * Compute file level page index by stripe level page offset
+ */
+pgoff_t lov_stripe_pgoff(struct lov_stripe_md *lsm, pgoff_t stripe_index,
+                        int stripe)
+{
+       obd_off offset;
+
+       offset = lov_stripe_size(lsm, stripe_index << PAGE_CACHE_SHIFT,
+                                stripe);
+       return offset >> PAGE_CACHE_SHIFT;
+}
+
 /* we have an offset in file backed by an lov and want to find out where
  * that offset lands in our given stripe of the file.  for the easy
  * case where the offset is within the stripe, we just have to scale the