From 20e2a2a96f744ef543fe38e23aa432a2257f023b Mon Sep 17 00:00:00 2001
From: anserper <anserper>
Date: Wed, 25 Jun 2008 20:59:32 +0000
Subject: [PATCH] Branch b1_6 b=14010 i=Alexey(shadow) i=Andreas(adilger)

type fixes
---
 lustre/include/lustre_dlm.h |  2 +-
 lustre/include/obd.h        |  4 ++--
 lustre/include/obd_class.h  |  4 ++--
 lustre/ldlm/ldlm_lock.c     |  4 ++--
 lustre/llite/file.c         | 37 +++++++++++++++++++++----------------
 lustre/lov/lov_obd.c        |  8 ++++----
 lustre/osc/osc_request.c    |  4 ++--
 7 files changed, 34 insertions(+), 29 deletions(-)

diff --git a/lustre/include/lustre_dlm.h b/lustre/include/lustre_dlm.h
index e3fe88f7a6..56c769b995 100644
--- a/lustre/include/lustre_dlm.h
+++ b/lustre/include/lustre_dlm.h
@@ -679,7 +679,7 @@ void ldlm_lock_addref(struct lustre_handle *lockh, __u32 mode);
 void ldlm_lock_decref(struct lustre_handle *lockh, __u32 mode);
 void ldlm_lock_decref_and_cancel(struct lustre_handle *lockh, __u32 mode);
 void ldlm_lock_allow_match(struct ldlm_lock *lock);
