* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011, 2012, Whamcloud, Inc.
+ * Copyright (c) 2011, 2013, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
#define DEBUG_SUBSYSTEM S_FID
-#ifdef __KERNEL__
-# include <libcfs/libcfs.h>
-# include <linux/module.h>
-#else /* __KERNEL__ */
-# include <liblustre.h>
-#endif
-
-#include <obd.h>
-#include <obd_class.h>
+#include <libcfs/libcfs.h>
#include <dt_object.h>
#include <md_object.h>
#include <obd_support.h>
-#include <lustre_req_layout.h>
+#include <lustre_capa.h>
#include <lustre_fid.h>
+#include <lustre_fld.h>
#include "fid_internal.h"
-#ifdef __KERNEL__
-
static struct lu_buf *seq_store_buf(struct seq_thread_info *info)
{
struct lu_buf *buf;
rc = dt_declare_record_write(env, seq->lss_obj,
sizeof(struct lu_seq_range), 0, th);
- if (rc)
- GOTO(exit, rc);
-
- if (out != NULL) {
- rc = fld_declare_server_create(seq->lss_site->ms_server_fld,
- env, th);
- if (rc)
- GOTO(exit, rc);
- }
+ if (rc)
+ GOTO(exit, rc);
+
+ if (out != NULL) {
+ rc = fld_declare_server_create(env,
+ seq->lss_site->ss_server_fld,
+ out, th);
+ if (rc)
+ GOTO(exit, rc);
+ }
rc = dt_trans_start_local(env, dt_dev, th);
- if (rc)
- GOTO(exit, rc);
+ if (rc)
+ GOTO(exit, rc);
/* Store ranges in le format. */
range_cpu_to_le(&info->sti_space, &seq->lss_space);
rc = dt_record_write(env, seq->lss_obj, seq_store_buf(info), &pos, th);
- if (rc) {
- CERROR("%s: Can't write space data, rc %d\n",
- seq->lss_name, rc);
+ if (rc) {
+ CERROR("%s: Can't write space data, rc %d\n",
+ seq->lss_name, rc);
GOTO(exit, rc);
- } else if (out != NULL) {
- rc = fld_server_create(seq->lss_site->ms_server_fld,
- env, out, th);
- if (rc) {
- CERROR("%s: Can't Update fld database, rc %d\n",
- seq->lss_name, rc);
+ } else if (out != NULL) {
+ rc = fld_server_create(env, seq->lss_site->ss_server_fld, out,
+ th);
+ if (rc) {
+ CERROR("%s: Can't Update fld database, rc %d\n",
+ seq->lss_name, rc);
GOTO(exit, rc);
- }
- }
- /* next sequence update will need sync until this update is committed
- * in case of sync operation this is not needed obviously */
- if (!sync)
- /* if callback can't be added then sync always */
- sync = !!seq_update_cb_add(th, seq);
-
- th->th_sync |= sync;
+ }
+ }
+ /* next sequence update will need sync until this update is committed
+ * in case of sync operation this is not needed obviously */
+ if (!sync)
+ /* if callback can't be added then sync always */
+ sync = !!seq_update_cb_add(th, seq);
+
+ th->th_sync |= sync;
exit:
- dt_trans_stop(env, dt_dev, th);
- return rc;
+ dt_trans_stop(env, dt_dev, th);
+ return rc;
}
/*
EXIT;
}
-#endif