Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
landing b_cmobd_merge on HEAD
[fs/lustre-release.git]
/
lustre
/
obdfilter
/
filter_io_24.c
diff --git
a/lustre/obdfilter/filter_io_24.c
b/lustre/obdfilter/filter_io_24.c
index
a3464f3
..
a368f74
100644
(file)
--- a/
lustre/obdfilter/filter_io_24.c
+++ b/
lustre/obdfilter/filter_io_24.c
@@
-84,10
+84,8
@@
static int filter_direct_io(int rw, struct dentry *dchild, struct kiobuf *iobuf,
{
struct obd_device *obd = exp->exp_obd;
struct inode *inode = dchild->d_inode;
- struct page *page;
- unsigned long *b = iobuf->blocks;
- int rc, i, create = (rw == OBD_BRW_WRITE), blocks_per_page;
- int *cr, cleanup_phase = 0, *created = NULL;
+ int rc, create = (rw == OBD_BRW_WRITE), blocks_per_page;
+ int cleanup_phase = 0, *created = NULL;
int committed = 0;
ENTRY;
@@
-105,22
+103,11
@@
static int filter_direct_io(int rw, struct dentry *dchild, struct kiobuf *iobuf,
GOTO(cleanup, rc);
cleanup_phase = 2;
- down(&exp->exp_obd->u.filter.fo_alloc_lock);
- for (i = 0, cr = created, b = iobuf->blocks; i < iobuf->nr_pages; i++){
- page = iobuf->maplist[i];
-
- rc = fsfilt_map_inode_page(obd, inode, page, b, cr, create);
- if (rc) {
- CERROR("ino %lu, blk %lu cr %u create %d: rc %d\n",
- inode->i_ino, *b, *cr, create, rc);
- up(&exp->exp_obd->u.filter.fo_alloc_lock);
- GOTO(cleanup, rc);
- }
-
- b += blocks_per_page;
- cr += blocks_per_page;
- }
- up(&exp->exp_obd->u.filter.fo_alloc_lock);
+ rc = fsfilt_map_inode_pages(obd, inode, iobuf->maplist,
+ iobuf->nr_pages, iobuf->blocks, created,
+ create, &obd->u.filter.fo_alloc_lock);
+ if (rc)
+ GOTO(cleanup, rc);
filter_tally_write(&obd->u.filter, iobuf->maplist, iobuf->nr_pages,
iobuf->blocks, blocks_per_page);
@@
-155,14
+142,11
@@
static int filter_direct_io(int rw, struct dentry *dchild, struct kiobuf *iobuf,
if (rc < 0)
GOTO(cleanup, rc);
- rc =
brw_kiovec(WRITE, 1, &iobuf, inode->i_dev, iobuf->blocks,
- 1 << inode->i_blkbits);
+ rc =
fsfilt_send_bio(obd, inode, iobuf);
+
CDEBUG(D_INFO, "tried to write %d pages, rc = %d\n",
iobuf->nr_pages, rc);
- if (rc != (1 << inode->i_blkbits) * iobuf->nr_pages * blocks_per_page)
- CERROR("short write? expected %d, wrote %d\n",
- (1 << inode->i_blkbits) * iobuf->nr_pages *
- blocks_per_page, rc);
+
if (rc > 0)
rc = 0;
@@
-227,7
+211,7
@@
int filter_commitrw_write(struct obd_export *exp, struct obdo *oa, int objcount,
int rc)
{
struct obd_device *obd = exp->exp_obd;
- struct
obd
_run_ctxt saved;
+ struct
lvfs
_run_ctxt saved;
struct niobuf_local *lnb;
struct fsfilt_objinfo fso;
struct iattr iattr = { 0 };
@@
-287,7
+271,7
@@
int filter_commitrw_write(struct obd_export *exp, struct obdo *oa, int objcount,
iattr.ia_size = this_size;
}
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_
lvfs_
ctxt, NULL);
cleanup_phase = 2;
down(&inode->i_sem);
@@
-320,24
+304,22
@@
int filter_commitrw_write(struct obd_export *exp, struct obdo *oa, int objcount,
LASSERT(oti->oti_transno <= obd->obd_last_committed);
if (time_after(jiffies, now + 15 * HZ))
CERROR("slow commitrw commit %lus\n", (jiffies - now) / HZ);
-
cleanup:
filter_grant_commit(exp, niocount, res);
switch (cleanup_phase) {
case 2:
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_
lvfs_
ctxt, NULL);
LASSERT(current->journal_info == NULL);
case 1:
free_kiovec(1, &iobuf);
case 0:
for (i = 0, lnb = res; i < obj->ioo_bufcnt; i++, lnb++) {
- /* flip_.. gets a ref, while free_page only frees
- * when it decrefs to 0 */
- if (rc == 0)
- flip_into_page_cache(inode, lnb->page);
- __free_page(lnb->page);
+ filter_release_write_page(&obd->u.filter,
+ res->dentry->d_inode, lnb,
+ rc);
}
+
f_dput(res->dentry);
}