#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;
}
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,
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
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 = {
* 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);