atomic_inc(&filter->fo_r_in_flight);
lprocfs_oh_tally(&filter->fo_filter_stats.hist[BRW_R_RPC_HIST],
atomic_read(&filter->fo_r_in_flight));
- lprocfs_oh_tally_log2(&filter->fo_filter_stats.hist[BRW_R_DISK_IOSIZE], size);
+ lprocfs_oh_tally_log2(&filter->fo_filter_stats.hist[BRW_R_DISK_IOSIZE],
+ size);
lprocfs_oh_tally(&exp->exp_filter_data.fed_brw_stats.hist[BRW_R_RPC_HIST],
atomic_read(&filter->fo_r_in_flight));
lprocfs_oh_tally_log2(&exp->exp_filter_data.fed_brw_stats.hist[BRW_R_DISK_IOSIZE], size);
atomic_inc(&filter->fo_w_in_flight);
lprocfs_oh_tally(&filter->fo_filter_stats.hist[BRW_W_RPC_HIST],
atomic_read(&filter->fo_w_in_flight));
- lprocfs_oh_tally_log2(&filter->fo_filter_stats.hist[BRW_W_DISK_IOSIZE], size);
+ lprocfs_oh_tally_log2(&filter->fo_filter_stats.hist[BRW_W_DISK_IOSIZE],
+ size);
lprocfs_oh_tally(&exp->exp_filter_data.fed_brw_stats.hist[BRW_W_RPC_HIST],
atomic_read(&filter->fo_w_in_flight));
lprocfs_oh_tally_log2(&exp->exp_filter_data.fed_brw_stats.hist[BRW_W_DISK_IOSIZE], size);
spin_lock_init(&iobuf->dr_lock);
iobuf->dr_max_pages = num_pages;
iobuf->dr_npages = 0;
+ iobuf->dr_error = 0;
RETURN(iobuf);
static void filter_clear_iobuf(struct filter_iobuf *iobuf)
{
iobuf->dr_npages = 0;
+ iobuf->dr_error = 0;
atomic_set(&iobuf->dr_numreqs, 0);
}
wait_event(iobuf->dr_wait, atomic_read(&iobuf->dr_numreqs) == 0);
if (rw == OBD_BRW_READ) {
- lprocfs_oh_tally(&obd->u.filter.fo_filter_stats.hist[BRW_R_DIO_FRAGS], frags);
+ lprocfs_oh_tally(&obd->u.filter.fo_filter_stats.hist[BRW_R_DIO_FRAGS],
+ frags);
lprocfs_oh_tally(&exp->exp_filter_data.fed_brw_stats.hist[BRW_R_DIO_FRAGS],
frags);
lprocfs_oh_tally_log2(&obd->u.filter.fo_filter_stats.hist[BRW_R_IO_TIME],
jiffies - start_time);
- lprocfs_oh_tally_log2(&exp->exp_filter_data.fed_brw_stats.hist[BRW_R_IO_TIME],
- jiffies - start_time);
+ lprocfs_oh_tally_log2(&exp->exp_filter_data.fed_brw_stats.hist[BRW_R_IO_TIME], jiffies - start_time);
} else {
- lprocfs_oh_tally(&obd->u.filter.fo_filter_stats.hist[BRW_W_DIO_FRAGS], frags);
+ lprocfs_oh_tally(&obd->u.filter.fo_filter_stats.hist[BRW_W_DIO_FRAGS],
+ frags);
lprocfs_oh_tally(&exp->exp_filter_data.fed_brw_stats.hist[BRW_W_DIO_FRAGS],
frags);
lprocfs_oh_tally_log2(&obd->u.filter.fo_filter_stats.hist[BRW_W_IO_TIME],
jiffies - start_time);
- lprocfs_oh_tally_log2(&exp->exp_filter_data.fed_brw_stats.hist[BRW_W_IO_TIME],
- jiffies - start_time);
+ lprocfs_oh_tally_log2(&exp->exp_filter_data.fed_brw_stats.hist[BRW_W_IO_TIME], jiffies - start_time);
}
if (rc == 0)
if (!locked)
LOCK_INODE_MUTEX(inode);
if (inode->i_mapping->nrpages) {
+#ifdef PF_SYNCWRITE
current->flags |= PF_SYNCWRITE;
+#endif
rc = filemap_fdatawrite(inode->i_mapping);
if (rc == 0)
rc = filemap_fdatawait(inode->i_mapping);
+#ifdef PF_SYNCWRITE
current->flags &= ~PF_SYNCWRITE;
+#endif
}
if (!locked)
UNLOCK_INODE_MUTEX(inode);
return rc;
}
-
/* Clear pages from the mapping before we do direct IO to that offset.
* Now that the only source of such pages in the truncate path flushes
* these pages to disk and then discards them, this is error condition.
create = 1;
sem = &obd->u.filter.fo_alloc_lock;
- lquota_enforce(filter_quota_interface_ref, obd,
- iobuf->dr_ignore_quota);
+ lquota_enforce(filter_quota_interface_ref, obd, iobuf->dr_ignore_quota);
}
rc = fsfilt_map_inode_pages(obd, inode, iobuf->dr_pages,
if (rw == OBD_BRW_WRITE) {
if (rc == 0) {
- filter_tally_write(exp, iobuf->dr_pages,
- iobuf->dr_npages, iobuf->dr_blocks,
- blocks_per_page);
+ filter_tally(exp, iobuf->dr_pages,
+ iobuf->dr_npages, iobuf->dr_blocks,
+ blocks_per_page, 1);
if (attr->ia_size > inode->i_size)
attr->ia_valid |= ATTR_SIZE;
rc = fsfilt_setattr(obd, dchild,
UNLOCK_INODE_MUTEX(inode);
- rc2 = filter_finish_transno(exp, oti, 0);
+ rc2 = filter_finish_transno(exp, oti, 0, 0);
if (rc2 != 0) {
CERROR("can't close transaction: %d\n", rc2);
if (rc == 0)
rc = rc2;
}
- rc2 =fsfilt_commit_async(obd,inode,oti->oti_handle,wait_handle);
+ rc2 = fsfilt_commit_async(obd,inode,oti->oti_handle,
+ wait_handle);
if (rc == 0)
rc = rc2;
if (rc != 0)
RETURN(rc);
} else if (rc == 0) {
- filter_tally_read(exp, iobuf->dr_pages,
- iobuf->dr_npages, iobuf->dr_blocks,
- blocks_per_page);
+ filter_tally(exp, iobuf->dr_pages, iobuf->dr_npages,
+ iobuf->dr_blocks, blocks_per_page, 0);
}
rc = filter_clear_page_cache(inode, iobuf);