+static int lprocfs_rd_grant_speed(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+ struct ldlm_pool *pl = data;
+ int grant_speed;
+
+ spin_lock(&pl->pl_lock);
+ /* serialize with ldlm_pool_recalc */
+ grant_speed = cfs_atomic_read(&pl->pl_grant_rate) -
+ cfs_atomic_read(&pl->pl_cancel_rate);
+ spin_unlock(&pl->pl_lock);
+ return lprocfs_rd_uint(page, start, off, count, eof, &grant_speed);
+}
+