Skip to content

Commit

Permalink
Remove dmu_write_pages() support
Browse files Browse the repository at this point in the history
For the moment we do not use dmu_write_pages() to write pages
directly in to a dmu object.  It may be required at some point
in the future, but for now is simplest and cleanest to drop it.
It can be easily readded if/when needed.
  • Loading branch information
behlendorf committed Feb 10, 2011
1 parent eb28321 commit 6149f4c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 61 deletions.
4 changes: 0 additions & 4 deletions include/sys/dmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -522,10 +522,6 @@ int dmu_write_uio(objset_t *os, uint64_t object, struct uio *uio, uint64_t size,
dmu_tx_t *tx);
int dmu_write_uio_dbuf(dmu_buf_t *zdb, struct uio *uio, uint64_t size,
dmu_tx_t *tx);
#ifdef HAVE_ZPL
int dmu_write_pages(objset_t *os, uint64_t object, uint64_t offset,
uint64_t size, struct page *pp, dmu_tx_t *tx);
#endif
#endif
struct arc_buf *dmu_request_arcbuf(dmu_buf_t *handle, int size);
void dmu_return_arcbuf(struct arc_buf *buf);
Expand Down
57 changes: 0 additions & 57 deletions module/zfs/dmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1268,63 +1268,6 @@ dmu_write_uio(objset_t *os, uint64_t object, uio_t *uio, uint64_t size,

return (err);
}

#ifdef HAVE_ZPL
int
dmu_write_pages(objset_t *os, uint64_t object, uint64_t offset, uint64_t size,
page_t *pp, dmu_tx_t *tx)
{
dmu_buf_t **dbp;
int numbufs, i;
int err;

if (size == 0)
return (0);

err = dmu_buf_hold_array(os, object, offset, size,
FALSE, FTAG, &numbufs, &dbp);
if (err)
return (err);

for (i = 0; i < numbufs; i++) {
int tocpy, copied, thiscpy;
int bufoff;
dmu_buf_t *db = dbp[i];
caddr_t va;

ASSERT(size > 0);
ASSERT3U(db->db_size, >=, PAGESIZE);

bufoff = offset - db->db_offset;
tocpy = (int)MIN(db->db_size - bufoff, size);

ASSERT(i == 0 || i == numbufs-1 || tocpy == db->db_size);

if (tocpy == db->db_size)
dmu_buf_will_fill(db, tx);
else
dmu_buf_will_dirty(db, tx);

for (copied = 0; copied < tocpy; copied += PAGESIZE) {
ASSERT3U(pp->p_offset, ==, db->db_offset + bufoff);
thiscpy = MIN(PAGESIZE, tocpy - copied);
va = zfs_map_page(pp, S_READ);
bcopy(va, (char *)db->db_data + bufoff, thiscpy);
zfs_unmap_page(pp, va);
pp = pp->p_next;
bufoff += PAGESIZE;
}

if (tocpy == db->db_size)
dmu_buf_fill_done(db, tx);

offset += tocpy;
size -= tocpy;
}
dmu_buf_rele_array(dbp, numbufs, FTAG);
return (err);
}
#endif /* HAVE_ZPL */
#endif /* _KERNEL */

/*
Expand Down

0 comments on commit 6149f4c

Please sign in to comment.