Whamcloud - gitweb
LU-4679 liblustre: remove dead code and clean headers
[fs/lustre-release.git] / lustre / liblustre / super.c
index 8525b92..43aeeee 100644 (file)
@@ -1,55 +1,73 @@
-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
+/*
+ * GPL HEADER START
  *
- * Lustre Light Super operations
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 only,
+ * as published by the Free Software Foundation.
  *
- *  Copyright (c) 2002-2004 Cluster File Systems, Inc.
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License version 2 for more details (a copy is included
+ * in the LICENSE file that accompanied this code).
  *
- *   This file is part of Lustre, http://www.lustre.org.
+ * You should have received a copy of the GNU General Public License
+ * version 2 along with this program; If not, see
+ * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ *
+ * GPL HEADER END
+ */
+/*
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Use is subject to license terms.
  *
- *   Lustre is free software; you can redistribute it and/or
- *   modify it under the terms of version 2 of the GNU General Public
- *   License as published by the Free Software Foundation.
+ * Copyright (c) 2011, 2013, Intel Corporation.
+ */
+/*
+ * This file is part of Lustre, http://www.lustre.org/
+ * Lustre is a trademark of Sun Microsystems, Inc.
  *
- *   Lustre is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
+ * lustre/liblustre/super.c
  *
- *   You should have received a copy of the GNU General Public License
- *   along with Lustre; if not, write to the Free Software
- *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Lustre Light Super operations
  */
 
 #define DEBUG_SUBSYSTEM S_LLITE
 
+#include <assert.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stddef.h>
 #include <stdlib.h>
+#include <stdio.h>
 #include <string.h>
-#include <assert.h>
 #include <time.h>
-#include <sys/types.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
 #include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/queue.h>
-#ifndef __CYGWIN__
-# include <sys/statvfs.h>
-#else
-# include <sys/statfs.h>
-#endif
-
-#include <sysio.h>
-#ifdef HAVE_XTIO_H
-#include <xtio.h>
-#endif
-#include <fs.h>
-#include <mount.h>
-#include <inode.h>
-#ifdef HAVE_FILE_H
-#include <file.h>
-#endif
-
-#undef LIST_HEAD
-
+#include <sys/types.h>
+#include <libcfs/libcfs.h>
+#include <lustre/lustre_idl.h>
+#include <liblustre.h>
+#include <lclient.h>
+#include <lustre_dlm.h>
+#include <lustre_export.h>
+#include <lustre_lite.h>
+#include <lustre_mdc.h>
+#include <lustre_net.h>
+#include <lustre_req_layout.h>
+#include <lustre_ver.h>
+#include <obd.h>
+#include <obd_class.h>
+#include <obd_support.h>
 #include "llite_lib.h"
 
 #ifndef MAY_EXEC
@@ -65,22 +83,22 @@ static int ll_permission(struct inode *inode, int mask)
         struct intnl_stat *st = llu_i2stat(inode);
         mode_t mode = st->st_mode;
 
-        if (current->fsuid == st->st_uid)
-                mode >>= 6;
-        else if (in_group_p(st->st_gid))
-                mode >>= 3;
+       if (current->fsuid == st->st_uid)
+               mode >>= 6;
+       else if (in_group_p(st->st_gid))
+               mode >>= 3;
 
         if ((mode & mask & (MAY_READ|MAY_WRITE|MAY_EXEC)) == mask)
                 return 0;
 
         if ((mask & (MAY_READ|MAY_WRITE)) ||
             (st->st_mode & S_IXUGO))
-                if (capable(CAP_DAC_OVERRIDE))
+                if (cfs_capable(CFS_CAP_DAC_OVERRIDE))
                         return 0;
 
         if (mask == MAY_READ ||
             (S_ISDIR(st->st_mode) && !(mask & MAY_WRITE))) {
-                if (capable(CAP_DAC_READ_SEARCH))
+                if (cfs_capable(CFS_CAP_DAC_READ_SEARCH))
                         return 0;
         }
 
@@ -94,9 +112,8 @@ static void llu_fsop_gone(struct filesys *fs)
         int next = 0;
         ENTRY;
 
-        list_del(&sbi->ll_conn_chain);
-        obd_unregister_lock_cancel_cb(sbi->ll_dt_exp,
-                                      llu_extent_lock_cancel_cb);
+        cfs_list_del(&sbi->ll_conn_chain);
+        cl_sb_fini(sbi);
         obd_disconnect(sbi->ll_dt_exp);
         obd_disconnect(sbi->ll_md_exp);
 
