X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Finclude%2Fobd_class.h;h=324fa1f53f8f8eadd16d60a5303f8928d817f441;hp=d734870665746300e751f34e393da8b7ce8ff313;hb=1ad64953c611a4f8bcb436bc269b7a85820e23c2;hpb=7e7e9d14a3532f7184582060d6a7b9f6c4a296d3 diff --git a/lustre/include/obd_class.h b/lustre/include/obd_class.h index d734870..324fa1f 100644 --- a/lustre/include/obd_class.h +++ b/lustre/include/obd_class.h @@ -1212,6 +1212,29 @@ static inline int obd_prep_async_page(struct obd_export *exp, RETURN(ret); } +/** + * Checks if requested extent lock is compatible with a lock under the page. + * + * Checks if the lock under \a page is compatible with a read or write lock + * (specified by \a rw) for an extent [\a start , \a end]. + * + * \param exp obd export (lov or osc) + * \param lsm striping information for the file + * \param res async_page placeholder + * \param rw OBD_BRW_READ if requested for reading, + * OBD_BRW_WRITE if requested for writing + * \param start start of the requested extent + * \param end end of the requested extent + * \param cookie transparent parameter for passing locking context + * + * \post result == 1, *cookie == context, appropriate lock is referenced or + * + * \retval 1 owned lock is reused for the request + * \retval 0 no lock reused for the request + * \retval -ENOTSUPP reget_short_lock is not exported at this layer + * + * \see obd_release_short_lock + */ static inline int obd_reget_short_lock(struct obd_export *exp, struct lov_stripe_md *lsm, void **res, int rw, @@ -1227,6 +1250,24 @@ static inline int obd_reget_short_lock(struct obd_export *exp, start, end, cookie)); } + +/** + * Releases a reference to a lock taken in a "fast" way. + * + * Releases a read or write (specified by \a rw) lock + * referenced by \a cookie. + * + * \param exp obd export (lov or osc) + * \param lsm striping information for the file + * \param end end of the locked extent + * \param rw OBD_BRW_READ if requested for reading, + * OBD_BRW_WRITE if requested for writing + * \param cookie transparent parameter for passing locking context + * + * \post appropriate lock is dereferenced + * + * \see obd_reget_short_lock + */ static inline int obd_release_short_lock(struct obd_export *exp, struct lov_stripe_md *lsm, obd_off end, void *cookie, int rw)