2 * Copryright (C) 2001 Cluster File Systems, Inc.
8 #include <linux/config.h>
9 #include <linux/module.h>
10 #include <linux/kernel.h>
12 #include <linux/string.h>
13 #include <linux/stat.h>
14 #include <linux/errno.h>
15 #include <linux/locks.h>
16 #include <linux/unistd.h>
18 #include <asm/system.h>
19 #include <asm/uaccess.h>
20 #include <linux/module.h>
23 #include <linux/stat.h>
24 #include <asm/uaccess.h>
25 #include <linux/vmalloc.h>
26 #include <asm/segment.h>
27 #include <linux/miscdevice.h>
29 #include <linux/obd_support.h>
30 #include <linux/lustre_lib.h>
31 #include <linux/lustre_idl.h>
32 #include <linux/lustre_mds.h>
34 extern int mdc_reint(struct mds_request *request);
35 extern struct mds_request *mds_prep_req(int opcode, int namelen, char *name, int tgtlen, char *tgt);
37 int mdc_setattr(struct inode *inode, struct iattr *iattr,
38 struct mds_rep **rep, struct mds_rep_hdr **hdr)
41 struct mds_request *request;
42 struct mds_rec_setattr *rec;
44 request = mds_prep_req(MDS_REINT, 0, NULL, sizeof(*rec), NULL);
46 printk("mdc request: cannot pack\n");
50 rec = mds_req_tgt(request->rq_req);
51 mds_setattr_pack(rec, inode, iattr);
52 request->rq_req->opcode = HTON__u32(REINT_SETATTR);
54 rc = mdc_reint(request);
57 *rep = request->rq_rep;
60 *hdr = request->rq_rephdr;
67 int mdc_create(struct inode *dir, const char *name, int namelen,
68 int mode, __u64 id, __u32 uid, __u32 gid, __u64 time,
69 struct mds_rep **rep, struct mds_rep_hdr **hdr)
72 struct mds_request *request;
73 struct mds_rec_create *rec;
75 request = mds_prep_req(MDS_REINT, 0, NULL,
76 sizeof(*rec) + size_round(namelen + 1),
79 printk("mdc_create: cannot pack\n");
83 rec = mds_req_tgt(request->rq_req);
84 mds_create_pack(rec, dir, name, namelen, mode, id, uid, gid, time);
86 rc = mdc_reint(request);
89 *rep = request->rq_rep;
92 *hdr = request->rq_rephdr;