From: anserper Date: Wed, 25 Jun 2008 21:34:56 +0000 (+0000) Subject: Branch b1_8 X-Git-Tag: v1_8_0_110~440 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=1d61c16b62ce7f40b8ceed60bdde4b251279f7ac;p=fs%2Flustre-release.git Branch b1_8 b=14010 i=Alexey(shadow) i=Andreas(adilger) type fixes --- diff --git a/lustre/include/lustre_dlm.h b/lustre/include/lustre_dlm.h index e3fe88f..56c769b 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 4dcdf89..e3458cb 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 a6d1483..ec94471 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 64efe3f..2c25f41 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 e29e9d2..825628a 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) { @@ -1405,7 +1406,7 @@ static ssize_t ll_file_aio_read(struct kiocb *iocb, const struct iovec *iov, struct ost_lvb lvb; struct ll_ra_read bead; int ra = 0; - loff_t end; + obd_off end; ssize_t retval, chunk, sum = 0; int lock_style; struct iovec *iov_copy = NULL; @@ -1466,8 +1467,7 @@ repeat: if (sbi->ll_max_rw_chunk != 0) { /* first, let's know the end of the current stripe */ end = *ppos; - obd_extent_calc(sbi->ll_osc_exp, lsm, OBD_CALC_STRIPE_END, - (obd_off *)&end); + obd_extent_calc(sbi->ll_osc_exp, lsm, OBD_CALC_STRIPE_END, &end); /* correct, the end is beyond the request */ if (end > *ppos + count - 1) @@ -1501,8 +1501,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), end, + iov_copy, nrsegs_copy, &cookie, &tree, + OBD_BRW_READ); if (lock_style < 0) GOTO(out, retval = lock_style); @@ -1579,7 +1580,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, end, lock_style, cookie, + &tree, OBD_BRW_READ); } else { retval = ll_file_lockless_io(file, iov_copy, nrsegs_copy, ppos, READ, chunk); @@ -1721,8 +1723,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 5ab5eed..d005bc5 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 0ae4462..c2f25ee 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;