Whamcloud - gitweb
LU-8288 lfsck: handle dangling LOV EA reference
[fs/lustre-release.git] / lustre / lov / lov_offset.c
index d325e1c..fa7e456 100644 (file)
  *
  * You should have received a copy of the GNU General Public License
  * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * http://www.gnu.org/licenses/gpl-2.0.html
  *
  * GPL HEADER END
  */
@@ -27,7 +23,7 @@
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2012, 2014, Intel Corporation.
+ * Copyright (c) 2012, 2015, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -76,9 +72,9 @@ pgoff_t lov_stripe_pgoff(struct lov_stripe_md *lsm, pgoff_t stripe_index,
 {
        loff_t offset;
 
-       offset = lov_stripe_size(lsm, stripe_index << PAGE_CACHE_SHIFT,
+       offset = lov_stripe_size(lsm, (stripe_index << PAGE_SHIFT) + 1,
                                 stripe);
-       return offset >> PAGE_CACHE_SHIFT;
+       return offset >> PAGE_SHIFT;
 }
 
 /* we have an offset in file backed by an lov and want to find out where
@@ -239,7 +235,7 @@ int lov_stripe_intersects(struct lov_stripe_md *lsm, int stripeno,
         start_side = lov_stripe_offset(lsm, start, stripeno, obd_start);
         end_side = lov_stripe_offset(lsm, end, stripeno, obd_end);
 
-       CDEBUG(D_INODE, "["LPD64"->"LPD64"] -> [(%d) "LPD64"->"LPD64" (%d)]\n",
+       CDEBUG(D_INODE, "[%lld->%lld] -> [(%d) %lld->%lld (%d)]\n",
                start, end, start_side, *obd_start, *obd_end, end_side);
 
         /* this stripe doesn't intersect the file extent when neither