LVBO lvbo_update call was using ldlm_resource as parameter,
the ldlm_lock parameter is added to recognize DoM resource
in MDT LVBO functions and perform DoM specific actions.
Signed-off-by: Mikhal Pershin <mike.pershin@intel.com>
Change-Id: Id1cfee12bfc13893206c771f45acf7dd44da56ba
Reviewed-on: https://review.whamcloud.com/28016
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
* of ldlm_[res_]lvbo_[init,update,fill]() functions.
*/
struct ldlm_valblock_ops {
* of ldlm_[res_]lvbo_[init,update,fill]() functions.
*/
struct ldlm_valblock_ops {
- int (*lvbo_init)(struct ldlm_resource *res);
- int (*lvbo_update)(struct ldlm_resource *res,
- struct ptlrpc_request *r,
- int increase);
- int (*lvbo_free)(struct ldlm_resource *res);
+ int (*lvbo_init)(struct ldlm_resource *res);
+ int (*lvbo_update)(struct ldlm_resource *res, struct ldlm_lock *lock,
+ struct ptlrpc_request *r, int increase);
+ int (*lvbo_free)(struct ldlm_resource *res);
/* Return size of lvb data appropriate RPC size can be reserved */
int (*lvbo_size)(struct ldlm_lock *lock);
/* Called to fill in lvb data to RPC buffer @buf */
/* Return size of lvb data appropriate RPC size can be reserved */
int (*lvbo_size)(struct ldlm_lock *lock);
/* Called to fill in lvb data to RPC buffer @buf */
* Update Lock Value Block Operations (LVBO) on a resource taking into account
* data from request \a r
*/
* Update Lock Value Block Operations (LVBO) on a resource taking into account
* data from request \a r
*/
-static inline int ldlm_res_lvbo_update(struct ldlm_resource *res,
- struct ptlrpc_request *req, int increase)
+static inline int ldlm_lvbo_update(struct ldlm_resource *res,
+ struct ldlm_lock *lock,
+ struct ptlrpc_request *req, int increase)
+ struct ldlm_namespace *ns = ldlm_res_to_ns(res);
int rc;
/* delayed lvb init may be required */
int rc;
/* delayed lvb init may be required */
- if (ldlm_res_to_ns(res)->ns_lvbo &&
- ldlm_res_to_ns(res)->ns_lvbo->lvbo_update) {
- return ldlm_res_to_ns(res)->ns_lvbo->lvbo_update(res, req,
- increase);
- }
+ if (ns->ns_lvbo && ns->ns_lvbo->lvbo_update)
+ return ns->ns_lvbo->lvbo_update(res, lock, req, increase);
+
+static inline int ldlm_res_lvbo_update(struct ldlm_resource *res,
+ struct ptlrpc_request *req, int increase)
+{
+ return ldlm_lvbo_update(res, NULL, req, increase);
+}
+
int ldlm_error2errno(enum ldlm_error error);
enum ldlm_error ldlm_errno2error(int err_no); /* don't call it `errno': this
* confuses user-space. */
int ldlm_error2errno(enum ldlm_error error);
enum ldlm_error ldlm_errno2error(int err_no); /* don't call it `errno': this
* confuses user-space. */
res = ldlm_resource_getref(lock->l_resource);
res = ldlm_resource_getref(lock->l_resource);
- ldlm_res_lvbo_update(res, NULL, 1);
+ ldlm_lvbo_update(res, lock, NULL, 1);
ldlm_lock_cancel(lock);
if (!exp->exp_obd->obd_stopping)
ldlm_reprocess_all(res);
ldlm_lock_cancel(lock);
if (!exp->exp_obd->obd_stopping)
ldlm_reprocess_all(res);
/* update lvbo to return proper attributes.
* see bug 23174 */
ldlm_resource_getref(res);
/* update lvbo to return proper attributes.
* see bug 23174 */
ldlm_resource_getref(res);
- ldlm_res_lvbo_update(res, NULL, 1);
+ ldlm_lvbo_update(res, lock, NULL, 1);
ldlm_resource_putref(res);
}
ldlm_lock_cancel(lock);
ldlm_resource_putref(res);
}
ldlm_lock_cancel(lock);
} else if (rc == -ELDLM_NO_LOCK_DATA) {
LDLM_DEBUG(lock, "lost race - client has a lock but no "
"inode");
} else if (rc == -ELDLM_NO_LOCK_DATA) {
LDLM_DEBUG(lock, "lost race - client has a lock but no "
"inode");
- ldlm_res_lvbo_update(lock->l_resource, NULL, 1);
+ ldlm_lvbo_update(lock->l_resource, lock, NULL, 1);
} else if (rc != 0) {
rc = ldlm_handle_ast_error(lock, req, rc, "glimpse");
} else {
} else if (rc != 0) {
rc = ldlm_handle_ast_error(lock, req, rc, "glimpse");
} else {
- rc = ldlm_res_lvbo_update(lock->l_resource, req, 1);
+ rc = ldlm_lvbo_update(lock->l_resource, lock, req, 1);
}
break;
case LDLM_BL_CALLBACK:
}
break;
case LDLM_BL_CALLBACK:
if (res != NULL) {
ldlm_resource_getref(res);
LDLM_RESOURCE_ADDREF(res);
if (res != NULL) {
ldlm_resource_getref(res);
LDLM_RESOURCE_ADDREF(res);
- ldlm_res_lvbo_update(res, NULL, 1);
+
+ if (!ldlm_is_discard_data(lock))
+ ldlm_lvbo_update(res, lock, NULL, 1);
}
static int mdt_lvbo_update(struct ldlm_resource *res,
}
static int mdt_lvbo_update(struct ldlm_resource *res,
+ struct ldlm_lock *lock,
struct ptlrpc_request *req,
int increase_only)
{
struct ptlrpc_request *req,
int increase_only)
{
*
* Called with res->lr_lvb_sem held.
*
*
* Called with res->lr_lvb_sem held.
*
- * \param[in] res LDLM resource
+ * \param[in] lock LDLM lock on resource
*
* \retval 0 on successful setup
* \retval negative value on error
*
* \retval 0 on successful setup
* \retval negative value on error
* \a req != NULL : called by the DLM itself after a glimpse callback
* \a req == NULL : called by the OFD after a disk write
*
* \a req != NULL : called by the DLM itself after a glimpse callback
* \a req == NULL : called by the OFD after a disk write
*
- * \param[in] res LDLM resource
+ * \param[in] lock LDLM lock
* \param[in] req PTLRPC request
* \param[in] increase_only don't allow LVB values to decrease
*
* \retval 0 on successful setup
* \retval negative value on error
*/
* \param[in] req PTLRPC request
* \param[in] increase_only don't allow LVB values to decrease
*
* \retval 0 on successful setup
* \retval negative value on error
*/
-static int ofd_lvbo_update(struct ldlm_resource *res,
+static int ofd_lvbo_update(struct ldlm_resource *res, struct ldlm_lock *lock,
struct ptlrpc_request *req, int increase_only)
{
struct ofd_device *ofd;
struct ptlrpc_request *req, int increase_only)
{
struct ofd_device *ofd;