4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 only,
8 * as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License version 2 for more details (a copy is included
14 * in the LICENSE file that accompanied this code).
16 * You should have received a copy of the GNU General Public License
17 * version 2 along with this program; If not, see
18 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
20 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
21 * CA 95054 USA or visit www.sun.com if you need additional information or
27 * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
28 * Use is subject to license terms.
31 * Copyright (c) 2012, 2013, Intel Corporation.
32 * Use is subject to license terms.
35 * This file is part of Lustre, http://www.lustre.org/
36 * Lustre is a trademark of Sun Microsystems, Inc.
38 * lustre/osd-zfs/osd_io.c
40 * Author: Alex Zhuravlev <bzzz@whamcloud.com>
41 * Author: Mike Pershin <tappro@whamcloud.com>
45 # define EXPORT_SYMTAB
47 #define DEBUG_SUBSYSTEM S_OSD
49 #include <lustre_ver.h>
50 #include <libcfs/libcfs.h>
51 #include <lustre_fsfilt.h>
52 #include <obd_support.h>
53 #include <lustre_net.h>
55 #include <obd_class.h>
56 #include <lustre_disk.h>
57 #include <lustre_fid.h>
59 #include "osd_internal.h"
61 #include <sys/dnode.h>
66 #include <sys/spa_impl.h>
67 #include <sys/zfs_znode.h>
68 #include <sys/dmu_tx.h>
69 #include <sys/dmu_objset.h>
70 #include <sys/dsl_prop.h>
71 #include <sys/sa_impl.h>
74 static char *osd_zerocopy_tag = "zerocopy";
76 static ssize_t osd_read(const struct lu_env *env, struct dt_object *dt,
77 struct lu_buf *buf, loff_t *pos,
78 struct lustre_capa *capa)
80 struct osd_object *obj = osd_dt_obj(dt);
81 struct osd_device *osd = osd_obj2dev(obj);
83 int size = buf->lb_len;
86 LASSERT(dt_object_exists(dt));
89 read_lock(&obj->oo_attr_lock);
90 old_size = obj->oo_attr.la_size;
91 read_unlock(&obj->oo_attr_lock);
93 if (*pos + size > old_size) {
97 size = old_size - *pos;
100 rc = -dmu_read(osd->od_objset.os, obj->oo_db->db_object, *pos, size,
101 buf->lb_buf, DMU_READ_PREFETCH);
106 /* XXX: workaround for bug in HEAD: fsfilt_ldiskfs_read() returns
107 * requested number of bytes, not actually read ones */
108 if (S_ISLNK(obj->oo_dt.do_lu.lo_header->loh_attr))
114 static ssize_t osd_declare_write(const struct lu_env *env, struct dt_object *dt,
115 const loff_t size, loff_t pos,
118 struct osd_object *obj = osd_dt_obj(dt);
119 struct osd_device *osd = osd_obj2dev(obj);
120 struct osd_thandle *oh;
124 oh = container_of0(th, struct osd_thandle, ot_super);
126 /* in some cases declare can race with creation (e.g. llog)
127 * and we need to wait till object is initialized. notice
128 * LOHA_EXISTs is supposed to be the last step in the
131 /* declare possible size change. notice we can't check
132 * current size here as another thread can change it */
134 if (dt_object_exists(dt)) {
136 oid = obj->oo_db->db_object;
138 dmu_tx_hold_sa(oh->ot_tx, obj->oo_sa_hdl, 0);
140 oid = DMU_NEW_OBJECT;
141 dmu_tx_hold_sa_create(oh->ot_tx, ZFS_SA_BASE_ATTR_SIZE);
144 dmu_tx_hold_write(oh->ot_tx, oid, pos, size);
146 /* dt_declare_write() is usually called for system objects, such
147 * as llog or last_rcvd files. We needn't enforce quota on those
148 * objects, so always set the lqi_space as 0. */
149 RETURN(osd_declare_quota(env, osd, obj->oo_attr.la_uid,
150 obj->oo_attr.la_gid, 0, oh, true, NULL,
154 static ssize_t osd_write(const struct lu_env *env, struct dt_object *dt,
155 const struct lu_buf *buf, loff_t *pos,
156 struct thandle *th, struct lustre_capa *capa,
159 struct osd_object *obj = osd_dt_obj(dt);
160 struct osd_device *osd = osd_obj2dev(obj);
161 udmu_objset_t *uos = &osd->od_objset;
162 struct osd_thandle *oh;
163 uint64_t offset = *pos;
167 LASSERT(dt_object_exists(dt));
171 oh = container_of0(th, struct osd_thandle, ot_super);
173 dmu_write(osd->od_objset.os, obj->oo_db->db_object, offset,
174 (uint64_t)buf->lb_len, buf->lb_buf, oh->ot_tx);
175 write_lock(&obj->oo_attr_lock);
176 if (obj->oo_attr.la_size < offset + buf->lb_len) {
177 obj->oo_attr.la_size = offset + buf->lb_len;
178 write_unlock(&obj->oo_attr_lock);
179 /* osd_object_sa_update() will be copying directly from oo_attr
180 * into dbuf. any update within a single txg will copy the
182 rc = osd_object_sa_update(obj, SA_ZPL_SIZE(uos),
183 &obj->oo_attr.la_size, 8, oh);
187 write_unlock(&obj->oo_attr_lock);
198 * XXX: for the moment I don't want to use lnb_flags for osd-internal
199 * purposes as it's not very well defined ...
200 * instead I use the lowest bit of the address so that:
201 * arc buffer: .lnb_obj = abuf (arc we loan for write)
202 * dbuf buffer: .lnb_obj = dbuf | 1 (dbuf we get for read)
203 * copy buffer: .lnb_page->mapping = obj (page we allocate for write)
207 static int osd_bufs_put(const struct lu_env *env, struct dt_object *dt,
208 struct niobuf_local *lnb, int npages)
210 struct osd_object *obj = osd_dt_obj(dt);
211 struct osd_device *osd = osd_obj2dev(obj);
215 LASSERT(dt_object_exists(dt));
218 for (i = 0; i < npages; i++) {
219 if (lnb[i].page == NULL)
221 if (lnb[i].page->mapping == (void *)obj) {
222 /* this is anonymous page allocated for copy-write */
223 lnb[i].page->mapping = NULL;
224 __free_page(lnb[i].page);
225 cfs_atomic_dec(&osd->od_zerocopy_alloc);
227 /* see comment in osd_bufs_get_read() */
228 ptr = (unsigned long)lnb[i].dentry;
231 dmu_buf_rele((void *)ptr, osd_zerocopy_tag);
232 cfs_atomic_dec(&osd->od_zerocopy_pin);
233 } else if (lnb[i].dentry != NULL) {
234 dmu_return_arcbuf((void *)lnb[i].dentry);
235 cfs_atomic_dec(&osd->od_zerocopy_loan);
239 lnb[i].dentry = NULL;
245 static inline struct page *kmem_to_page(void *addr)
247 if (is_vmalloc_addr(addr))
248 return vmalloc_to_page(addr);
250 return virt_to_page(addr);
253 static int osd_bufs_get_read(const struct lu_env *env, struct osd_object *obj,
254 loff_t off, ssize_t len, struct niobuf_local *lnb)
256 struct osd_device *osd = osd_obj2dev(obj);
258 int rc, i, numbufs, npages = 0;
261 /* grab buffers for read:
262 * OSD API let us to grab buffers first, then initiate IO(s)
263 * so that all required IOs will be done in parallel, but at the
264 * moment DMU doesn't provide us with a method to grab buffers.
265 * If we discover this is a vital for good performance we
266 * can get own replacement for dmu_buf_hold_array_by_bonus().
269 rc = -dmu_buf_hold_array_by_bonus(obj->oo_db, off, len, TRUE,
270 osd_zerocopy_tag, &numbufs,
275 for (i = 0; i < numbufs; i++) {
276 int bufoff, tocpy, thispage;
281 cfs_atomic_inc(&osd->od_zerocopy_pin);
283 bufoff = off - dbp[i]->db_offset;
284 tocpy = min_t(int, dbp[i]->db_size - bufoff, len);
286 /* kind of trick to differentiate dbuf vs. arcbuf */
287 LASSERT(((unsigned long)dbp[i] & 1) == 0);
288 dbf = (void *) ((unsigned long)dbp[i] | 1);
291 thispage = PAGE_CACHE_SIZE;
292 thispage -= bufoff & (PAGE_CACHE_SIZE - 1);
293 thispage = min(tocpy, thispage);
296 lnb->lnb_file_offset = off;
297 lnb->lnb_page_offset = bufoff & ~CFS_PAGE_MASK;
299 lnb->page = kmem_to_page(dbp[i]->db_data +
301 /* mark just a single slot: we need this
302 * reference to dbuf to be release once */
315 /* steal dbuf so dmu_buf_rele_array() cant release it */
319 dmu_buf_rele_array(dbp, numbufs, osd_zerocopy_tag);
326 osd_bufs_put(env, &obj->oo_dt, lnb - npages, npages);
330 static int osd_bufs_get_write(const struct lu_env *env, struct osd_object *obj,
331 loff_t off, ssize_t len, struct niobuf_local *lnb)
333 struct osd_device *osd = osd_obj2dev(obj);
334 int plen, off_in_block, sz_in_block;
335 int i = 0, npages = 0;
341 dmu_object_size_from_db(obj->oo_db, &bs, &dummy);
344 * currently only full blocks are subject to zerocopy approach:
345 * so that we're sure nobody is trying to update the same block
348 LASSERT(npages < PTLRPC_MAX_BRW_PAGES);
350 off_in_block = off & (bs - 1);
351 sz_in_block = min_t(int, bs - off_in_block, len);
353 if (sz_in_block == bs) {
354 /* full block, try to use zerocopy */
356 abuf = dmu_request_arcbuf(obj->oo_db, bs);
357 if (unlikely(abuf == NULL))
358 GOTO(out_err, -ENOMEM);
360 cfs_atomic_inc(&osd->od_zerocopy_loan);
362 /* go over pages arcbuf contains, put them as
363 * local niobufs for ptlrpc's bulks */
364 while (sz_in_block > 0) {
365 plen = min_t(int, sz_in_block, PAGE_CACHE_SIZE);
367 lnb[i].lnb_file_offset = off;
368 lnb[i].lnb_page_offset = 0;
371 if (sz_in_block == bs)
372 lnb[i].dentry = (void *)abuf;
374 lnb[i].dentry = NULL;
376 /* this one is not supposed to fail */
377 lnb[i].page = kmem_to_page(abuf->b_data +
379 LASSERT(lnb[i].page);
381 lprocfs_counter_add(osd->od_stats,
382 LPROC_OSD_ZEROCOPY_IO, 1);
387 off_in_block += plen;
392 if (off_in_block == 0 && len < bs &&
393 off + len >= obj->oo_attr.la_size)
394 lprocfs_counter_add(osd->od_stats,
395 LPROC_OSD_TAIL_IO, 1);
397 /* can't use zerocopy, allocate temp. buffers */
398 while (sz_in_block > 0) {
399 plen = min_t(int, sz_in_block, PAGE_CACHE_SIZE);
401 lnb[i].lnb_file_offset = off;
402 lnb[i].lnb_page_offset = 0;
405 lnb[i].dentry = NULL;
407 lnb[i].page = alloc_page(OSD_GFP_IO);
408 if (unlikely(lnb[i].page == NULL))
409 GOTO(out_err, -ENOMEM);
411 LASSERT(lnb[i].page->mapping == NULL);
412 lnb[i].page->mapping = (void *)obj;
414 cfs_atomic_inc(&osd->od_zerocopy_alloc);
415 lprocfs_counter_add(osd->od_stats,
416 LPROC_OSD_COPY_IO, 1);
430 osd_bufs_put(env, &obj->oo_dt, lnb, npages);
434 static int osd_bufs_get(const struct lu_env *env, struct dt_object *dt,
435 loff_t offset, ssize_t len, struct niobuf_local *lnb,
436 int rw, struct lustre_capa *capa)
438 struct osd_object *obj = osd_dt_obj(dt);
441 LASSERT(dt_object_exists(dt));
445 rc = osd_bufs_get_read(env, obj, offset, len, lnb);
447 rc = osd_bufs_get_write(env, obj, offset, len, lnb);
452 static int osd_write_prep(const struct lu_env *env, struct dt_object *dt,
453 struct niobuf_local *lnb, int npages)
455 struct osd_object *obj = osd_dt_obj(dt);
457 LASSERT(dt_object_exists(dt));
463 /* Return number of blocks that aren't mapped in the [start, start + size]
465 static int osd_count_not_mapped(struct osd_object *obj, uint64_t start,
468 dmu_buf_impl_t *dbi = (dmu_buf_impl_t *)obj->oo_db;
479 if (dn->dn_maxblkid == 0) {
480 if (start + size <= dn->dn_datablksz)
482 if (start < dn->dn_datablksz)
483 start = dn->dn_datablksz;
484 /* assume largest block size */
485 blkshift = SPA_MAXBLOCKSHIFT;
487 /* blocksize can't change */
488 blkshift = dn->dn_datablkshift;
491 /* compute address of last block */
492 end = (start + size - 1) >> blkshift;
493 /* align start on block boundaries */
496 /* size is null, can't be mapped */
497 if (obj->oo_attr.la_size == 0 || dn->dn_maxblkid == 0)
498 GOTO(out, size = (end - start + 1) << blkshift);
500 /* beyond EOF, can't be mapped */
501 if (start > dn->dn_maxblkid)
502 GOTO(out, size = (end - start + 1) << blkshift);
505 for (blkid = start; blkid <= end; blkid++) {
506 if (blkid == dn->dn_maxblkid)
507 /* this one is mapped for sure */
509 if (blkid > dn->dn_maxblkid) {
510 size += (end - blkid + 1) << blkshift;
514 rc = dbuf_hold_impl(dn, 0, blkid, TRUE, FTAG, &db);
516 /* for ENOENT (block not mapped) and any other errors,
517 * assume the block isn't mapped */
518 size += 1 << blkshift;
530 static int osd_declare_write_commit(const struct lu_env *env,
531 struct dt_object *dt,
532 struct niobuf_local *lnb, int npages,
535 struct osd_object *obj = osd_dt_obj(dt);
536 struct osd_device *osd = osd_obj2dev(obj);
537 struct osd_thandle *oh;
540 int i, rc, flags = 0;
541 bool ignore_quota = false, synced = false;
545 LASSERT(dt_object_exists(dt));
551 oh = container_of0(th, struct osd_thandle, ot_super);
553 for (i = 0; i < npages; i++) {
555 /* ENOSPC, network RPC error, etc.
556 * We don't want to book space for pages which will be
557 * skipped in osd_write_commit(). Hence we skip pages
558 * with lnb_rc != 0 here too */
560 /* ignore quota for the whole request if any page is from
561 * client cache or written by root.
563 * XXX once we drop the 1.8 client support, the checking
564 * for whether page is from cache can be simplified as:
565 * !(lnb[i].flags & OBD_BRW_SYNC)
567 * XXX we could handle this on per-lnb basis as done by
569 if ((lnb[i].flags & OBD_BRW_NOQUOTA) ||
570 (lnb[i].flags & (OBD_BRW_FROM_GRANT | OBD_BRW_SYNC)) ==
574 /* first valid lnb */
575 offset = lnb[i].lnb_file_offset;
579 if (offset + size == lnb[i].lnb_file_offset) {
580 /* this lnb is contiguous to the previous one */
585 dmu_tx_hold_write(oh->ot_tx, obj->oo_db->db_object, offset,size);
587 /* estimating space that will be consumed by a write is rather
588 * complicated with ZFS. As a consequence, we don't account for
589 * indirect blocks and quota overrun will be adjusted once the
590 * operation is committed, if required. */
591 space += osd_count_not_mapped(obj, offset, size);
593 offset = lnb->lnb_file_offset;
598 dmu_tx_hold_write(oh->ot_tx, obj->oo_db->db_object, offset,size);
599 space += osd_count_not_mapped(obj, offset, size);
602 dmu_tx_hold_sa(oh->ot_tx, obj->oo_sa_hdl, 0);
604 oh->ot_write_commit = 1; /* used in osd_trans_start() for fail_loc */
606 /* backend zfs filesystem might be configured to store multiple data
608 space *= osd->od_objset.os->os_copies;
610 CDEBUG(D_QUOTA, "writting %d pages, reserving "LPD64"K of quota "
611 "space\n", npages, space);
614 /* acquire quota space if needed */
615 rc = osd_declare_quota(env, osd, obj->oo_attr.la_uid,
616 obj->oo_attr.la_gid, space, oh, true, &flags,
619 if (!synced && rc == -EDQUOT && (flags & QUOTA_FL_SYNC) != 0) {
620 dt_sync(env, th->th_dev);
622 CDEBUG(D_QUOTA, "retry after sync\n");
627 /* we need only to store the overquota flags in the first lnb for
628 * now, once we support multiple objects BRW, this code needs be
630 if (flags & QUOTA_FL_OVER_USRQUOTA)
631 lnb[0].flags |= OBD_BRW_OVER_USRQUOTA;
632 if (flags & QUOTA_FL_OVER_GRPQUOTA)
633 lnb[0].flags |= OBD_BRW_OVER_GRPQUOTA;
638 static int osd_write_commit(const struct lu_env *env, struct dt_object *dt,
639 struct niobuf_local *lnb, int npages,
642 struct osd_object *obj = osd_dt_obj(dt);
643 struct osd_device *osd = osd_obj2dev(obj);
644 udmu_objset_t *uos = &osd->od_objset;
645 struct osd_thandle *oh;
646 uint64_t new_size = 0;
650 LASSERT(dt_object_exists(dt));
654 oh = container_of0(th, struct osd_thandle, ot_super);
656 for (i = 0; i < npages; i++) {
657 CDEBUG(D_INODE, "write %u bytes at %u\n",
658 (unsigned) lnb[i].len,
659 (unsigned) lnb[i].lnb_file_offset);
662 /* ENOSPC, network RPC error, etc.
663 * Unlike ldiskfs, zfs allocates new blocks on rewrite,
664 * so we skip this page if lnb_rc is set to -ENOSPC */
665 CDEBUG(D_INODE, "obj "DFID": skipping lnb[%u]: rc=%d\n",
666 PFID(lu_object_fid(&dt->do_lu)), i,
671 if (lnb[i].page->mapping == (void *)obj) {
672 dmu_write(osd->od_objset.os, obj->oo_db->db_object,
673 lnb[i].lnb_file_offset, lnb[i].len,
674 kmap(lnb[i].page), oh->ot_tx);
676 } else if (lnb[i].dentry) {
677 LASSERT(((unsigned long)lnb[i].dentry & 1) == 0);
678 /* buffer loaned for zerocopy, try to use it.
679 * notice that dmu_assign_arcbuf() is smart
680 * enough to recognize changed blocksize
681 * in this case it fallbacks to dmu_write() */
682 dmu_assign_arcbuf(obj->oo_db, lnb[i].lnb_file_offset,
683 (void *)lnb[i].dentry, oh->ot_tx);
684 /* drop the reference, otherwise osd_put_bufs()
685 * will be releasing it - bad! */
686 lnb[i].dentry = NULL;
687 cfs_atomic_dec(&osd->od_zerocopy_loan);
690 if (new_size < lnb[i].lnb_file_offset + lnb[i].len)
691 new_size = lnb[i].lnb_file_offset + lnb[i].len;
694 if (unlikely(new_size == 0)) {
695 /* no pages to write, no transno is needed */
697 /* it is important to return 0 even when all lnb_rc == -ENOSPC
698 * since ofd_commitrw_write() retries several times on ENOSPC */
702 write_lock(&obj->oo_attr_lock);
703 if (obj->oo_attr.la_size < new_size) {
704 obj->oo_attr.la_size = new_size;
705 write_unlock(&obj->oo_attr_lock);
706 /* osd_object_sa_update() will be copying directly from
707 * oo_attr into dbuf. any update within a single txg will copy
709 rc = osd_object_sa_update(obj, SA_ZPL_SIZE(uos),
710 &obj->oo_attr.la_size, 8, oh);
712 write_unlock(&obj->oo_attr_lock);
718 static int osd_read_prep(const struct lu_env *env, struct dt_object *dt,
719 struct niobuf_local *lnb, int npages)
721 struct osd_object *obj = osd_dt_obj(dt);
726 LASSERT(dt_object_exists(dt));
729 for (i = 0; i < npages; i++) {
730 buf.lb_buf = kmap(lnb[i].page);
731 buf.lb_len = lnb[i].len;
732 offset = lnb[i].lnb_file_offset;
734 CDEBUG(D_OTHER, "read %u bytes at %u\n",
735 (unsigned) lnb[i].len,
736 (unsigned) lnb[i].lnb_file_offset);
737 lnb[i].rc = osd_read(env, dt, &buf, &offset, NULL);
740 if (lnb[i].rc < buf.lb_len) {
741 /* all subsequent rc should be 0 */
752 * Punch/truncate an object
754 * IN: db - dmu_buf of the object to free data in.
755 * off - start of section to free.
756 * len - length of section to free (DMU_OBJECT_END => to EOF).
758 * RETURN: 0 if success
759 * error code if failure
761 * The transaction passed to this routine must have
762 * dmu_tx_hold_sa() and if off < size, dmu_tx_hold_free()
763 * called and then assigned to a transaction group.
765 static int __osd_object_punch(objset_t *os, dmu_buf_t *db, dmu_tx_t *tx,
766 uint64_t size, uint64_t off, uint64_t len)
770 /* Assert that the transaction has been assigned to a
771 transaction group. */
772 LASSERT(tx->tx_txg != 0);
774 * Nothing to do if file already at desired length.
776 if (len == DMU_OBJECT_END && size == off)
780 rc = -dmu_free_range(os, db->db_object, off, len, tx);
785 static int osd_punch(const struct lu_env *env, struct dt_object *dt,
786 __u64 start, __u64 end, struct thandle *th,
787 struct lustre_capa *capa)
789 struct osd_object *obj = osd_dt_obj(dt);
790 struct osd_device *osd = osd_obj2dev(obj);
791 udmu_objset_t *uos = &osd->od_objset;
792 struct osd_thandle *oh;
797 LASSERT(dt_object_exists(dt));
798 LASSERT(osd_invariant(obj));
801 oh = container_of0(th, struct osd_thandle, ot_super);
803 write_lock(&obj->oo_attr_lock);
805 if (end == OBD_OBJECT_EOF || end >= obj->oo_attr.la_size)
806 len = DMU_OBJECT_END;
809 write_unlock(&obj->oo_attr_lock);
811 rc = __osd_object_punch(osd->od_objset.os, obj->oo_db, oh->ot_tx,
812 obj->oo_attr.la_size, start, len);
814 if (len == DMU_OBJECT_END) {
815 write_lock(&obj->oo_attr_lock);
816 obj->oo_attr.la_size = start;
817 write_unlock(&obj->oo_attr_lock);
818 rc = osd_object_sa_update(obj, SA_ZPL_SIZE(uos),
819 &obj->oo_attr.la_size, 8, oh);
824 static int osd_declare_punch(const struct lu_env *env, struct dt_object *dt,
825 __u64 start, __u64 end, struct thandle *handle)
827 struct osd_object *obj = osd_dt_obj(dt);
828 struct osd_device *osd = osd_obj2dev(obj);
829 struct osd_thandle *oh;
833 oh = container_of0(handle, struct osd_thandle, ot_super);
835 read_lock(&obj->oo_attr_lock);
836 if (end == OBD_OBJECT_EOF || end >= obj->oo_attr.la_size)
837 len = DMU_OBJECT_END;
841 /* declare we'll free some blocks ... */
842 if (start < obj->oo_attr.la_size) {
843 read_unlock(&obj->oo_attr_lock);
844 dmu_tx_hold_free(oh->ot_tx, obj->oo_db->db_object, start, len);
846 read_unlock(&obj->oo_attr_lock);
849 /* ... and we'll modify size attribute */
850 dmu_tx_hold_sa(oh->ot_tx, obj->oo_sa_hdl, 0);
852 RETURN(osd_declare_quota(env, osd, obj->oo_attr.la_uid,
853 obj->oo_attr.la_gid, 0, oh, true, NULL,
858 struct dt_body_operations osd_body_ops = {
859 .dbo_read = osd_read,
860 .dbo_declare_write = osd_declare_write,
861 .dbo_write = osd_write,
862 .dbo_bufs_get = osd_bufs_get,
863 .dbo_bufs_put = osd_bufs_put,
864 .dbo_write_prep = osd_write_prep,
865 .dbo_declare_write_commit = osd_declare_write_commit,
866 .dbo_write_commit = osd_write_commit,
867 .dbo_read_prep = osd_read_prep,
868 .dbo_declare_punch = osd_declare_punch,
869 .dbo_punch = osd_punch,