Whamcloud - gitweb
- preparation before converting client to new fids
[fs/lustre-release.git] / lustre / include / linux / lustre_mds.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  *   This file is part of Lustre, http://www.lustre.org
5  *
6  * MDS data structures.
7  * See also lustre_idl.h for wire formats of requests.
8  */
9
10 #ifndef _LUSTRE_MDS_H
11 #define _LUSTRE_MDS_H
12
13 #ifdef __KERNEL__
14 # include <linux/fs.h>
15 # include <linux/dcache.h>
16 #endif
17 #include <linux/lustre_handles.h>
18 #include <libcfs/kp30.h>
19 #include <linux/lustre_idl.h>
20 #include <linux/lustre_lib.h>
21 #include <linux/lustre_dlm.h>
22 #include <linux/lustre_log.h>
23 #include <linux/lustre_export.h>
24
25 struct mds_obd;
26 struct ptlrpc_request;
27 struct obd_device;
28
29 struct mds_update_record {
30         __u32 ur_opcode;
31         struct ll_fid *ur_fid1;
32         struct ll_fid *ur_fid2;
33         int ur_namelen;
34         char *ur_name;
35         int ur_tgtlen;
36         char *ur_tgt;
37         int ur_eadatalen;
38         void *ur_eadata;
39         int ur_cookielen;
40         struct llog_cookie *ur_logcookies;
41         struct iattr ur_iattr;
42         struct lvfs_ucred ur_uc;
43         __u64 ur_rdev;
44         __u64 ur_time;
45         __u32 ur_mode;
46         __u32 ur_flags;
47         struct lvfs_grp_hash_entry *ur_grp_entry;
48 };
49
50 /* file data for open files on MDS */
51 struct mds_file_data {
52         struct portals_handle mfd_handle; /* must be first */
53         atomic_t              mfd_refcount;
54         struct list_head      mfd_list; /* protected by med_open_lock */
55         __u64                 mfd_xid;
56         int                   mfd_mode;
57         struct dentry        *mfd_dentry;
58 };
59
60 /* mds/mds_reint.c */
61 int mds_reint_rec(struct mds_update_record *r, int offset,
62                   struct ptlrpc_request *req, struct lustre_handle *);
63
64 /* mds/handler.c */
65 #ifdef __KERNEL__
66 struct dentry *mds_fid2locked_dentry(struct obd_device *obd, struct ll_fid *fid,
67                                      struct vfsmount **mnt, int lock_mode,
68                                      struct lustre_handle *lockh,
69                                      __u64 lockpart);
70 struct dentry *mds_fid2dentry(struct mds_obd *mds, struct ll_fid *fid,
71                               struct vfsmount **mnt);
72 int mds_update_server_data(struct obd_device *, int force_sync);
73
74 /* mds/mds_fs.c */
75 int mds_fs_setup(struct obd_device *obddev, struct vfsmount *mnt);
76 int mds_fs_cleanup(struct obd_device *obddev);
77 #endif
78
79 /* ioctls for trying requests */
80 #define IOC_REQUEST_TYPE                   'f'
81 #define IOC_REQUEST_MIN_NR                 30
82
83 #define IOC_REQUEST_GETATTR             _IOWR('f', 30, long)
84 #define IOC_REQUEST_READPAGE            _IOWR('f', 31, long)
85 #define IOC_REQUEST_SETATTR             _IOWR('f', 32, long)
86 #define IOC_REQUEST_CREATE              _IOWR('f', 33, long)
87 #define IOC_REQUEST_OPEN                _IOWR('f', 34, long)
88 #define IOC_REQUEST_CLOSE               _IOWR('f', 35, long)
89 #define IOC_REQUEST_MAX_NR               35
90
91 #endif