* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011, 2012, Whamcloud, Inc.
+ * Copyright (c) 2011, 2012, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
}
}
+#ifndef __REQ_WRITE /* pre-2.6.35 */
+#define __REQ_WRITE BIO_RW
+#endif
+
#ifdef HAVE_BIO_ENDIO_2ARG
#define DIO_RETURN(a)
static void dio_complete_routine(struct bio *bio, int error)
}
/* the check is outside of the cycle for performance reason -bzzz */
- if (!test_bit(BIO_RW, &bio->bi_rw)) {
+ if (!test_bit(__REQ_WRITE, &bio->bi_rw)) {
bio_for_each_segment(bvl, bio, i) {
if (likely(error == 0))
SetPageUptodate(bvl->bv_page);
osd_submit_bio(iobuf->dr_rw, bio);
}
- /* allocate new bio, limited by max BIO size, b=9945 */
- bio = bio_alloc(GFP_NOIO, max(BIO_MAX_PAGES,
- (npages - page_idx) *
- blocks_per_page));
+ /* allocate new bio */
+ bio = bio_alloc(GFP_NOIO, min(BIO_MAX_PAGES,
+ (npages - page_idx) *
+ blocks_per_page));
if (bio == NULL) {
CERROR("Can't allocate bio %u*%u = %u pages\n",
(npages - page_idx), blocks_per_page,
else
credits = osd_dto_credits_noquota[DTO_WRITE_BLOCK];
- OSD_DECLARE_OP(oh, write, credits);
+ osd_trans_declare_op(env, oh, OSD_OT_WRITE, credits);
inode = osd_dt_obj(dt)->oo_inode;
static int osd_ldiskfs_writelink(struct inode *inode, char *buffer, int buflen)
{
+ /* LU-2634: clear the extent format for fast symlink */
+ ldiskfs_clear_inode_flag(inode, LDISKFS_INODE_EXTENTS);
memcpy((char *)&LDISKFS_I(inode)->i_data, (char *)buffer, buflen);
LDISKFS_I(inode)->i_disksize = buflen;
ll_vfs_dq_init(inode);
/* XXX: don't check: one declared chunk can be used many times */
- /* OSD_EXEC_OP(handle, write); */
+ /* osd_trans_exec_op(env, handle, OSD_OT_WRITE); */
oh = container_of(handle, struct osd_thandle, ot_super);
LASSERT(oh->ot_handle->h_transaction != NULL);
* orphan list. if needed truncate will extend or restart
* transaction
*/
- OSD_DECLARE_OP(oh, punch,
- osd_dto_credits_noquota[DTO_ATTR_SET_BASE] + 3);
+ osd_trans_declare_op(env, oh, OSD_OT_PUNCH,
+ osd_dto_credits_noquota[DTO_ATTR_SET_BASE] + 3);
inode = osd_dt_obj(dt)->oo_inode;
LASSERT(inode);
oh = container_of(th, struct osd_thandle, ot_super);
LASSERT(oh->ot_handle->h_transaction != NULL);
- OSD_EXEC_OP(th, punch);
+ osd_trans_exec_op(env, th, OSD_OT_PUNCH);
tid = oh->ot_handle->h_transaction->t_tid;