@@ -117,7 +134,7 @@ static ldlm_mode_t llu_take_md_lock(struct inode *inode, __u64 bits,
         ldlm_policy_data_t policy = { .l_inodebits = {bits}};
         struct lu_fid *fid;
         ldlm_mode_t rc;
-        int flags;
+       __u64 flags;
         ENTRY;
 
         fid = &llu_i2info(inode)->lli_fid;
@@ -129,49 +146,47 @@ static ldlm_mode_t llu_take_md_lock(struct inode *inode, __u64 bits,
         RETURN(rc);
 }
 
-void llu_update_inode(struct inode *inode, struct mdt_body *body,
-                      struct lov_stripe_md *lsm)
+void llu_update_inode(struct inode *inode, struct lustre_md *md)
 {
         struct llu_inode_info *lli = llu_i2info(inode);
+        struct mdt_body *body = md->body;
+        struct lov_stripe_md *lsm = md->lsm;
         struct intnl_stat *st = llu_i2stat(inode);
 
         LASSERT ((lsm != NULL) == ((body->valid & OBD_MD_FLEASIZE) != 0));
-        if (lsm != NULL) {
-                if (lli->lli_smd == NULL) {
-                        lli->lli_smd = lsm;
-                        lli->lli_maxbytes = lsm->lsm_maxbytes;
-                        if (lli->lli_maxbytes > PAGE_CACHE_MAXBYTES)
-                                lli->lli_maxbytes = PAGE_CACHE_MAXBYTES;
-                } else {
-                        if (lov_stripe_md_cmp(lli->lli_smd, lsm)) {
-                                CERROR("lsm mismatch for inode %lld\n",
-                                       (long long)st->st_ino);
-                                LBUG();
-                        }
-                }
-        }
 
-        if (body->valid & OBD_MD_FLMTIME &&
-            body->mtime > LTIME_S(st->st_mtime))
-                LTIME_S(st->st_mtime) = body->mtime;
-        if (body->valid & OBD_MD_FLATIME &&
-            body->atime > LTIME_S(st->st_atime))
-                LTIME_S(st->st_atime) = body->atime;
-
-        /* mtime is always updated with ctime, but can be set in past.
-           As write and utime(2) may happen within 1 second, and utime's
-           mtime has a priority over write's one, so take mtime from mds
-           for the same ctimes. */
-        if (body->valid & OBD_MD_FLCTIME &&
-            body->ctime >= LTIME_S(st->st_ctime)) {
-                LTIME_S(st->st_ctime) = body->ctime;
-                if (body->valid & OBD_MD_FLMTIME)
-                        LTIME_S(st->st_mtime) = body->mtime;
-        }
         if (body->valid & OBD_MD_FLMODE)
                 st->st_mode = (st->st_mode & S_IFMT)|(body->mode & ~S_IFMT);
         if (body->valid & OBD_MD_FLTYPE)
                 st->st_mode = (st->st_mode & ~S_IFMT)|(body->mode & S_IFMT);
+
+        if (lsm != NULL) {
+               if (!lli->lli_has_smd) {
+                       cl_file_inode_init(inode, md);
+                       lli->lli_has_smd = true;
+                       lli->lli_maxbytes = lsm->lsm_maxbytes;
+                       if (lli->lli_maxbytes > MAX_LFS_FILESIZE)
+                               lli->lli_maxbytes = MAX_LFS_FILESIZE;
+               }
+               if (md->lsm != NULL)
+                       obd_free_memmd(llu_i2obdexp(inode), &md->lsm);
+        }
+
+        if (body->valid & OBD_MD_FLATIME) {
+                if (body->atime > LTIME_S(st->st_atime))
+                        LTIME_S(st->st_atime) = body->atime;
+                lli->lli_lvb.lvb_atime = body->atime;
+        }
+        if (body->valid & OBD_MD_FLMTIME) {
+                if (body->mtime > LTIME_S(st->st_mtime))
+                        LTIME_S(st->st_mtime) = body->mtime;
+                lli->lli_lvb.lvb_mtime = body->mtime;
+        }
+        if (body->valid & OBD_MD_FLCTIME) {
+                if (body->ctime > LTIME_S(st->st_ctime))
+                        LTIME_S(st->st_ctime) = body->ctime;
+                lli->lli_lvb.lvb_ctime = body->ctime;
+        }
         if (S_ISREG(st->st_mode))
                 st->st_blksize = min(2UL * PTLRPC_MAX_BRW_SIZE, LL_MAX_BLKSIZE);
         else
@@ -187,13 +202,13 @@ void llu_update_inode(struct inode *inode, struct mdt_body *body,
         if (body->valid & OBD_MD_FLFLAGS)
                 lli->lli_st_flags = body->flags;
         if (body->valid & OBD_MD_FLSIZE) {
-                if ((llu_i2sbi(inode)->ll_lco.lco_flags & OBD_CONNECT_SOM) && 
-                    S_ISREG(st->st_mode) && lli->lli_smd) {
+                if ((llu_i2sbi(inode)->ll_lco.lco_flags & OBD_CONNECT_SOM) &&
+                   S_ISREG(st->st_mode) && lli->lli_has_smd) {
                         struct lustre_handle lockh;
                         ldlm_mode_t mode;
-                        
+
                         /* As it is possible a blocking ast has been processed
-                         * by this time, we need to check there is an UPDATE 
+                         * by this time, we need to check there is an UPDATE
                          * lock on the client and set LLIF_MDS_SIZE_LOCK holding
                          * it. */
                         mode = llu_take_md_lock(inode, MDS_INODELOCK_UPDATE,
@@ -206,143 +221,43 @@ void llu_update_inode(struct inode *inode, struct mdt_body *body,
                 } else {
                     st->st_size = body->size;
                 }
-                
+
                 if (body->valid & OBD_MD_FLBLOCKS)
                         st->st_blocks = body->blocks;
         }
 }
 
-void obdo_to_inode(struct inode *dst, struct obdo *src, obd_flag valid)
-{
-        struct llu_inode_info *lli = llu_i2info(dst);
-        struct intnl_stat *st = llu_i2stat(dst);
-
-        valid &= src->o_valid;
-
-        if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME))
-                CDEBUG(D_INODE,"valid "LPX64", cur time "CFS_TIME_T"/"CFS_TIME_T
-                      ", new %lu/%lu\n",
-                       src->o_valid,
-                       LTIME_S(st->st_mtime), LTIME_S(st->st_ctime),
-                       (long)src->o_mtime, (long)src->o_ctime);
-
-        if (valid & OBD_MD_FLATIME)
-                LTIME_S(st->st_atime) = src->o_atime;
-        if (valid & OBD_MD_FLMTIME)
-                LTIME_S(st->st_mtime) = src->o_mtime;
-        if (valid & OBD_MD_FLCTIME && src->o_ctime > LTIME_S(st->st_ctime))
-                LTIME_S(st->st_ctime) = src->o_ctime;
-        if (valid & OBD_MD_FLSIZE)
-                st->st_size = src->o_size;
-        if (valid & OBD_MD_FLBLOCKS) /* allocation of space */
-                st->st_blocks = src->o_blocks;
-        if (valid & OBD_MD_FLBLKSZ)
-                st->st_blksize = src->o_blksize;
-        if (valid & OBD_MD_FLTYPE)
-                st->st_mode = (st->st_mode & ~S_IFMT) | (src->o_mode & S_IFMT);
-        if (valid & OBD_MD_FLMODE)
-                st->st_mode = (st->st_mode & S_IFMT) | (src->o_mode & ~S_IFMT);
-        if (valid & OBD_MD_FLUID)
-                st->st_uid = src->o_uid;
-        if (valid & OBD_MD_FLGID)
-                st->st_gid = src->o_gid;
-        if (valid & OBD_MD_FLFLAGS)
-                lli->lli_st_flags = src->o_flags;
-}
-
-#define S_IRWXUGO       (S_IRWXU|S_IRWXG|S_IRWXO)
-#define S_IALLUGO       (S_ISUID|S_ISGID|S_ISVTX|S_IRWXUGO)
-
-void obdo_from_inode(struct obdo *dst, struct inode *src, obd_flag valid)
-{
-        struct llu_inode_info *lli = llu_i2info(src);
-        struct intnl_stat *st = llu_i2stat(src);
-        obd_flag newvalid = 0;
-
-        if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME))
-                CDEBUG(D_INODE, "valid %x, new time "CFS_TIME_T"/"CFS_TIME_T"\n",
-                       valid, LTIME_S(st->st_mtime),
-                       LTIME_S(st->st_ctime));
-
-        if (valid & OBD_MD_FLATIME) {
-                dst->o_atime = LTIME_S(st->st_atime);
-                newvalid |= OBD_MD_FLATIME;
-        }
-        if (valid & OBD_MD_FLMTIME) {
-                dst->o_mtime = LTIME_S(st->st_mtime);
-                newvalid |= OBD_MD_FLMTIME;
-        }
-        if (valid & OBD_MD_FLCTIME) {
-                dst->o_ctime = LTIME_S(st->st_ctime);
-                newvalid |= OBD_MD_FLCTIME;
-        }
-        if (valid & OBD_MD_FLSIZE) {
-                dst->o_size = st->st_size;
-                newvalid |= OBD_MD_FLSIZE;
-        }
-        if (valid & OBD_MD_FLBLOCKS) {  /* allocation of space (x512 bytes) */
-                dst->o_blocks = st->st_blocks;
-                newvalid |= OBD_MD_FLBLOCKS;
-        }
-        if (valid & OBD_MD_FLBLKSZ) {   /* optimal block size */
-                dst->o_blksize = st->st_blksize;
-                newvalid |= OBD_MD_FLBLKSZ;
-        }
-        if (valid & OBD_MD_FLTYPE) {
-                dst->o_mode = (dst->o_mode & S_IALLUGO)|(st->st_mode & S_IFMT);
-                newvalid |= OBD_MD_FLTYPE;
-        }
-        if (valid & OBD_MD_FLMODE) {
-                dst->o_mode = (dst->o_mode & S_IFMT)|(st->st_mode & S_IALLUGO);
-                newvalid |= OBD_MD_FLMODE;
-        }
-        if (valid & OBD_MD_FLUID) {
-                dst->o_uid = st->st_uid;
-                newvalid |= OBD_MD_FLUID;
-        }
-        if (valid & OBD_MD_FLGID) {
-                dst->o_gid = st->st_gid;
-                newvalid |= OBD_MD_FLGID;
-        }
-        if (valid & OBD_MD_FLFLAGS) {
-                dst->o_flags = lli->lli_st_flags;
-                newvalid |= OBD_MD_FLFLAGS;
-        }
-        if (valid & OBD_MD_FLGENER) {
-                dst->o_generation = lli->lli_st_generation;
-                newvalid |= OBD_MD_FLGENER;
-        }
-        if (valid & OBD_MD_FLFID) {
-                dst->o_fid = st->st_ino;
-                newvalid |= OBD_MD_FLFID;
-        }
-
-        dst->o_valid |= newvalid;
-}
-
-/*
- * really does the getattr on the inode and updates its fields
+/**
+ * Performs the getattr on the inode and updates its fields.
+ * If @sync != 0, perform the getattr under the server-side lock.
  */
-int llu_inode_getattr(struct inode *inode, struct obdo *obdo)
+int llu_inode_getattr(struct inode *inode, struct obdo *obdo,
+                      __u64 ioepoch, int sync)
 {
-        struct llu_inode_info *lli = llu_i2info(inode);
-        struct ptlrpc_request_set *set;
-        struct lov_stripe_md *lsm = lli->lli_smd;
-        struct obd_info oinfo = { { { 0 } } };
-        int rc;
-        ENTRY;
+       struct ptlrpc_request_set *set;
+       struct lov_stripe_md *lsm = NULL;
+       struct obd_info oinfo = { { { 0 } } };
+       int rc;
+       ENTRY;
 
+       lsm = ccc_inode_lsm_get(inode);
         LASSERT(lsm);
 
         oinfo.oi_md = lsm;
         oinfo.oi_oa = obdo;
-        oinfo.oi_oa->o_id = lsm->lsm_object_id;
-        oinfo.oi_oa->o_gr = lsm->lsm_object_gr;
+       oinfo.oi_oa->o_oi = lsm->lsm_oi;
         oinfo.oi_oa->o_mode = S_IFREG;
+        oinfo.oi_oa->o_ioepoch = ioepoch;
         oinfo.oi_oa->o_valid = OBD_MD_FLID | OBD_MD_FLTYPE |
                                OBD_MD_FLSIZE | OBD_MD_FLBLOCKS |
                                OBD_MD_FLBLKSZ | OBD_MD_FLMTIME |
-                               OBD_MD_FLCTIME | OBD_MD_FLGROUP;
+                               OBD_MD_FLCTIME | OBD_MD_FLGROUP |
+                               OBD_MD_FLATIME | OBD_MD_FLEPOCH;
+        obdo_set_parent_fid(oinfo.oi_oa, &llu_i2info(inode)->lli_fid);
+        if (sync) {
+                oinfo.oi_oa->o_valid |= OBD_MD_FLFLAGS;
+                oinfo.oi_oa->o_flags |= OBD_FL_SRVLOCK;
+        }
 
         set = ptlrpc_prep_set();
         if (set == NULL) {
@@ -354,6 +269,7 @@ int llu_inode_getattr(struct inode *inode, struct obdo *obdo)
                         rc = ptlrpc_set_wait(set);
                 ptlrpc_set_destroy(set);
         }
+       ccc_inode_lsm_put(inode, lsm);
         if (rc)
                 RETURN(rc);
 
@@ -361,13 +277,13 @@ int llu_inode_getattr(struct inode *inode, struct obdo *obdo)
                                OBD_MD_FLMTIME | OBD_MD_FLCTIME |
                                OBD_MD_FLSIZE;
 
-        obdo_refresh_inode(inode, oinfo.oi_oa, oinfo.oi_oa->o_valid);
-        CDEBUG(D_INODE, "objid "LPX64" size %Lu, blocks %Lu, "
-               "blksize %Lu\n", lli->lli_smd->lsm_object_id,
-               (long long unsigned)llu_i2stat(inode)->st_size,
-               (long long unsigned)llu_i2stat(inode)->st_blocks,
-               (long long unsigned)llu_i2stat(inode)->st_blksize);
-        RETURN(0);
+       obdo_refresh_inode(inode, oinfo.oi_oa, oinfo.oi_oa->o_valid);
+       CDEBUG(D_INODE, "objid "DOSTID" size %llu, blocks %llu, "
+              "blksize %llu\n", POSTID(&oinfo.oi_oa->o_oi),
+              (long long unsigned)llu_i2stat(inode)->st_size,
+              (long long unsigned)llu_i2stat(inode)->st_blocks,
+              (long long unsigned)llu_i2stat(inode)->st_blksize);
+       RETURN(0);
 }
 
 static struct inode* llu_new_inode(struct filesys *fs,
@@ -397,7 +313,7 @@ static struct inode* llu_new_inode(struct filesys *fs,
 
         /* initialize lli here */
         lli->lli_sbi = llu_fs2sbi(fs);
-        lli->lli_smd = NULL;
+       lli->lli_has_smd = false;
         lli->lli_symlink_name = NULL;
         lli->lli_flags = 0;
         lli->lli_maxbytes = (__u64)(~0UL);
@@ -422,7 +338,7 @@ static int llu_have_md_lock(struct inode *inode, __u64 lockpart)
         struct lustre_handle lockh;
         ldlm_policy_data_t policy = { .l_inodebits = { lockpart } };
         struct lu_fid *fid;
-        int flags;
+       __u64 flags;
         ENTRY;
 
         LASSERT(inode);
@@ -440,32 +356,33 @@ static int llu_have_md_lock(struct inode *inode, __u64 lockpart)
 
 static int llu_inode_revalidate(struct inode *inode)
 {
-        struct lov_stripe_md *lsm = NULL;
+        struct llu_inode_info *lli = llu_i2info(inode);
+        struct intnl_stat *st = llu_i2stat(inode);
         ENTRY;
 
-        if (!inode) {
-                CERROR("REPORT THIS LINE TO PETER\n");
-                RETURN(0);
-        }
-
         if (!llu_have_md_lock(inode, MDS_INODELOCK_UPDATE)) {
                 struct lustre_md md;
                 struct ptlrpc_request *req = NULL;
                 struct llu_sb_info *sbi = llu_i2sbi(inode);
+                struct md_op_data op_data = { { 0 } };
                 unsigned long valid = OBD_MD_FLGETATTR;
                 int rc, ealen = 0;
 
                 /* Why don't we update all valid MDS fields here, if we're
                  * doing an RPC anyways?  -phil */
-                if (S_ISREG(llu_i2stat(inode)->st_mode)) {
+                if (S_ISREG(st->st_mode)) {
                         ealen = obd_size_diskmd(sbi->ll_dt_exp, NULL);
                         valid |= OBD_MD_FLEASIZE;
                 }
-                rc = md_getattr(sbi->ll_md_exp, ll_inode2fid(inode),
-                                NULL, valid, ealen, &req);
+
+                llu_prep_md_op_data(&op_data, inode, NULL, NULL, 0, ealen,
+                                    LUSTRE_OPC_ANY);
+                op_data.op_valid = valid;
+
+                rc = md_getattr(sbi->ll_md_exp, &op_data, &req);
                 if (rc) {
                         CERROR("failure %d inode %llu\n", rc,
-                               (long long)llu_i2stat(inode)->st_ino);
+                               (long long)st->st_ino);
                         RETURN(-abs(rc));
                 }
                 rc = md_get_lustre_md(sbi->ll_md_exp, req,
@@ -486,19 +403,23 @@ static int llu_inode_revalidate(struct inode *inode)
                 }
 
 
-                llu_update_inode(inode, md.body, md.lsm);
-                if (md.lsm != NULL && llu_i2info(inode)->lli_smd != md.lsm)
-                        obd_free_memmd(sbi->ll_dt_exp, &md.lsm);
-                ptlrpc_req_finished(req);
-        }
+                llu_update_inode(inode, &md);
+               if (md.lsm != NULL)
+                       obd_free_memmd(sbi->ll_dt_exp, &md.lsm);
+               ptlrpc_req_finished(req);
+       }
 
-        lsm = llu_i2info(inode)->lli_smd;
-        if (!lsm)       /* object not yet allocated, don't validate size */
+       if (!lli->lli_has_smd) {
+                /* object not yet allocated, don't validate size */
+                st->st_atime = lli->lli_lvb.lvb_atime;
+                st->st_mtime = lli->lli_lvb.lvb_mtime;
+                st->st_ctime = lli->lli_lvb.lvb_ctime;
                 RETURN(0);
+        }
 
         /* ll_glimpse_size will prefer locally cached writes if they extend
          * the file */
-        RETURN(llu_glimpse_size(inode));
+        RETURN(cl_glimpse_size(inode));
 }
 
 static void copy_stat_buf(struct inode *ino, struct intnl_stat *b)
@@ -548,10 +469,11 @@ static int null_if_equal(struct ldlm_lock *lock, void *data)
         return LDLM_ITER_CONTINUE;
 }
 
-void llu_clear_inode(struct inode *inode)
+static void llu_clear_inode(struct inode *inode)
 {
-        struct llu_inode_info *lli = llu_i2info(inode);
-        struct llu_sb_info *sbi = llu_i2sbi(inode);
+       struct llu_inode_info *lli = llu_i2info(inode);
+       struct llu_sb_info *sbi = llu_i2sbi(inode);
+       struct lov_stripe_md *lsm;
         ENTRY;
 
         CDEBUG(D_VFSTRACE, "VFS Op:inode=%llu/%lu(%p)\n",
@@ -559,17 +481,15 @@ void llu_clear_inode(struct inode *inode)
                inode);
 
         lli->lli_flags &= ~LLIF_MDS_SIZE_LOCK;
-        md_change_cbdata(sbi->ll_md_exp, ll_inode2fid(inode),
-                         null_if_equal, inode);
+       md_null_inode(sbi->ll_md_exp, ll_inode2fid(inode));
 
-        if (lli->lli_smd)
-                obd_change_cbdata(sbi->ll_dt_exp, lli->lli_smd,
-                                  null_if_equal, inode);
+       lsm = ccc_inode_lsm_get(inode);
+       if (lsm != NULL)
+               obd_change_cbdata(sbi->ll_dt_exp, lsm, null_if_equal, inode);
+       ccc_inode_lsm_put(inode, lsm);
 
-        if (lli->lli_smd) {
-                obd_free_memmd(sbi->ll_dt_exp, &lli->lli_smd);
-                lli->lli_smd = NULL;
-        }
+       cl_inode_fini(inode);
+       lli->lli_has_smd = false;
 
         if (lli->lli_symlink_name) {
                 OBD_FREE(lli->lli_symlink_name,
@@ -580,7 +500,7 @@ void llu_clear_inode(struct inode *inode)
         EXIT;
 }
 
-void llu_iop_gone(struct inode *inode)
+static void llu_iop_gone(struct inode *inode)
 {
         struct llu_inode_info *lli = llu_i2info(inode);
         ENTRY;
@@ -602,7 +522,7 @@ static int inode_setattr(struct inode * inode, struct iattr * attr)
          * inode_setattr() is only ever invoked with ATTR_SIZE (by
          * llu_setattr_raw()) when file has no bodies. Check this.
          */
-        LASSERT(ergo(ia_valid & ATTR_SIZE, llu_i2info(inode)->lli_smd == NULL));
+       LASSERT(ergo(ia_valid & ATTR_SIZE, !llu_i2info(inode)->lli_has_smd));
 
         if (ia_valid & ATTR_SIZE)
                 st->st_size = attr->ia_size;
@@ -616,11 +536,12 @@ static int inode_setattr(struct inode * inode, struct iattr * attr)
                 st->st_mtime = attr->ia_mtime;
         if (ia_valid & ATTR_CTIME)
                 st->st_ctime = attr->ia_ctime;
-        if (ia_valid & ATTR_MODE) {
-                st->st_mode = attr->ia_mode;
-                if (!in_group_p(st->st_gid) && !capable(CAP_FSETID))
-                        st->st_mode &= ~S_ISGID;
-        }
+       if (ia_valid & ATTR_MODE) {
+               st->st_mode = attr->ia_mode;
+               if (!in_group_p(st->st_gid) &&
+                   !cfs_capable(CFS_CAP_FSETID))
+                       st->st_mode &= ~S_ISGID;
+       }
         /* mark_inode_dirty(inode); */
         return error;
 }
@@ -658,7 +579,7 @@ int llu_md_setattr(struct inode *inode, struct md_op_data *op_data,
          * to call vmtruncate in inode_setattr to update inode->i_size
          * (bug 6196) */
         inode_setattr(inode, &op_data->op_attr);
-        llu_update_inode(inode, md.body, md.lsm);
+        llu_update_inode(inode, &md);
         ptlrpc_req_finished(request);
 
         RETURN(rc);
@@ -682,16 +603,18 @@ static int llu_setattr_done_writing(struct inode *inode,
         CDEBUG(D_INODE, "Epoch "LPU64" closed on "DFID" for truncate\n",
                op_data->op_ioepoch, PFID(&lli->lli_fid));
 
-        op_data->op_flags = MF_EPOCH_CLOSE | MF_SOM_CHANGE;
+        op_data->op_flags = MF_EPOCH_CLOSE;
+        llu_done_writing_attr(inode, op_data);
+        llu_pack_inode2opdata(inode, op_data, NULL);
+
         rc = md_done_writing(llu_i2sbi(inode)->ll_md_exp, op_data, mod);
         if (rc == -EAGAIN) {
                 /* MDS has instructed us to obtain Size-on-MDS attribute
                  * from OSTs and send setattr to back to MDS. */
-                rc = llu_sizeonmds_update(inode, mod, &op_data->op_handle,
-                                          op_data->op_ioepoch);
+                rc = llu_som_update(inode, op_data);
         } else if (rc) {
                 CERROR("inode %llu mdc truncate failed: rc = %d\n",
-                       st->st_ino, rc);
+                       (unsigned long long)st->st_ino, rc);
         }
         RETURN(rc);
 }
@@ -711,8 +634,7 @@ static int llu_setattr_done_writing(struct inode *inode,
  */
 int llu_setattr_raw(struct inode *inode, struct iattr *attr)
 {
-        struct lov_stripe_md *lsm = llu_i2info(inode)->lli_smd;
-        struct llu_sb_info *sbi = llu_i2sbi(inode);
+       int has_lsm = llu_i2info(inode)->lli_has_smd;
         struct intnl_stat *st = llu_i2stat(inode);
         int ia_valid = attr->ia_valid;
         struct md_op_data op_data = { { 0 } };
@@ -735,58 +657,45 @@ int llu_setattr_raw(struct inode *inode, struct iattr *attr)
 
         /* We mark all of the fields "set" so MDS/OST does not re-set them */
         if (attr->ia_valid & ATTR_CTIME) {
-                attr->ia_ctime = CURRENT_TIME;
+                attr->ia_ctime = CFS_CURRENT_TIME;
                 attr->ia_valid |= ATTR_CTIME_SET;
         }
         if (!(ia_valid & ATTR_ATIME_SET) && (attr->ia_valid & ATTR_ATIME)) {
-                attr->ia_atime = CURRENT_TIME;
+                attr->ia_atime = CFS_CURRENT_TIME;
                 attr->ia_valid |= ATTR_ATIME_SET;
         }
         if (!(ia_valid & ATTR_MTIME_SET) && (attr->ia_valid & ATTR_MTIME)) {
-                attr->ia_mtime = CURRENT_TIME;
+                attr->ia_mtime = CFS_CURRENT_TIME;
                 attr->ia_valid |= ATTR_MTIME_SET;
         }
-        if ((attr->ia_valid & ATTR_CTIME) && !(attr->ia_valid & ATTR_MTIME)) {
-                /* To avoid stale mtime on mds, obtain it from ost and send
-                   to mds. */
-                rc = llu_glimpse_size(inode);
-                if (rc)
-                        RETURN(rc);
-
-                attr->ia_valid |= ATTR_MTIME_SET | ATTR_MTIME;
-                attr->ia_mtime = inode->i_stbuf.st_mtime;
-        }
 
         if (attr->ia_valid & (ATTR_MTIME | ATTR_CTIME))
                 CDEBUG(D_INODE, "setting mtime "CFS_TIME_T", ctime "CFS_TIME_T
                       ", now = "CFS_TIME_T"\n",
-                       LTIME_S(attr->ia_mtime), LTIME_S(attr->ia_ctime),
-                       LTIME_S(CURRENT_TIME));
-
-        /* NB: ATTR_SIZE will only be set after this point if the size
-         * resides on the MDS, ie, this file has no objects. */
-        if (lsm)
-                attr->ia_valid &= ~ATTR_SIZE;
-
-        /* If only OST attributes being set on objects, don't do MDS RPC.
-         * In that case, we need to check permissions and update the local
-         * inode ourselves so we can call obdo_from_inode() always. */
-        if (ia_valid & (lsm ? ~(ATTR_FROM_OPEN | ATTR_RAW) : ~0)) {
+                      LTIME_S(attr->ia_mtime), LTIME_S(attr->ia_ctime),
+                      LTIME_S(CFS_CURRENT_TIME));
+
+       /* NB: ATTR_SIZE will only be set after this point if the size
+        * resides on the MDS, ie, this file has no objects. */
+       if (has_lsm)
+               attr->ia_valid &= ~ATTR_SIZE;
+
+       /* If only OST attributes being set on objects, don't do MDS RPC.
+        * In that case, we need to check permissions and update the local
+        * inode ourselves so we can call obdo_from_inode() always. */
+       if (ia_valid & (has_lsm ? ~(ATTR_FROM_OPEN | ATTR_RAW) : ~0)) {
                 memcpy(&op_data.op_attr, attr, sizeof(*attr));
 
                 /* Open epoch for truncate. */
-                if (ia_valid & ATTR_SIZE)
+                if (exp_connect_som(llu_i2mdexp(inode)) &&
+                    (ia_valid & ATTR_SIZE))
                         op_data.op_flags = MF_EPOCH_OPEN;
                 rc = llu_md_setattr(inode, &op_data, &mod);
                 if (rc)
                         RETURN(rc);
 
-                if (op_data.op_ioepoch)
-                        CDEBUG(D_INODE, "Epoch "LPU64" opened on "DFID" for "
-                               "truncate\n", op_data.op_ioepoch,
-                               PFID(&llu_i2info(inode)->lli_fid));
-
-                if (!lsm || !S_ISREG(st->st_mode)) {
+                llu_ioepoch_open(llu_i2info(inode), op_data.op_ioepoch);
+               if (!has_lsm || !S_ISREG(st->st_mode)) {
                         CDEBUG(D_INODE, "no lsm: not setting attrs on OST\n");
                         GOTO(out, rc);
                 }
@@ -804,7 +713,7 @@ int llu_setattr_raw(struct inode *inode, struct iattr *attr)
                         } else {
                                 /* from inode_change_ok() */
                                 if (current->fsuid != st->st_uid &&
-                                    !capable(CAP_FOWNER))
+                                    !cfs_capable(CFS_CAP_FOWNER))
                                         RETURN(-EPERM);
                         }
                 }
@@ -815,73 +724,18 @@ int llu_setattr_raw(struct inode *inode, struct iattr *attr)
                 inode_setattr(inode, attr);
         }
 
-        if (ia_valid & ATTR_SIZE) {
-                ldlm_policy_data_t policy = { .l_extent = {attr->ia_size,
-                                                           OBD_OBJECT_EOF} };
-                struct lustre_handle lockh = { 0, };
-                struct lustre_handle match_lockh = { 0, };
-
-                int err;
-                int flags = LDLM_FL_TEST_LOCK; /* for assertion check below */
-                int lock_mode;
-                obd_flag obd_flags;
-
-                /* check that there are no matching locks */
-                LASSERT(obd_match(sbi->ll_dt_exp, lsm, LDLM_EXTENT, &policy,
-                                  LCK_PW, &flags, inode, &match_lockh) <= 0);
-
-                /* XXX when we fix the AST intents to pass the discard-range
-                 * XXX extent, make ast_flags always LDLM_AST_DISCARD_DATA
-                 * XXX here. */
-                flags = (attr->ia_size == 0) ? LDLM_AST_DISCARD_DATA : 0;
-
-                if (sbi->ll_lco.lco_flags & OBD_CONNECT_TRUNCLOCK) {
-                        lock_mode = LCK_NL;
-                        obd_flags = OBD_FL_TRUNCLOCK;
-                        CDEBUG(D_INODE, "delegating locking to the OST");
-                } else {
-                        lock_mode = LCK_PW;
-                        obd_flags = 0;
-                }
-
-                /* with lock_mode == LK_NL no lock is taken. */
-                rc = llu_extent_lock(NULL, inode, lsm, lock_mode, &policy,
-                                     &lockh, flags);
-                if (rc != ELDLM_OK) {
-                        if (rc > 0)
-                                GOTO(out, rc = -ENOLCK);
-                        GOTO(out, rc);
-                }
-                rc = llu_vmtruncate(inode, attr->ia_size, obd_flags);
-
-                /* unlock now as we don't mind others file lockers racing with
-                 * the mds updates below? */
-                err = llu_extent_unlock(NULL, inode, lsm, lock_mode, &lockh);
-                if (err) {
-                        CERROR("llu_extent_unlock failed: %d\n", err);
-                        if (!rc)
-                                rc = err;
-                }
-        } else if (ia_valid & (ATTR_MTIME | ATTR_MTIME_SET)) {
-                struct obd_info oinfo = { { { 0 } } };
-                struct obdo oa;
-
-                CDEBUG(D_INODE, "set mtime on OST inode %llu to "CFS_TIME_T"\n",
-                       (long long)st->st_ino, LTIME_S(attr->ia_mtime));
-                oa.o_id = lsm->lsm_object_id;
-                oa.o_gr = lsm->lsm_object_gr;
-                oa.o_valid = OBD_MD_FLID | OBD_MD_FLGROUP;
-
-                obdo_from_inode(&oa, inode, OBD_MD_FLTYPE | OBD_MD_FLATIME |
-                                            OBD_MD_FLMTIME | OBD_MD_FLCTIME);
-
-                oinfo.oi_oa = &oa;
-                oinfo.oi_md = lsm;
-
-                rc = obd_setattr_rqset(sbi->ll_dt_exp, &oinfo, NULL);
-                if (rc)
-                        CERROR("obd_setattr_async fails: rc=%d\n", rc);
-        }
+        if (ia_valid & ATTR_SIZE)
+                attr->ia_valid |= ATTR_SIZE;
+        if (ia_valid & (ATTR_SIZE |
+                        ATTR_ATIME | ATTR_ATIME_SET |
+                        ATTR_MTIME | ATTR_MTIME_SET))
+                /* on truncate and utimes send attributes to osts, setting
+                 * mtime/atime to past will be performed under PW 0:EOF extent
+                 * lock (new_size:EOF for truncate)
+                 * it may seem excessive to send mtime/atime updates to osts
+                 * when not setting times to past, but it is necessary due to
+                 * possible time de-synchronization */
+                rc = cl_setattr_ost(inode, attr, NULL);
         EXIT;
 out:
         if (op_data.op_ioepoch)
@@ -934,7 +788,7 @@ static int llu_iop_setattr(struct pnode *pno,
         }
 
         iattr.ia_valid |= ATTR_RAW | ATTR_CTIME;
-        iattr.ia_ctime = CURRENT_TIME;
+        iattr.ia_ctime = CFS_CURRENT_TIME;
 
         rc = llu_setattr_raw(ino, &iattr);
         liblustre_wait_idle();
@@ -959,13 +813,12 @@ static int llu_iop_symlink_raw(struct pnode *pno, const char *tgt)
         if (llu_i2stat(dir)->st_nlink >= EXT2_LINK_MAX)
                 RETURN(err);
 
-        llu_prep_md_op_data(&op_data, dir, NULL, name, len, 0, 
+        llu_prep_md_op_data(&op_data, dir, NULL, name, len, 0,
                             LUSTRE_OPC_SYMLINK);
 
-        err = md_create(sbi->ll_md_exp, &op_data,
-                        tgt, strlen(tgt) + 1, S_IFLNK | S_IRWXUGO,
-                        current->fsuid, current->fsgid, current->cap_effective,
-                        0, &request);
+        err = md_create(sbi->ll_md_exp, &op_data, tgt, strlen(tgt) + 1,
+                        S_IFLNK | S_IRWXUGO, current->fsuid, current->fsgid,
+                        cfs_curproc_cap_pack(), 0, &request);
         ptlrpc_req_finished(request);
         liblustre_wait_event(0);
         RETURN(err);
@@ -979,10 +832,12 @@ static int llu_readlink_internal(struct inode *inode,
         struct llu_sb_info *sbi = llu_i2sbi(inode);
         struct mdt_body *body;
         struct intnl_stat *st = llu_i2stat(inode);
+        struct md_op_data op_data = {{ 0 }};
         int rc, symlen = st->st_size + 1;
         ENTRY;
 
         *request = NULL;
+        *symname = NULL;
 
         if (lli->lli_symlink_name) {
                 *symname = lli->lli_symlink_name;
@@ -990,8 +845,11 @@ static int llu_readlink_internal(struct inode *inode,
                 RETURN(0);
         }
 
-        rc = md_getattr(sbi->ll_md_exp, ll_inode2fid(inode), NULL,
-                        OBD_MD_LINKNAME, symlen, request);
+        llu_prep_md_op_data(&op_data, inode, NULL, NULL, 0, symlen,
+                            LUSTRE_OPC_ANY);
+        op_data.op_valid = OBD_MD_LINKNAME;
+
+        rc = md_getattr(sbi->ll_md_exp, &op_data, request);
         if (rc) {
                 CERROR("inode %llu: rc = %d\n", (long long)st->st_ino, rc);
                 RETURN(rc);
@@ -1090,7 +948,7 @@ static int llu_iop_mknod_raw(struct pnode *pno,
 
                 err = md_create(sbi->ll_md_exp, &op_data, NULL, 0, mode,
                                 current->fsuid, current->fsgid,
-                                current->cap_effective, dev, &request);
+                                cfs_curproc_cap_pack(), dev, &request);
                 ptlrpc_req_finished(request);
                 break;
         case S_IFDIR:
@@ -1118,7 +976,7 @@ static int llu_iop_link_raw(struct pnode *old, struct pnode *new)
         LASSERT(dir);
 
         liblustre_wait_event(0);
-        llu_prep_md_op_data(&op_data, src, dir, name, namelen, 0, 
+        llu_prep_md_op_data(&op_data, src, dir, name, namelen, 0,
                             LUSTRE_OPC_ANY);
         rc = md_link(llu_i2sbi(src)->ll_md_exp, &op_data, &request);
         ptlrpc_req_finished(request);
@@ -1145,7 +1003,7 @@ static int llu_iop_unlink_raw(struct pnode *pno)
         LASSERT(target);
 
         liblustre_wait_event(0);
-        llu_prep_md_op_data(&op_data, dir, NULL, name, len, 0, 
+        llu_prep_md_op_data(&op_data, dir, NULL, name, len, 0,
                             LUSTRE_OPC_ANY);
         rc = md_unlink(llu_i2sbi(dir)->ll_md_exp, &op_data, &request);
         if (!rc)
@@ -1173,7 +1031,7 @@ static int llu_iop_rename_raw(struct pnode *old, struct pnode *new)
         LASSERT(tgt);
 
         liblustre_wait_event(0);
-        llu_prep_md_op_data(&op_data, src, tgt, NULL, 0, 0, 
+        llu_prep_md_op_data(&op_data, src, tgt, NULL, 0, 0,
                             LUSTRE_OPC_ANY);
         rc = md_rename(llu_i2sbi(src)->ll_md_exp, &op_data,
                        oldname, oldnamelen, newname, newnamelen,
@@ -1196,7 +1054,7 @@ static int llu_statfs_internal(struct llu_sb_info *sbi,
         int rc;
         ENTRY;
 
-        rc = obd_statfs(class_exp2obd(sbi->ll_md_exp), osfs, max_age, 0);
+        rc = obd_statfs(NULL, sbi->ll_md_exp, osfs, max_age, 0);
         if (rc) {
                 CERROR("md_statfs fails: rc = %d\n", rc);
                 RETURN(rc);
@@ -1243,7 +1101,8 @@ static int llu_statfs(struct llu_sb_info *sbi, struct statfs *sfs)
         /* For now we will always get up-to-date statfs values, but in the
          * future we may allow some amount of caching on the client (e.g.
          * from QOS or lprocfs updates). */
-        rc = llu_statfs_internal(sbi, &osfs, cfs_time_current_64() - HZ);
+        rc = llu_statfs_internal(sbi, &osfs,
+                                 cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS));
         if (rc)
                 return rc;
 
@@ -1320,12 +1179,12 @@ static int llu_iop_mkdir_raw(struct pnode *pno, mode_t mode)
         if (st->st_nlink >= EXT2_LINK_MAX)
                 RETURN(err);
 
-        llu_prep_md_op_data(&op_data, dir, NULL, name, len, 0, 
+        llu_prep_md_op_data(&op_data, dir, NULL, name, len, 0,
                             LUSTRE_OPC_MKDIR);
 
         err = md_create(llu_i2sbi(dir)->ll_md_exp, &op_data, NULL, 0,
                         mode | S_IFDIR, current->fsuid, current->fsgid,
-                        current->cap_effective, 0, &request);
+                        cfs_curproc_cap_pack(), 0, &request);
         ptlrpc_req_finished(request);
         liblustre_wait_event(0);
         RETURN(err);
@@ -1347,7 +1206,7 @@ static int llu_iop_rmdir_raw(struct pnode *pno)
                (long long)llu_i2stat(dir)->st_ino,
                llu_i2info(dir)->lli_st_generation, dir);
 
-        llu_prep_md_op_data(&op_data, dir, NULL, name, len, S_IFDIR, 
+        llu_prep_md_op_data(&op_data, dir, NULL, name, len, S_IFDIR,
                             LUSTRE_OPC_ANY);
         rc = md_unlink(llu_i2sbi(dir)->ll_md_exp, &op_data, &request);
         ptlrpc_req_finished(request);
@@ -1368,20 +1227,23 @@ static int llu_file_flock(struct inode *ino,
                           int cmd,
                           struct file_lock *file_lock)
 {
-        struct llu_inode_info *lli = llu_i2info(ino);
-        struct intnl_stat *st = llu_i2stat(ino);
-        struct ldlm_res_id res_id =
-                { .name = {fid_seq(&lli->lli_fid),
-                           fid_oid(&lli->lli_fid),
-                           fid_ver(&lli->lli_fid),
-                           LDLM_FLOCK} };
-        struct ldlm_enqueue_info einfo = { LDLM_FLOCK, 0, NULL,
-                ldlm_flock_completion_ast, NULL, file_lock };
-
-        struct lustre_handle lockh = {0};
-        ldlm_policy_data_t flock;
-        int flags = 0;
-        int rc;
+       struct llu_inode_info *lli = llu_i2info(ino);
+       struct ldlm_res_id res_id =
+               { .name = {fid_seq(&lli->lli_fid),
+                          fid_oid(&lli->lli_fid),
+                          fid_ver(&lli->lli_fid),
+                          LDLM_FLOCK} };
+       struct ldlm_enqueue_info einfo = {
+               .ei_type        = LDLM_FLOCK,
+               .ei_mode        = 0,
+               .ei_cb_cp       = ldlm_flock_completion_ast,
+               .ei_cbdata      = file_lock,
+       };
+       struct intnl_stat     *st  = llu_i2stat(ino);
+       struct lustre_handle lockh = {0};
+       ldlm_policy_data_t flock;
+       __u64 flags = 0;
+       int rc;
 
         CDEBUG(D_VFSTRACE, "VFS Op:inode=%llu file_lock=%p\n",
                (unsigned long long)st->st_ino, file_lock);
@@ -1436,7 +1298,7 @@ static int llu_file_flock(struct inode *ino,
                 LBUG();
         }
 
-        CDEBUG(D_DLMTRACE, "inode=%llu, pid=%u, cmd=%d, flags=%#x, mode=%u, "
+       CDEBUG(D_DLMTRACE, "inode=%llu, pid=%u, cmd=%d, flags=%#llx, mode=%u, "
                "start="LPX64", end="LPX64"\n", (unsigned long long)st->st_ino,
                flock.l_flock.pid, cmd, flags, einfo.ei_mode, flock.l_flock.start,
                flock.l_flock.end);
@@ -1449,12 +1311,13 @@ static int llu_file_flock(struct inode *ino,
 
                 if (lmv->desc.ld_tgt_count < 1)
                         RETURN(rc = -ENODEV);
-                
-                if (lmv->tgts[0].ltd_exp != NULL)
-                        rc = ldlm_cli_enqueue(lmv->tgts[0].ltd_exp, NULL, &einfo, &res_id, 
-                                              &flock, &flags, NULL, 0, NULL, &lockh, 0);
-                else
-                        rc = -ENODEV;
+
+               if (lmv->tgts[0] != NULL && lmv->tgts[0]->ltd_exp != NULL)
+                       rc = ldlm_cli_enqueue(lmv->tgts[0]->ltd_exp, NULL,
+                                             &einfo, &res_id, &flock, &flags,
+                                             NULL, 0, LVB_T_NONE, &lockh, 0);
+               else
+                       rc = -ENODEV;
         }
         RETURN(rc);
 }
@@ -1641,56 +1504,51 @@ static int llu_get_grouplock(struct inode *inode, unsigned long arg)
 {
         struct llu_inode_info *lli = llu_i2info(inode);
         struct ll_file_data *fd = lli->lli_file_data;
-        ldlm_policy_data_t policy = { .l_extent = { .start = 0,
-                                                    .end = OBD_OBJECT_EOF}};
-        struct lustre_handle lockh = { 0 };
-        struct lov_stripe_md *lsm = lli->lli_smd;
-        ldlm_error_t err;
-        int flags = 0;
+        int rc;
+        struct ccc_grouplock grouplock;
         ENTRY;
 
+        if (fd->fd_flags & LL_FILE_IGNORE_LOCK) {
+                RETURN(-ENOTSUPP);
+        }
         if (fd->fd_flags & LL_FILE_GROUP_LOCKED) {
                 RETURN(-EINVAL);
         }
+        LASSERT(fd->fd_grouplock.cg_lock == NULL);
 
-        policy.l_extent.gid = arg;
-        if (lli->lli_open_flags & O_NONBLOCK)
-                flags = LDLM_FL_BLOCK_NOWAIT;
+        rc = cl_get_grouplock(cl_i2info(inode)->lli_clob,
+                              arg, (lli->lli_open_flags & O_NONBLOCK),
+                              &grouplock);
 
-        err = llu_extent_lock(fd, inode, lsm, LCK_GROUP, &policy, &lockh,
-                              flags);
-        if (err)
-                RETURN(err);
+        if (rc)
+                RETURN(rc);
 
-        fd->fd_flags |= LL_FILE_GROUP_LOCKED|LL_FILE_IGNORE_LOCK;
-        fd->fd_gid = arg;
-        memcpy(&fd->fd_cwlockh, &lockh, sizeof(lockh));
+        fd->fd_flags |= LL_FILE_GROUP_LOCKED;
+        fd->fd_grouplock = grouplock;
 
         RETURN(0);
 }
 
-static int llu_put_grouplock(struct inode *inode, unsigned long arg)
+int llu_put_grouplock(struct inode *inode, unsigned long arg)
 {
         struct llu_inode_info *lli = llu_i2info(inode);
         struct ll_file_data *fd = lli->lli_file_data;
-        struct lov_stripe_md *lsm = lli->lli_smd;
-        ldlm_error_t err;
+        struct ccc_grouplock grouplock;
         ENTRY;
 
         if (!(fd->fd_flags & LL_FILE_GROUP_LOCKED))
                 RETURN(-EINVAL);
 
-        if (fd->fd_gid != arg)
+        LASSERT(fd->fd_grouplock.cg_lock != NULL);
+
+        if (fd->fd_grouplock.cg_gid != arg)
                 RETURN(-EINVAL);
 
-        fd->fd_flags &= ~(LL_FILE_GROUP_LOCKED|LL_FILE_IGNORE_LOCK);
+        grouplock = fd->fd_grouplock;
+        memset(&fd->fd_grouplock, 0, sizeof(fd->fd_grouplock));
+        fd->fd_flags &= ~LL_FILE_GROUP_LOCKED;
 
-        err = llu_extent_unlock(fd, inode, lsm, LCK_GROUP, &fd->fd_cwlockh);
-        if (err)
-                RETURN(err);
-
-        fd->fd_gid = 0;
-        memset(&fd->fd_cwlockh, 0, sizeof(fd->fd_cwlockh));
+        cl_put_grouplock(&grouplock);
 
         RETURN(0);
 }
@@ -1703,21 +1561,34 @@ static int llu_lov_dir_setstripe(struct inode *ino, unsigned long arg)
         struct lov_user_md lum, *lump = (struct lov_user_md *)arg;
         int rc = 0;
 
-        llu_prep_md_op_data(&op_data, ino, NULL, NULL, 0, 0, 
+        llu_prep_md_op_data(&op_data, ino, NULL, NULL, 0, 0,
                             LUSTRE_OPC_ANY);
 
         LASSERT(sizeof(lum) == sizeof(*lump));
         LASSERT(sizeof(lum.lmm_objects[0]) ==
                 sizeof(lump->lmm_objects[0]));
-        rc = copy_from_user(&lum, lump, sizeof(lum));
-        if (rc)
+       if (copy_from_user(&lum, lump, sizeof(lum)))
                 return(-EFAULT);
 
-        if (lum.lmm_magic != LOV_USER_MAGIC)
+        switch (lum.lmm_magic) {
+        case LOV_USER_MAGIC_V1: {
+                if (lum.lmm_magic != cpu_to_le32(LOV_USER_MAGIC_V1))
+                        lustre_swab_lov_user_md_v1(&lum);
+                break;
+                }
+        case LOV_USER_MAGIC_V3: {
+                if (lum.lmm_magic != cpu_to_le32(LOV_USER_MAGIC_V3))
+                        lustre_swab_lov_user_md_v3((struct lov_user_md_v3 *)&lum);
+                break;
+                }
+        default: {
+                CDEBUG(D_IOCTL, "bad userland LOV MAGIC:"
+                                " %#08x != %#08x nor %#08x\n",
+                                lum.lmm_magic, LOV_USER_MAGIC_V1,
+                                LOV_USER_MAGIC_V3);
                 RETURN(-EINVAL);
-
-        if (lum.lmm_magic != cpu_to_le32(LOV_USER_MAGIC))
-                lustre_swab_lov_user_md(&lum);
+        }
+        }
 
         /* swabbing is done in lov_setstripe() on server side */
         rc = md_setattr(sbi->ll_md_exp, &op_data, &lum,
@@ -1734,47 +1605,34 @@ static int llu_lov_dir_setstripe(struct inode *ino, unsigned long arg)
 }
 
 static int llu_lov_setstripe_ea_info(struct inode *ino, int flags,
-                                     struct lov_user_md *lum, int lum_size)
+                                    struct lov_user_md *lum, int lum_size)
 {
-        struct llu_sb_info *sbi = llu_i2sbi(ino);
-        struct llu_inode_info *lli = llu_i2info(ino);
-        struct llu_inode_info *lli2 = NULL;
-        struct lov_stripe_md *lsm;
-        struct lookup_intent oit = {.it_op = IT_OPEN, .it_flags = flags};
-        struct ldlm_enqueue_info einfo = { LDLM_IBITS, LCK_CR,
-                llu_md_blocking_ast, ldlm_completion_ast, NULL, NULL };
-
-        struct ptlrpc_request *req = NULL;
-        struct lustre_md md;
-        struct md_op_data data = {{ 0 }};
-        struct lustre_handle lockh;
-        int rc = 0;
-        ENTRY;
-
-        lsm = lli->lli_smd;
-        if (lsm) {
-                CDEBUG(D_IOCTL, "stripe already exists for ino "DFID"\n",
-                       PFID(&lli->lli_fid));
-                return -EEXIST;
-        }
-
-        OBD_ALLOC(lli2, sizeof(struct llu_inode_info));
-        if (!lli2)
-                return -ENOMEM;
-
-        memcpy(lli2, lli, sizeof(struct llu_inode_info));
-        lli2->lli_open_count = 0;
-        lli2->lli_it = NULL;
-        lli2->lli_file_data = NULL;
-        lli2->lli_smd = NULL;
-        lli2->lli_symlink_name = NULL;
-        ino->i_private = lli2;
+       struct llu_sb_info *sbi = llu_i2sbi(ino);
+       struct llu_inode_info *lli = llu_i2info(ino);
+       struct lookup_intent oit = {.it_op = IT_OPEN, .it_flags = flags};
+       struct ldlm_enqueue_info einfo = {
+               .ei_type        = LDLM_IBITS,
+               .ei_mode        = LCK_CR,
+               .ei_cb_bl       = llu_md_blocking_ast,
+               .ei_cb_cp       = ldlm_completion_ast,
+       };
+       struct ptlrpc_request *req = NULL;
+       struct lustre_md md;
+       struct md_op_data data = {{ 0 }};
+       struct lustre_handle lockh;
+       int rc = 0;
+       ENTRY;
+
+       if (lli->lli_has_smd) {
+               CDEBUG(D_IOCTL, "stripe already exists for ino "DFID"\n",
+                      PFID(&lli->lli_fid));
+               return -EEXIST;
+       }
 
         llu_prep_md_op_data(&data, NULL, ino, NULL, 0, O_RDWR,
                             LUSTRE_OPC_ANY);
-
         rc = md_enqueue(sbi->ll_md_exp, &einfo, &oit, &data,
-                        &lockh, lum, lum_size, LDLM_FL_INTENT_ONLY);
+                        &lockh, lum, lum_size, NULL, LDLM_FL_INTENT_ONLY);
         if (rc)
                 GOTO(out, rc);
 
@@ -1796,27 +1654,20 @@ static int llu_lov_setstripe_ea_info(struct inode *ino, int flags,
         if (rc)
                 GOTO(out, rc);
 
-        llu_update_inode(ino, md.body, md.lsm);
-        lli->lli_smd = lli2->lli_smd;
-        lli2->lli_smd = NULL;
-
-        llu_local_open(lli2, &oit);
-
+        llu_update_inode(ino, &md);
+        llu_local_open(lli, &oit);
         /* release intent */
         if (lustre_handle_is_used(&lockh))
                 ldlm_lock_decref(&lockh, LCK_CR);
-
         ptlrpc_req_finished(req);
         req = NULL;
-
         rc = llu_file_release(ino);
- out:
-        ino->i_private = lli;
-        if (lli2)
-                OBD_FREE(lli2, sizeof(struct llu_inode_info));
+        EXIT;
+
+out:
         if (req != NULL)
                 ptlrpc_req_finished(req);
-        RETURN(rc);
+        return rc;
 }
 
 static int llu_lov_file_setstripe(struct inode *ino, unsigned long arg)
@@ -1828,8 +1679,7 @@ static int llu_lov_file_setstripe(struct inode *ino, unsigned long arg)
 
         LASSERT(sizeof(lum) == sizeof(*lump));
         LASSERT(sizeof(lum.lmm_objects[0]) == sizeof(lump->lmm_objects[0]));
-        rc = copy_from_user(&lum, lump, sizeof(lum));
-        if (rc)
+       if (copy_from_user(&lum, lump, sizeof(lum)))
                 RETURN(-EFAULT);
 
         rc = llu_lov_setstripe_ea_info(ino, flags, &lum, sizeof(lum));
@@ -1849,13 +1699,15 @@ static int llu_lov_setstripe(struct inode *ino, unsigned long arg)
 
 static int llu_lov_getstripe(struct inode *ino, unsigned long arg)
 {
-        struct lov_stripe_md *lsm = llu_i2info(ino)->lli_smd;
-
-        if (!lsm)
-                RETURN(-ENODATA);
-
-        return obd_iocontrol(LL_IOC_LOV_GETSTRIPE, llu_i2obdexp(ino), 0, lsm,
-                            (void *)arg);
+       struct lov_stripe_md *lsm = NULL;
+       int rc = -ENODATA;
+
+       lsm = ccc_inode_lsm_get(ino);
+       if (lsm != NULL)
+               rc = obd_iocontrol(LL_IOC_LOV_GETSTRIPE, llu_i2obdexp(ino), 0, lsm,
+                                  (void *)arg);
+       ccc_inode_lsm_put(ino, lsm);
+       return rc;
 }
 
 static int llu_iop_ioctl(struct inode *ino, unsigned long int request,
@@ -1908,9 +1760,8 @@ static int llu_iop_datasync(struct inode *inode)
         return 0;
 }
 
-struct filesys_ops llu_filesys_ops =
-{
-        fsop_gone: llu_fsop_gone,
+static struct filesys_ops llu_filesys_ops = {
+       .fsop_gone      = llu_fsop_gone,
 };
 
 struct inode *llu_iget(struct filesys *fs, struct lustre_md *md)
@@ -1936,50 +1787,19 @@ struct inode *llu_iget(struct filesys *fs, struct lustre_md *md)
                         I_RELE(inode);
                 }
                 else {
-                        llu_update_inode(inode, md->body, md->lsm);
+                        llu_update_inode(inode, md);
                         return inode;
                 }
         }
 
         inode = llu_new_inode(fs, &fid);
         if (inode)
-                llu_update_inode(inode, md->body, md->lsm);
+                llu_update_inode(inode, md);
 
         return inode;
 }
 
 static int
-llu_init_ea_size(struct obd_export *md_exp, struct obd_export *dt_exp)
-{
-        struct lov_stripe_md lsm = { .lsm_magic = LOV_MAGIC };
-        __u32 valsize = sizeof(struct lov_desc);
-        int rc, easize, def_easize, cookiesize;
-        struct lov_desc desc;
-        __u32 stripes;
-        ENTRY;
-
-        rc = obd_get_info(dt_exp, sizeof(KEY_LOVDESC), KEY_LOVDESC,
-                          &valsize, &desc);
-        if (rc)
-                RETURN(rc);
-
-        stripes = min(desc.ld_tgt_count, (__u32)LOV_MAX_STRIPE_COUNT);
-        lsm.lsm_stripe_count = stripes;
-        easize = obd_size_diskmd(dt_exp, &lsm);
-
-        lsm.lsm_stripe_count = desc.ld_default_stripe_count;
-        def_easize = obd_size_diskmd(dt_exp, &lsm);
-
-        cookiesize = stripes * sizeof(struct llog_cookie);
-
-        CDEBUG(D_HA, "updating max_mdsize/max_cookiesize: %d/%d\n",
-               easize, cookiesize);
-
-        rc = md_init_ea_size(md_exp, easize, def_easize, cookiesize);
-        RETURN(rc);
-}
-
-static int
 llu_fsswop_mount(const char *source,
                  unsigned flags,
                  const void *data __IS_UNUSED,
@@ -1990,22 +1810,21 @@ llu_fsswop_mount(const char *source,
         struct inode *root;
         struct pnode_base *rootpb;
         struct obd_device *obd;
-        struct lu_fid rootfid;
         struct llu_sb_info *sbi;
         struct obd_statfs osfs;
         static struct qstr noname = { NULL, 0, 0 };
         struct ptlrpc_request *request = NULL;
-        struct lustre_handle md_conn = {0, };
-        struct lustre_handle dt_conn = {0, };
         struct lustre_md md;
         class_uuid_t uuid;
         struct config_llog_instance cfg = {0, };
-        char ll_instance[sizeof(sbi) * 2 + 1];
         struct lustre_profile *lprof;
         char *zconf_mgsnid, *zconf_profile;
         char *osc = NULL, *mdc = NULL;
         int async = 1, err = -EINVAL;
         struct obd_connect_data ocd = {0,};
+        struct md_op_data op_data = {{0}};
+        /* %p for void* in printf needs 16+2 characters: 0xffffffffffffffff */
+        const int instlen = sizeof(cfg.cfg_instance) * 2 + 2;
 
         ENTRY;
 
@@ -2030,10 +1849,9 @@ llu_fsswop_mount(const char *source,
 
         /* generate a string unique to this super, let's try
          the address of the super itself.*/
-        sprintf(ll_instance, "%p", sbi);
+        cfg.cfg_instance = sbi;
 
         /* retrive & parse config log */
-        cfg.cfg_instance = ll_instance;
         cfg.cfg_uuid = sbi->ll_sb_uuid;
         err = liblustre_process_log(&cfg, zconf_mgsnid, zconf_profile, 1);
         if (err < 0) {
@@ -2046,11 +1864,11 @@ llu_fsswop_mount(const char *source,
                 CERROR("No profile found: %s\n", zconf_profile);
                 GOTO(out_free, err = -EINVAL);
         }
-        OBD_ALLOC(osc, strlen(lprof->lp_dt) + strlen(ll_instance) + 2);
-        sprintf(osc, "%s-%s", lprof->lp_dt, ll_instance);
+        OBD_ALLOC(osc, strlen(lprof->lp_dt) + instlen + 2);
+        sprintf(osc, "%s-%p", lprof->lp_dt, cfg.cfg_instance);
 
-        OBD_ALLOC(mdc, strlen(lprof->lp_md) + strlen(ll_instance) + 2);
-        sprintf(mdc, "%s-%s", lprof->lp_md, ll_instance);
+        OBD_ALLOC(mdc, strlen(lprof->lp_md) + instlen + 2);
+        sprintf(mdc, "%s-%p", lprof->lp_md, cfg.cfg_instance);
 
         if (!osc) {
                 CERROR("no osc\n");
@@ -2072,11 +1890,14 @@ llu_fsswop_mount(const char *source,
                 CERROR("MDC %s: not setup or attached\n", mdc);
                 GOTO(out_free, err = -EINVAL);
         }
-        obd_set_info_async(obd->obd_self_export, sizeof(KEY_ASYNC), KEY_ASYNC,
-                           sizeof(async), &async, NULL);
+        obd_set_info_async(NULL, obd->obd_self_export, sizeof(KEY_ASYNC),
+                           KEY_ASYNC, sizeof(async), &async, NULL);
 
         ocd.ocd_connect_flags = OBD_CONNECT_IBITS | OBD_CONNECT_VERSION |
-                                OBD_CONNECT_FID | OBD_CONNECT_AT;
+                                OBD_CONNECT_FID | OBD_CONNECT_AT |
+                               OBD_CONNECT_VBR | OBD_CONNECT_FULL20 |
+                               OBD_CONNECT_LVB_TYPE;
+
 #ifdef LIBLUSTRE_POSIX_ACL
         ocd.ocd_connect_flags |= OBD_CONNECT_ACL;
 #endif
@@ -2084,14 +1905,13 @@ llu_fsswop_mount(const char *source,
         ocd.ocd_version = LUSTRE_VERSION_CODE;
 
         /* setup mdc */
-        err = obd_connect(NULL, &md_conn, obd, &sbi->ll_sb_uuid, &ocd, NULL);
+        err = obd_connect(NULL, &sbi->ll_md_exp, obd, &sbi->ll_sb_uuid, &ocd, NULL);
         if (err) {
                 CERROR("cannot connect to %s: rc = %d\n", mdc, err);
                 GOTO(out_free, err);
         }
-        sbi->ll_md_exp = class_conn2export(&md_conn);
 
-        err = obd_statfs(obd, &osfs, 100000000, 0);
+        err = obd_statfs(NULL, sbi->ll_md_exp, &osfs, 100000000, 0);
         if (err)
                 GOTO(out_md, err);
 
@@ -2105,44 +1925,44 @@ llu_fsswop_mount(const char *source,
                 CERROR("OSC %s: not setup or attached\n", osc);
                 GOTO(out_md, err = -EINVAL);
         }
-        obd_set_info_async(obd->obd_self_export, sizeof(KEY_ASYNC), KEY_ASYNC,
-                           sizeof(async), &async, NULL);
+        obd_set_info_async(NULL, obd->obd_self_export, sizeof(KEY_ASYNC),
+                           KEY_ASYNC, sizeof(async), &async, NULL);
 
         obd->obd_upcall.onu_owner = &sbi->ll_lco;
-        obd->obd_upcall.onu_upcall = ll_ocd_update;
+        obd->obd_upcall.onu_upcall = cl_ocd_update;
 
         ocd.ocd_connect_flags = OBD_CONNECT_SRVLOCK | OBD_CONNECT_REQPORTAL |
                                 OBD_CONNECT_VERSION | OBD_CONNECT_TRUNCLOCK |
-                                OBD_CONNECT_FID | OBD_CONNECT_AT;
+                                OBD_CONNECT_FID | OBD_CONNECT_AT |
+                               OBD_CONNECT_FULL20 | OBD_CONNECT_EINPROGRESS |
+                               OBD_CONNECT_LVB_TYPE;
+
         ocd.ocd_version = LUSTRE_VERSION_CODE;
-        err = obd_connect(NULL, &dt_conn, obd, &sbi->ll_sb_uuid, &ocd, NULL);
+        err = obd_connect(NULL, &sbi->ll_dt_exp, obd, &sbi->ll_sb_uuid, &ocd, NULL);
         if (err) {
                 CERROR("cannot connect to %s: rc = %d\n", osc, err);
                 GOTO(out_md, err);
         }
-        sbi->ll_dt_exp = class_conn2export(&dt_conn);
         sbi->ll_lco.lco_flags = ocd.ocd_connect_flags;
+        sbi->ll_lco.lco_md_exp = sbi->ll_md_exp;
+        sbi->ll_lco.lco_dt_exp = sbi->ll_dt_exp;
 
-        err = obd_register_lock_cancel_cb(sbi->ll_dt_exp,
-                                          llu_extent_lock_cancel_cb);
-        if (err) {
-                CERROR("cannot register lock cancel callback: rc = %d\n", err);
-                GOTO(out_dt, err);
-        }
-
-        llu_init_ea_size(sbi->ll_md_exp, sbi->ll_dt_exp);
-
-        err = md_getstatus(sbi->ll_md_exp, &rootfid, NULL);
+        fid_zero(&sbi->ll_root_fid);
+        err = md_getstatus(sbi->ll_md_exp, &sbi->ll_root_fid, NULL);
         if (err) {
                 CERROR("cannot mds_connect: rc = %d\n", err);
                 GOTO(out_lock_cn_cb, err);
         }
-        CDEBUG(D_SUPER, "rootfid "DFID"\n", PFID(&rootfid));
-        sbi->ll_root_fid = rootfid;
+        if (!fid_is_sane(&sbi->ll_root_fid)) {
+                CERROR("Invalid root fid during mount\n");
+                GOTO(out_lock_cn_cb, err = -EINVAL);
+        }
+        CDEBUG(D_SUPER, "rootfid "DFID"\n", PFID(&sbi->ll_root_fid));
 
+        op_data.op_fid1 = sbi->ll_root_fid;
+        op_data.op_valid = OBD_MD_FLGETATTR | OBD_MD_FLBLOCKS;
         /* fetch attr of root inode */
-        err = md_getattr(sbi->ll_md_exp, &rootfid, NULL,
-                         OBD_MD_FLGETATTR | OBD_MD_FLBLOCKS, 0, &request);
+        err = md_getattr(sbi->ll_md_exp, &op_data, &request);
         if (err) {
                 CERROR("md_getattr failed for root: rc = %d\n", err);
                 GOTO(out_lock_cn_cb, err);
@@ -2178,63 +1998,62 @@ llu_fsswop_mount(const char *source,
                 goto out_inode;
         }
 
+        cl_sb_init(sbi);
+
         ptlrpc_req_finished(request);
 
         CDEBUG(D_SUPER, "LibLustre: %s mounted successfully!\n", source);
-        liblustre_wait_idle();
-
-        return 0;
+        err = 0;
+        goto out_free;
 
 out_inode:
         _sysio_i_gone(root);
 out_request:
         ptlrpc_req_finished(request);
 out_lock_cn_cb:
-        obd_unregister_lock_cancel_cb(sbi->ll_dt_exp,
-                                      llu_extent_lock_cancel_cb);
-out_dt:
         obd_disconnect(sbi->ll_dt_exp);
 out_md:
         obd_disconnect(sbi->ll_md_exp);
 out_free:
         if (osc)
-                OBD_FREE(osc, strlen(osc) + 1);
+                OBD_FREE(osc, strlen(lprof->lp_dt) + instlen + 2);
         if (mdc)
-                OBD_FREE(mdc, strlen(mdc) + 1);
-        OBD_FREE(sbi, sizeof(*sbi));
+                OBD_FREE(mdc, strlen(lprof->lp_md) + instlen + 2);
+        if (err != 0)
+                OBD_FREE(sbi, sizeof(*sbi));
         liblustre_wait_idle();
         return err;
 }
 
 struct fssw_ops llu_fssw_ops = {
-        llu_fsswop_mount
+       .fsswop_mount           = llu_fsswop_mount,
 };
 
 static struct inode_ops llu_inode_ops = {
-        inop_lookup:    llu_iop_lookup,
-        inop_getattr:   llu_iop_getattr,
-        inop_setattr:   llu_iop_setattr,
-        inop_filldirentries:     llu_iop_filldirentries,
-        inop_mkdir:     llu_iop_mkdir_raw,
-        inop_rmdir:     llu_iop_rmdir_raw,
-        inop_symlink:   llu_iop_symlink_raw,
-        inop_readlink:  llu_iop_readlink,
-        inop_open:      llu_iop_open,
-        inop_close:     llu_iop_close,
-        inop_link:      llu_iop_link_raw,
-        inop_unlink:    llu_iop_unlink_raw,
-        inop_rename:    llu_iop_rename_raw,
-        inop_pos:       llu_iop_pos,
-        inop_read:      llu_iop_read,
-        inop_write:     llu_iop_write,
-        inop_iodone:    llu_iop_iodone,
-        inop_fcntl:     llu_iop_fcntl,
-        inop_sync:      llu_iop_sync,
-        inop_datasync:  llu_iop_datasync,
-        inop_ioctl:     llu_iop_ioctl,
-        inop_mknod:     llu_iop_mknod_raw,
+       .inop_lookup            = llu_iop_lookup,
+       .inop_getattr           = llu_iop_getattr,
+       .inop_setattr           = llu_iop_setattr,
+       .inop_filldirentries    = llu_iop_filldirentries,
+       .inop_mkdir             = llu_iop_mkdir_raw,
+       .inop_rmdir             = llu_iop_rmdir_raw,
+       .inop_symlink           = llu_iop_symlink_raw,
+       .inop_readlink          = llu_iop_readlink,
+       .inop_open              = llu_iop_open,
+       .inop_close             = llu_iop_close,
+       .inop_link              = llu_iop_link_raw,
+       .inop_unlink            = llu_iop_unlink_raw,
+       .inop_rename            = llu_iop_rename_raw,
+       .inop_pos               = llu_iop_pos,
+       .inop_read              = llu_iop_read,
+       .inop_write             = llu_iop_write,
+       .inop_iodone            = llu_iop_iodone,
+       .inop_fcntl             = llu_iop_fcntl,
+       .inop_sync              = llu_iop_sync,
+       .inop_datasync          = llu_iop_datasync,
+       .inop_ioctl             = llu_iop_ioctl,
+       .inop_mknod             = llu_iop_mknod_raw,
 #ifdef _HAVE_STATVFS
-        inop_statvfs:   llu_iop_statvfs,
+       .inop_statvfs           = llu_iop_statvfs,
 #endif
-        inop_gone:      llu_iop_gone,
+       .inop_gone              = llu_iop_gone,
 };