-int ldlm_lock_fast_match(struct ldlm_lock *, int, loff_t, loff_t, void **);
+int ldlm_lock_fast_match(struct ldlm_lock *, int, obd_off, obd_off, void **);
 void ldlm_lock_fast_release(void *, int);
 ldlm_mode_t ldlm_lock_match(struct ldlm_namespace *ns, int flags,
                             struct ldlm_res_id *, ldlm_type_t type,
diff --git a/lustre/include/obd.h b/lustre/include/obd.h
index 4dcdf8988e..e3458cbb4d 100644
--- a/lustre/include/obd.h
+++ b/lustre/include/obd.h
@@ -967,10 +967,10 @@ struct obd_ops {
         int (*o_reget_short_lock)(struct obd_export *exp,
                                  struct lov_stripe_md *lsm,
                                  void **res, int rw,
-                                 loff_t start, loff_t end,
+                                 obd_off start, obd_off end,
                                  void **cookie);
         int (*o_release_short_lock)(struct obd_export *exp,
-                                    struct lov_stripe_md *lsm, loff_t end,
+                                    struct lov_stripe_md *lsm, obd_off end,
                                     void *cookie, int rw);
         int (*o_queue_async_io)(struct obd_export *exp,
                                 struct lov_stripe_md *lsm,
diff --git a/lustre/include/obd_class.h b/lustre/include/obd_class.h
index a6d1483fce..ec94471335 100644
--- a/lustre/include/obd_class.h
+++ b/lustre/include/obd_class.h
@@ -986,7 +986,7 @@ static inline  int obd_prep_async_page(struct obd_export *exp,
 static inline int obd_reget_short_lock(struct obd_export *exp,
                                        struct lov_stripe_md *lsm,
                                        void **res, int rw,
-                                       loff_t start, loff_t end,
+                                       obd_off start, obd_off end,
                                        void **cookie)
 {
         ENTRY;
@@ -999,7 +999,7 @@ static inline int obd_reget_short_lock(struct obd_export *exp,
 }
 
 static inline int obd_release_short_lock(struct obd_export *exp,
-                                         struct lov_stripe_md *lsm, loff_t end,
+                                         struct lov_stripe_md *lsm, obd_off end,
                                          void *cookie, int rw)
 {
         ENTRY;
diff --git a/lustre/ldlm/ldlm_lock.c b/lustre/ldlm/ldlm_lock.c
index 64efe3f7ad..2c25f41405 100644
--- a/lustre/ldlm/ldlm_lock.c
+++ b/lustre/ldlm/ldlm_lock.c
@@ -927,8 +927,8 @@ void ldlm_lock_allow_match(struct ldlm_lock *lock)
 }
 
 int ldlm_lock_fast_match(struct ldlm_lock *lock, int rw,
-                                loff_t start, loff_t end,
-                                void **cookie)
+                         obd_off start, obd_off end,
+                         void **cookie)
 {
         LASSERT(rw == OBD_BRW_READ || rw == OBD_BRW_WRITE);
         /* should LCK_GROUP be handled in a special way? */
diff --git a/lustre/llite/file.c b/lustre/llite/file.c
index 66b9170315..a2c62cde39 100644
--- a/lustre/llite/file.c
+++ b/lustre/llite/file.c
@@ -1261,7 +1261,7 @@ static int iov_copy_update(unsigned long *nr_segs, const struct iovec **iov_out,
 }
 
 static int ll_reget_short_lock(struct page *page, int rw,
-                               loff_t start, loff_t end,
+                               obd_off start, obd_off end,
                                void **cookie)
 {
         struct ll_async_page *llap;
@@ -1283,7 +1283,7 @@ static int ll_reget_short_lock(struct page *page, int rw,
                                     cookie));
 }
 
-static void ll_release_short_lock(struct inode *inode, loff_t end,
+static void ll_release_short_lock(struct inode *inode, obd_off end,
                                   void *cookie, int rw)
 {
         struct obd_export *exp;
@@ -1300,7 +1300,7 @@ static void ll_release_short_lock(struct inode *inode, loff_t end,
 }
 
 static inline int ll_file_get_fast_lock(struct file *file,
-                                        loff_t ppos, loff_t end,
+                                        obd_off ppos, obd_off end,
                                         const struct iovec *iov,
                                         unsigned long nr_segs,
                                         void **cookie, int rw)
@@ -1331,7 +1331,7 @@ out:
         RETURN(rc);
 }
 
-static inline void ll_file_put_fast_lock(struct inode *inode, loff_t end,
+static inline void ll_file_put_fast_lock(struct inode *inode, obd_off end,
                                          void *cookie, int rw)
 {
         ll_release_short_lock(inode, end, cookie, rw);
@@ -1343,10 +1343,10 @@ enum ll_lock_style {
         LL_LOCK_STYLE_TREELOCK = 2
 };
 
-static inline int ll_file_get_lock(struct file *file, loff_t ppos, loff_t end,
-                                   const struct iovec *iov, unsigned long nr_segs,
-                                   void **cookie, struct ll_lock_tree *tree,
-                                   int rw)
+static inline int ll_file_get_lock(struct file *file, obd_off ppos,
+                                   obd_off end, const struct iovec *iov,
+                                   unsigned long nr_segs, void **cookie,
+                                   struct ll_lock_tree *tree, int rw)
 {
         int rc;
 
@@ -1369,9 +1369,10 @@ static inline int ll_file_get_lock(struct file *file, loff_t ppos, loff_t end,
         RETURN(rc);
 }
 
-static inline void ll_file_put_lock(struct inode *inode, loff_t end,
+static inline void ll_file_put_lock(struct inode *inode, obd_off end,
                                     enum ll_lock_style lock_style,
-                                    void *cookie, struct ll_lock_tree *tree, int rw)
+                                    void *cookie, struct ll_lock_tree *tree,
+                                    int rw)
 
 {
         switch (lock_style) {
@@ -1501,8 +1502,9 @@ repeat:
                 nrsegs_copy = nr_segs;
         }
 
-        lock_style = ll_file_get_lock(file, *ppos, end, iov_copy, nrsegs_copy,
-                                      &cookie, &tree, OBD_BRW_READ);
+        lock_style = ll_file_get_lock(file, (obd_off)(*ppos), (obd_off)end,
+                                      iov_copy, nrsegs_copy, &cookie, &tree,
+                                      OBD_BRW_READ);
         if (lock_style < 0)
                 GOTO(out, retval = lock_style);
 
@@ -1536,7 +1538,7 @@ repeat:
                 retval = ll_glimpse_size(inode, LDLM_FL_BLOCK_GRANTED);
                 if (retval) {
                         if (lock_style != LL_LOCK_STYLE_NOLOCK)
-                                ll_file_put_lock(inode, end, lock_style,
+                                ll_file_put_lock(inode, (obd_off)end, lock_style,
                                                  cookie, &tree, OBD_BRW_READ);
                         goto out;
                 }
@@ -1579,7 +1581,8 @@ repeat:
                 retval = generic_file_aio_read(iocb, iov_copy, nrsegs_copy,
                                                *ppos);
 #endif
-                ll_file_put_lock(inode, end, lock_style, cookie, &tree, OBD_BRW_READ);
+                ll_file_put_lock(inode, (obd_off)end, lock_style, cookie,
+                                 &tree, OBD_BRW_READ);
         } else {
                 retval = ll_file_lockless_io(file, iov_copy, nrsegs_copy, ppos,
                                              READ, chunk);
@@ -1721,8 +1724,10 @@ repeat:
         }
 
         tree_locked = ll_file_get_tree_lock_iov(&tree, file, iov_copy,
-                                                nrsegs_copy, lock_start,
-                                                lock_end, OBD_BRW_WRITE);
+                                                nrsegs_copy,
+                                                (obd_off)lock_start,
+                                                (obd_off)lock_end,
+                                                OBD_BRW_WRITE);
         if (tree_locked < 0)
                 GOTO(out, retval = tree_locked);
 
diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c
index 5ab5eedace..d005bc5090 100644
--- a/lustre/lov/lov_obd.c
+++ b/lustre/lov/lov_obd.c
@@ -2774,16 +2774,16 @@ EXPORT_SYMBOL(lov_stripe_unlock);
 static int lov_reget_short_lock(struct obd_export *exp,
                                 struct lov_stripe_md *lsm,
                                 void **res, int rw,
-                                loff_t start, loff_t end,
+                                obd_off start, obd_off end,
                                 void **cookie)
 {
         struct lov_async_page *l = *res;
-        loff_t stripe_start, stripe_end = start;
+        obd_off stripe_start, stripe_end = start;
 
         ENTRY;
 
         /* ensure we don't cross stripe boundaries */
-        lov_extent_calc(exp, lsm, OBD_CALC_STRIPE_END, (obd_off *)&stripe_end);
+        lov_extent_calc(exp, lsm, OBD_CALC_STRIPE_END, &stripe_end);
         if (stripe_end <= end)
                 RETURN(0);
 
@@ -2798,7 +2798,7 @@ static int lov_reget_short_lock(struct obd_export *exp,
 }
 
 static int lov_release_short_lock(struct obd_export *exp,
-                                  struct lov_stripe_md *lsm, loff_t end,
+                                  struct lov_stripe_md *lsm, obd_off end,
                                   void *cookie, int rw)
 {
         int stripe;
diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c
index 0ae446231e..c2f25eea6e 100644
--- a/lustre/osc/osc_request.c
+++ b/lustre/osc/osc_request.c
@@ -2468,7 +2468,7 @@ static int osc_enter_cache(struct client_obd *cli, struct lov_oinfo *loi,
 static int osc_reget_short_lock(struct obd_export *exp,
                                 struct lov_stripe_md *lsm,
                                 void **res, int rw,
-                                loff_t start, loff_t end,
+                                obd_off start, obd_off end,
                                 void **cookie)
 {
         struct osc_async_page *oap = *res;
@@ -2485,7 +2485,7 @@ static int osc_reget_short_lock(struct obd_export *exp,
 }
 
 static int osc_release_short_lock(struct obd_export *exp,
-                                  struct lov_stripe_md *lsm, loff_t end,
+                                  struct lov_stripe_md *lsm, obd_off end,
                                   void *cookie, int rw)
 {
         ENTRY;
-- 
GitLab