Whamcloud - gitweb
LU-3963 libcfs: convert md[d/t]/mg[c/s] to linux atomic primitives
[fs/lustre-release.git] / lustre / osd-zfs / osd_io.c
index c12e44b..3fe29ef 100644 (file)
  * Author: Mike Pershin <tappro@whamcloud.com>
  */
 
-#ifndef EXPORT_SYMTAB
-# define EXPORT_SYMTAB
-#endif
 #define DEBUG_SUBSYSTEM S_OSD
 
 #include <lustre_ver.h>
 #include <libcfs/libcfs.h>
-#include <lustre_fsfilt.h>
 #include <obd_support.h>
 #include <lustre_net.h>
 #include <obd.h>
@@ -332,7 +328,7 @@ static int osd_bufs_get_write(const struct lu_env *env, struct osd_object *obj,
 {
        struct osd_device *osd = osd_obj2dev(obj);
        int                plen, off_in_block, sz_in_block;
-       int                i = 0, npages = 0;
+       int                rc, i = 0, npages = 0;
        arc_buf_t         *abuf;
        uint32_t           bs;
        uint64_t           dummy;
@@ -355,7 +351,7 @@ static int osd_bufs_get_write(const struct lu_env *env, struct osd_object *obj,
 
                        abuf = dmu_request_arcbuf(obj->oo_db, bs);
                        if (unlikely(abuf == NULL))
-                               GOTO(out_err, -ENOMEM);
+                               GOTO(out_err, rc = -ENOMEM);
 
                        cfs_atomic_inc(&osd->od_zerocopy_loan);
 
@@ -406,7 +402,7 @@ static int osd_bufs_get_write(const struct lu_env *env, struct osd_object *obj,
 
                                lnb[i].page = alloc_page(OSD_GFP_IO);
                                if (unlikely(lnb[i].page == NULL))
-                                       GOTO(out_err, -ENOMEM);
+                                       GOTO(out_err, rc = -ENOMEM);
 
                                LASSERT(lnb[i].page->mapping == NULL);
                                lnb[i].page->mapping = (void *)obj;
@@ -428,7 +424,7 @@ static int osd_bufs_get_write(const struct lu_env *env, struct osd_object *obj,
 
 out_err:
        osd_bufs_put(env, &obj->oo_dt, lnb, npages);
-       RETURN(-ENOMEM);
+       RETURN(rc);
 }
 
 static int osd_bufs_get(const struct lu_env *env, struct dt_object *dt,