X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fmdt%2Fmdt_internal.h;h=1317643310f06055e192fe44112661989361ad7b;hb=0e67cdb9bd986e1b4dfa915ae8c2e7c2687f3df2;hp=e84628f45f256aaa92042080b73d018eaf7e85a7;hpb=9eb3d1db42d2937daef25950f6527ccb46221f8e;p=fs%2Flustre-release.git diff --git a/lustre/mdt/mdt_internal.h b/lustre/mdt/mdt_internal.h index e84628f..1317643 100644 --- a/lustre/mdt/mdt_internal.h +++ b/lustre/mdt/mdt_internal.h @@ -28,6 +28,9 @@ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. + * + * Copyright (c) 2011 Whamcloud, Inc. + * */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -185,7 +188,9 @@ struct mdt_object { int mot_ioepoch_count; int mot_writecount; /* Lock to protect object's IO epoch. */ - cfs_semaphore_t mot_ioepoch_sem; + cfs_semaphore_t mot_ioepoch_sem; + /* Lock to protect create_data */ + cfs_semaphore_t mot_lov_sem; }; enum mdt_object_flags { @@ -204,6 +209,8 @@ enum mdt_object_flags { MOF_SOM_RECOV = (1 << 1), /** File has been just created. */ MOF_SOM_CREATED = (1 << 2), + /** lov object has been created. */ + MOF_LOV_CREATED = (1 << 3), }; struct mdt_lock_handle { @@ -405,32 +412,6 @@ enum mdt_txn_op { MDT_TXN_LAST_RCVD_WRITE_OP, }; -/* - * Info allocated per-transaction. - */ -#define MDT_MAX_COMMIT_CB 4 -struct mdt_txn_info { - __u64 txi_transno; - unsigned int txi_cb_count; - struct lut_commit_cb txi_cb[MDT_MAX_COMMIT_CB]; -}; - -extern struct lu_context_key mdt_txn_key; - -static inline void mdt_trans_add_cb(const struct thandle *th, - lut_cb_t cb_func, void *cb_data) -{ - struct mdt_txn_info *txi; - - txi = lu_context_key_get(&th->th_ctx, &mdt_txn_key); - LASSERT(txi->txi_cb_count < ARRAY_SIZE(txi->txi_cb)); - - /* add new callback */ - txi->txi_cb[txi->txi_cb_count].lut_cb_func = cb_func; - txi->txi_cb[txi->txi_cb_count].lut_cb_data = cb_data; - txi->txi_cb_count++; -} - static inline const struct md_device_operations * mdt_child_ops(struct mdt_device * m) { @@ -576,7 +557,6 @@ int mdt_client_new(const struct lu_env *env, int mdt_export_stats_init(struct obd_device *obd, struct obd_export *exp, - int reconnect, void *client_nid); int mdt_pin(struct mdt_thread_info* info); @@ -691,7 +671,7 @@ static inline void mdt_fail_write(const struct lu_env *env, struct dt_device *dd, int id) { if (OBD_FAIL_CHECK_ORSET(id, OBD_FAIL_ONCE)) { - CERROR(LUSTRE_MDT_NAME": obd_fail_loc=%x, fail write ops\n", + CERROR(LUSTRE_MDT_NAME": cfs_fail_loc=%x, fail write ops\n", id); dd->dd_ops->dt_ro(env, dd); /* We set FAIL_ONCE because we never "un-fail" a device */ @@ -815,8 +795,12 @@ enum { LPROC_MDT_MKDIR, LPROC_MDT_RMDIR, LPROC_MDT_RENAME, + LPROC_MDT_GETATTR, + LPROC_MDT_SETATTR, LPROC_MDT_GETXATTR, LPROC_MDT_SETXATTR, + LPROC_MDT_STATFS, + LPROC_MDT_SYNC, LPROC_MDT_LAST, }; void mdt_counter_incr(struct obd_export *exp, int opcode);