1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * This file is part of Lustre, http://www.lustre.org
7 * See also lustre_idl.h for wire formats of requests.
14 # include <linux/fs.h>
15 # include <linux/dcache.h>
16 # ifdef CONFIG_FS_POSIX_ACL
17 # ifdef HAVE_XATTR_ACL
18 # include <linux/xattr_acl.h>
19 # endif /*HAVE_XATTR_ACL */
20 # ifdef HAVE_LINUX_POSIX_ACL_XATTR_H
21 # include <linux/posix_acl_xattr.h>
22 # endif /* HAVE_LINUX_POSIX_ACL_XATTR_H */
23 # endif /* CONFIG_FS_POSIX_ACL */
24 # ifndef HAVE_VFS_INTENT_PATCHES
25 # include <linux/lustre_intent.h>
26 # endif /* HAVE_VFS_INTENT_PATCHES */
27 #endif /* __KERNEL__ */
28 #include <lustre_handles.h>
29 #include <libcfs/kp30.h>
30 #include <lustre/lustre_idl.h>
31 #include <lustre_lib.h>
32 #include <lustre_dlm.h>
33 #include <lustre_log.h>
34 #include <lustre_export.h>
38 struct ptlrpc_request;
42 struct semaphore rpcl_sem;
43 struct lookup_intent *rpcl_it;
46 static inline void mdc_init_rpc_lock(struct mdc_rpc_lock *lck)
48 sema_init(&lck->rpcl_sem, 1);
52 static inline void mdc_get_rpc_lock(struct mdc_rpc_lock *lck,
53 struct lookup_intent *it)
56 if (!it || (it->it_op != IT_GETATTR && it->it_op != IT_LOOKUP)) {
58 LASSERT(lck->rpcl_it == NULL);
63 static inline void mdc_put_rpc_lock(struct mdc_rpc_lock *lck,
64 struct lookup_intent *it)
66 if (!it || (it->it_op != IT_GETATTR && it->it_op != IT_LOOKUP)) {
67 LASSERT(it == lck->rpcl_it);
74 struct mdc_cache_waiter {
75 struct list_head mcw_entry;
76 wait_queue_head_t mcw_waitq;
80 int it_disposition(struct lookup_intent *it, int flag);
81 void it_clear_disposition(struct lookup_intent *it, int flag);
82 void it_set_disposition(struct lookup_intent *it, int flag);
83 int it_open_error(int phase, struct lookup_intent *it);
84 #ifdef HAVE_SPLIT_SUPPORT
85 int mdc_sendpage(struct obd_export *exp, const struct lu_fid *fid,
86 const struct page *page, int offset);