/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
* vim:expandtab:shiftwidth=8:tabstop=8:
*
- * Copyright (c) 2003 Cluster File Systems, Inc.
+ * This file is part of Lustre, http://www.lustre.org
*
- * This file is part of Lustre, http://www.lustre.org.
- *
- * 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.
- *
- * 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.
- *
- * 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.
+ * MDC internal definitions.
*/
-#ifndef MDC_INTERNAL_H
-#define MDC_INTERNAL_H
-void mdc_getattr_pack(struct lustre_msg *msg, int valid, int offset,
+#include <lustre_mds.h>
+void mdc_pack_req_body(struct ptlrpc_request *req, int offset,
+ __u64 valid, struct ll_fid *fid, int ea_size, int flags);
+void mdc_pack_rep_body(struct ptlrpc_request *);
+void mdc_readdir_pack(struct ptlrpc_request *req, int offset, __u64 pg_off,
+ __u32 size, struct ll_fid *mdc_fid);
+void mdc_getattr_pack(struct ptlrpc_request *req, int offset, int valid,
int flags, struct mdc_op_data *data);
-void mdc_open_pack(struct lustre_msg *msg, int offset,
+void mdc_setattr_pack(struct ptlrpc_request *req, int offset,
+ struct mdc_op_data *data,
+ struct iattr *iattr, void *ea, int ealen,
+ void *ea2, int ea2len);
+void mdc_create_pack(struct ptlrpc_request *req, int offset,
+ struct mdc_op_data *op_data, const void *data, int datalen,
+ __u32 mode, __u32 uid, __u32 gid, __u32 cap_effective,
+ __u64 rdev);
+void mdc_open_pack(struct ptlrpc_request *req, int offset,
struct mdc_op_data *op_data, __u32 mode, __u64 rdev,
- __u32 flags, const void *lmm, int lmmlen);
-void mdc_pack_req_body(struct ptlrpc_request *);
-void mdc_pack_rep_body(struct ptlrpc_request *);
-void mdc_readdir_pack(struct ptlrpc_request *req, __u64 offset, __u32 size,
- struct ll_fid *mdc_fid);
+ __u32 flags, const void *data, int datalen);
+void mdc_join_pack(struct ptlrpc_request *req, int offset,
+ struct mdc_op_data *op_data, __u64 head_size);
+void mdc_unlink_pack(struct ptlrpc_request *req, int offset,
+ struct mdc_op_data *data);
+void mdc_link_pack(struct ptlrpc_request *req, int offset,
+ struct mdc_op_data *data);
+void mdc_rename_pack(struct ptlrpc_request *req, int offset,
+ struct mdc_op_data *data,
+ const char *old, int oldlen, const char *new, int newlen);
void mdc_close_pack(struct ptlrpc_request *req, int offset, struct obdo *oa,
- int valid, struct obd_client_handle *och);
+ int valid, struct obd_client_handle *och);
+void mdc_exit_request(struct client_obd *cli);
+void mdc_enter_request(struct client_obd *cli);
struct mdc_open_data {
struct obd_client_handle *mod_och;
lck->rpcl_it = NULL;
}
-static inline void mdc_get_rpc_lock(struct mdc_rpc_lock *lck,
+static inline void mdc_get_rpc_lock(struct mdc_rpc_lock *lck,
struct lookup_intent *it)
{
ENTRY;
- down(&lck->rpcl_sem);
- if (it) {
+ if (!it || (it->it_op != IT_GETATTR && it->it_op != IT_LOOKUP)) {
+ down(&lck->rpcl_sem);
+ LASSERT(lck->rpcl_it == NULL);
lck->rpcl_it = it;
}
}
-static inline void mdc_put_rpc_lock(struct mdc_rpc_lock *lck,
+static inline void mdc_put_rpc_lock(struct mdc_rpc_lock *lck,
struct lookup_intent *it)
{
- EXIT;
- if (it == NULL) {
- LASSERT(it == lck->rpcl_it);
- up(&lck->rpcl_sem);
- return;
- }
- if (it) {
+ if (!it || (it->it_op != IT_GETATTR && it->it_op != IT_LOOKUP)) {
LASSERT(it == lck->rpcl_it);
lck->rpcl_it = NULL;
up(&lck->rpcl_sem);
}
+ EXIT;
}
-
-#endif /* MDC_INTERNAL_H */