Whamcloud - gitweb
LU-1996 lustre: Flexible changelog format.
[fs/lustre-release.git] / lustre / llite / lcommon_cl.c
index afda860..84ff1ee 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_LLITE
 
-#ifdef __KERNEL__
-# include <libcfs/libcfs.h>
-# include <linux/fs.h>
-# include <linux/sched.h>
-# include <linux/mm.h>
-# include <linux/quotaops.h>
-# include <linux/highmem.h>
-# include <linux/pagemap.h>
-# include <linux/rbtree.h>
-#else /* __KERNEL__ */
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/queue.h>
-#include <fcntl.h>
-# include <liblustre.h>
-#endif
+#include <libcfs/libcfs.h>
+#include <linux/fs.h>
+#include <linux/sched.h>
+#include <linux/mm.h>
+#include <linux/quotaops.h>
+#include <linux/highmem.h>
+#include <linux/pagemap.h>
+#include <linux/rbtree.h>
 
 #include <obd.h>
 #include <obd_support.h>
 #include <lustre_fid.h>
-#include <lustre_lite.h>
 #include <lustre_dlm.h>
 #include <lustre_ver.h>
 #include <lustre_mdc.h>
 
 #include <lclient.h>
 
-#ifdef __KERNEL__
-#include "../llite/llite_internal.h"
-#else
-#include "../liblustre/llite_lib.h"
-#endif
+#include "llite_internal.h"
 
 static const struct cl_req_operations ccc_req_ops;
 
@@ -364,13 +347,13 @@ struct lu_object *ccc_object_alloc(const struct lu_env *env,
 }
 
 int ccc_object_init0(const struct lu_env *env,
-                            struct ccc_object *vob,
-                            const struct cl_object_conf *conf)
+                    struct ccc_object *vob,
+                    const struct cl_object_conf *conf)
 {
-        vob->cob_inode = conf->coc_inode;
-        vob->cob_transient_pages = 0;
+       vob->cob_inode = conf->coc_inode;
+       atomic_set(&vob->cob_transient_pages, 0);
        cl_object_page_init(&vob->cob_cl, sizeof(struct ccc_page));
-        return 0;
+       return 0;
 }
 
 int ccc_object_init(const struct lu_env *env, struct lu_object *obj,
@@ -388,7 +371,7 @@ int ccc_object_init(const struct lu_env *env, struct lu_object *obj,
                 const struct cl_object_conf *cconf;
 
                 cconf = lu2cl_conf(conf);
-                CFS_INIT_LIST_HEAD(&vob->cob_pending_list);
+               INIT_LIST_HEAD(&vob->cob_pending_list);
                 lu_object_add(obj, below);
                 result = ccc_object_init0(env, vob, cconf);
         } else
@@ -961,10 +944,8 @@ void ccc_req_attr_set(const struct lu_env *env,
        obdo_set_parent_fid(oa, &cl_i2info(inode)->lli_fid);
        if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_INVALID_PFID))
                oa->o_parent_oid++;
-#ifdef __KERNEL__
        memcpy(attr->cra_jobid, cl_i2info(inode)->lli_jobid,
-              JOBSTATS_JOBID_SIZE);
-#endif
+              LUSTRE_JOBID_SIZE);
 }
 
 static const struct cl_req_operations ccc_req_ops = {
@@ -1156,9 +1137,7 @@ int cl_file_inode_init(struct inode *inode, struct lustre_md *md)
                  * there is no clob in cache with the given fid, so it is
                  * unnecessary to perform lookup-alloc-lookup-insert, just
                  * alloc and insert directly. */
-#ifdef __KERNEL__
                 LASSERT(inode->i_state & I_NEW);
-#endif
                 conf.coc_lu.loc_flags = LOC_F_NEW;
                 clob = cl_object_find(env, lu2cl_dev(site->ls_top_dev),
                                       fid, &conf);