#include <linux/lustre_snap.h>
#include "filter_internal.h"
+int *obdfilter_created_scratchpad;
+
static int filter_alloc_dio_page(struct obd_device *obd, struct inode *inode,
struct niobuf_local *lnb)
return grant;
}
-
static int filter_preprw_read(int cmd, struct obd_export *exp, struct obdo *oa,
int objcount, struct obd_ioobj *obj,
int niocount, struct niobuf_remote *nb,
struct niobuf_local *lnb;
struct dentry *dentry = NULL;
struct inode *inode;
- void *iobuf = NULL;
+ void *iobuf = NULL;
int rc = 0, i, tot_bytes = 0;
unsigned long now = jiffies;
ENTRY;
filter_grant_incoming(exp, oa);
oa->o_grant = 0;
-
spin_unlock(&obd->obd_osfs_lock);
}
inode = dentry->d_inode;
- if (time_after(jiffies, now + 15 * HZ))
- CERROR("slow preprw_read setup %lus\n", (jiffies - now) / HZ);
- else
- CDEBUG(D_INFO, "preprw_read setup: %lu jiffies\n",
- (jiffies - now));
+ fsfilt_check_slow(now, obd_timeout, "preprw_read setup");
for (i = 0, lnb = res, rnb = nb; i < obj->ioo_bufcnt;
i++, rnb++, lnb++) {
filter_iobuf_add_page(obd, iobuf, inode, lnb->page);
}
- if (time_after(jiffies, now + 15 * HZ))
- CERROR("slow start_page_read %lus\n", (jiffies - now) / HZ);
- else
- CDEBUG(D_INFO, "start_page_read: %lu jiffies\n",
- (jiffies - now));
+ fsfilt_check_slow(now, obd_timeout, "start_page_read");
rc = filter_direct_io(OBD_BRW_READ, dentry, iobuf, exp,
NULL, NULL, NULL);
fso.fso_dentry = dentry;
fso.fso_bufcnt = obj->ioo_bufcnt;
- if (time_after(jiffies, now + 15 * HZ))
- CERROR("slow preprw_write setup %lus\n", (jiffies - now) / HZ);
- else
- CDEBUG(D_INFO, "preprw_write setup: %lu jiffies\n",
- (jiffies - now));
+ fsfilt_check_slow(now, obd_timeout, "preprw_write setup");
spin_lock(&exp->exp_obd->obd_osfs_lock);
if (oa)
if (oa && oa->o_valid & OBD_MD_FLGRANT)
oa->o_grant = filter_grant(exp,oa->o_grant,oa->o_undirty,left);
+ /* We're finishing using body->oa as an input variable, so reset
+ * o_valid here. */
+ oa->o_valid = 0;
+
spin_unlock(&exp->exp_obd->obd_osfs_lock);
if (rc)
rc = filter_direct_io(OBD_BRW_READ, dentry, iobuf, exp,
NULL, NULL, NULL);
- if (time_after(jiffies, now + 15 * HZ))
- CERROR("slow start_page_write %lus\n", (jiffies - now) / HZ);
- else
- CDEBUG(D_INFO, "start_page_write: %lu jiffies\n",
- (jiffies - now));
+ fsfilt_check_slow(now, obd_timeout, "start_page_write");
lprocfs_counter_add(exp->exp_obd->obd_stats, LPROC_FILTER_WRITE_BYTES,
tot_bytes);