X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;ds=sidebyside;f=lustre%2Fosc%2Fosc_internal.h;h=9b6c19b602dc4a7270615dc6803a595604be8053;hb=1dce0d2706dfe8ae4d85c33d251c9320eb484088;hp=e3e6013f13ee8359dc266d1ee9d535bc91615fe3;hpb=d4f89c82b4f8668518635af8cd924ff25bbb5762;p=fs%2Flustre-release.git diff --git a/lustre/osc/osc_internal.h b/lustre/osc/osc_internal.h index e3e6013..9b6c19b 100644 --- a/lustre/osc/osc_internal.h +++ b/lustre/osc/osc_internal.h @@ -30,6 +30,9 @@ struct osc_async_page { struct obd_async_page_ops *oap_caller_ops; void *oap_caller_data; + struct list_head oap_page_list; + struct ldlm_lock *oap_ldlm_lock; + spinlock_t oap_lock; }; #define oap_page oap_brw_page.pg @@ -54,7 +57,7 @@ struct osc_cache_waiter { #define OSCC_FLAG_LOW 0x10 #define OSCC_FLAG_EXITING 0x20 -int osc_precreate(struct obd_export *exp, int need_create); +int osc_precreate(struct obd_export *exp); int osc_create(struct obd_export *exp, struct obdo *oa, struct lov_stripe_md **ea, struct obd_trans_info *oti); int osc_real_create(struct obd_export *exp, struct obdo *oa, @@ -64,10 +67,27 @@ void osc_wake_cache_waiters(struct client_obd *cli); #ifdef LPROCFS int lproc_osc_attach_seqstat(struct obd_device *dev); +void lprocfs_osc_init_vars(struct lprocfs_static_vars *lvars); #else static inline int lproc_osc_attach_seqstat(struct obd_device *dev) {return 0;} +static inline void lprocfs_osc_init_vars(struct lprocfs_static_vars *lvars) +{ + memset(lvars, 0, sizeof(*lvars)); +} #endif +static inline int osc_recoverable_error(int rc) +{ + return (rc == -EIO || rc == -EROFS || rc == -ENOMEM || rc == -EAGAIN); +} + +/* return 1 if osc should be resend request */ +static inline int osc_should_resend(int resend, struct client_obd *cli) +{ + return atomic_read(&cli->cl_resends) ? + atomic_read(&cli->cl_resends) > resend : 1; +} + #ifndef min_t #define min_t(type,x,y) \ ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })