1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Copyright (C) 2001, 2002 Cluster File Systems, Inc.
6 * This file is part of Lustre, http://www.sf.net/projects/lustre/
8 * Lustre is free software; you can redistribute it and/or
9 * modify it under the terms of version 2 of the GNU General Public
10 * License as published by the Free Software Foundation.
12 * Lustre is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Lustre; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #define DEBUG_SUBSYSTEM S_MDC
26 #include <linux/module.h>
27 #include <linux/miscdevice.h>
28 #include <linux/lustre_mds.h>
29 #include <linux/lustre_lite.h>
30 #include <linux/lustre_dlm.h>
31 #include <linux/init.h>
32 #include <linux/lprocfs_status.h>
34 #define REQUEST_MINOR 244
36 extern int mds_queue_req(struct ptlrpc_request *);
37 extern struct lprocfs_vars status_var_nm_1[];
38 extern struct lprocfs_vars status_class_var[];
40 /* Helper that implements most of mdc_getstatus and signal_completed_replay. */
41 static int send_getstatus(struct obd_import *imp, struct ll_fid *rootfid,
42 int level, int msg_flags)
44 struct ptlrpc_request *req;
45 struct mds_body *body;
46 int rc, size = sizeof(*body);
49 req = ptlrpc_prep_req(imp, MDS_GETSTATUS, 1, &size, NULL);
51 GOTO(out, rc = -ENOMEM);
53 body = lustre_msg_buf(req->rq_reqmsg, 0);
54 req->rq_level = level;
55 req->rq_replen = lustre_msg_size(1, &size);
57 mds_pack_req_body(req);
58 req->rq_reqmsg->flags |= msg_flags;
59 rc = ptlrpc_queue_wait(req);
62 body = lustre_msg_buf(req->rq_repmsg, 0);
63 mds_unpack_body(body);
64 memcpy(rootfid, &body->fid1, sizeof(*rootfid));
66 CDEBUG(D_NET, "root ino="LPU64", last_committed="LPU64
67 ", last_xid="LPU64"\n",
68 rootfid->id, req->rq_repmsg->last_committed,
69 req->rq_repmsg->last_xid);
74 ptlrpc_req_finished(req);
78 /* should become mdc_getinfo() */
79 int mdc_getstatus(struct lustre_handle *conn, struct ll_fid *rootfid)
81 return send_getstatus(class_conn2cliimp(conn), rootfid, LUSTRE_CONN_CON,
85 int mdc_getlovinfo(struct obd_device *obd, struct lustre_handle *mdc_connh,
86 struct ptlrpc_request **request)
88 struct ptlrpc_request *req;
89 struct mds_status_req *streq;
90 int rc, size[2] = {sizeof(*streq)};
93 req = ptlrpc_prep_req(class_conn2cliimp(mdc_connh), MDS_GETLOVINFO, 1,
96 GOTO(out, rc = -ENOMEM);
99 streq = lustre_msg_buf(req->rq_reqmsg, 0);
100 streq->flags = HTON__u32(MDS_STATUS_LOV);
101 streq->repbuf = HTON__u32(8192);
103 /* prepare for reply */
104 req->rq_level = LUSTRE_CONN_CON;
107 req->rq_replen = lustre_msg_size(2, size);
109 rc = ptlrpc_queue_wait(req);
115 int mdc_getattr(struct lustre_handle *conn,
116 obd_id ino, int type, unsigned long valid, unsigned int ea_size,
117 struct ptlrpc_request **request)
119 struct ptlrpc_request *req;
120 struct mds_body *body;
121 int rc, size[2] = {sizeof(*body), 0}, bufcount = 1;
124 /* XXX do we need to make another request here? We just did a getattr
125 * to do the lookup in the first place.
127 req = ptlrpc_prep_req(class_conn2cliimp(conn), MDS_GETATTR, 1, size,
130 GOTO(out, rc = -ENOMEM);
132 body = lustre_msg_buf(req->rq_reqmsg, 0);
133 ll_ino2fid(&body->fid1, ino, 0, type);
137 size[bufcount] = ea_size;
139 body->size = ea_size;
140 CDEBUG(D_INODE, "reserved %u bytes for MD/symlink in packet\n",
143 req->rq_replen = lustre_msg_size(bufcount, size);
144 mds_pack_req_body(req);
146 rc = ptlrpc_queue_wait(req);
149 body = lustre_msg_buf(req->rq_repmsg, 0);
150 mds_unpack_body(body);
151 CDEBUG(D_NET, "mode: %o\n", body->mode);
160 int mdc_getattr_name(struct lustre_handle *conn, struct inode *parent,
161 char *filename, int namelen, unsigned long valid,
162 unsigned int ea_size, struct ptlrpc_request **request)
164 struct ptlrpc_request *req;
165 struct mds_body *body;
166 int rc, size[2] = {sizeof(*body), namelen}, bufcount = 1;
169 req = ptlrpc_prep_req(class_conn2cliimp(conn), MDS_GETATTR_NAME, 2,
172 GOTO(out, rc = -ENOMEM);
174 body = lustre_msg_buf(req->rq_reqmsg, 0);
175 ll_inode2fid(&body->fid1, parent);
177 memcpy(lustre_msg_buf(req->rq_reqmsg, 1), filename, namelen);
182 body->size = ea_size;
183 CDEBUG(D_INODE, "reserved %u bytes for MD/symlink in packet\n",
185 valid |= OBD_MD_FLEASIZE;
188 req->rq_replen = lustre_msg_size(bufcount, size);
189 mds_pack_req_body(req);
191 rc = ptlrpc_queue_wait(req);
194 body = lustre_msg_buf(req->rq_repmsg, 0);
195 mds_unpack_body(body);
204 void d_delete_aliases(struct inode *inode)
206 struct dentry *dentry = NULL;
207 struct list_head *tmp;
208 struct ll_sb_info *sbi = ll_i2sbi(inode);
211 spin_lock(&dcache_lock);
212 list_for_each(tmp, &inode->i_dentry) {
213 dentry = list_entry(tmp, struct dentry, d_alias);
215 list_del_init(&dentry->d_hash);
216 list_add(&dentry->d_hash, &sbi->ll_orphan_dentry_list);
219 spin_unlock(&dcache_lock);
223 static int mdc_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
224 void *data, __u32 data_len, int flag)
227 struct lustre_handle lockh;
231 case LDLM_CB_BLOCKING:
232 ldlm_lock2handle(lock, &lockh);
233 rc = ldlm_cli_cancel(&lockh);
235 CDEBUG(D_INODE, "ldlm_cli_cancel: %d\n", rc);
239 case LDLM_CB_CANCELING: {
240 /* Invalidate all dentries associated with this inode */
243 LASSERT(data != NULL);
244 LASSERT(data_len == sizeof(*inode));
246 /* XXX what tells us that 'data' is a valid inode at all?
247 * we should probably validate the lock handle first?
251 if (inode == NULL) /* inode->i_state & I_FREEING */
254 if (S_ISDIR(inode->i_mode)) {
255 CDEBUG(D_INODE, "invalidating inode %lu\n",
258 ll_invalidate_inode_pages(inode);
261 if (inode != inode->i_sb->s_root->d_inode)
262 d_delete_aliases(inode);
274 /* This should be called with both the request and the reply still packed. */
275 void mdc_store_inode_generation(struct ptlrpc_request *req, int reqoff,
278 struct mds_rec_create *rec = lustre_msg_buf(req->rq_reqmsg, reqoff);
279 struct mds_body *body = lustre_msg_buf(req->rq_repmsg, repoff);
281 memcpy(&rec->cr_replayfid, &body->fid1, sizeof rec->cr_replayfid);
282 DEBUG_REQ(D_HA, req, "storing generation %x for ino "LPD64,
283 rec->cr_replayfid.generation, rec->cr_replayfid.id);
286 /* We always reserve enough space in the reply packet for a stripe MD, because
287 * we don't know in advance the file type.
289 * XXX we could get that from ext2_dir_entry_2 file_type
291 int mdc_enqueue(struct lustre_handle *conn, int lock_type,
292 struct lookup_intent *it, int lock_mode, struct inode *dir,
293 struct dentry *de, struct lustre_handle *lockh,
294 char *tgt, int tgtlen, void *data, int datalen)
296 struct ptlrpc_request *req;
297 struct obd_device *obddev = class_conn2obd(conn);
298 __u64 res_id[RES_NAME_SIZE] = {dir->i_ino, (__u64)dir->i_generation};
299 int size[6] = {sizeof(struct ldlm_request), sizeof(struct ldlm_intent)};
300 int rc, flags = LDLM_FL_HAS_INTENT;
301 int repsize[3] = {sizeof(struct ldlm_reply),
302 sizeof(struct mds_body),
303 obddev->u.cli.cl_max_mds_easize};
304 struct ldlm_reply *dlm_rep;
305 struct ldlm_intent *lit;
306 struct ldlm_request *lockreq;
309 LDLM_DEBUG_NOLOCK("mdsintent %s parent dir %lu",
310 ldlm_it2str(it->it_op), dir->i_ino);
312 if (it->it_op & (IT_MKDIR | IT_CREAT | IT_SYMLINK | IT_MKNOD)) {
315 it->it_mode |= S_IFDIR;
317 case (IT_CREAT|IT_OPEN):
319 it->it_mode |= S_IFREG;
322 it->it_mode |= S_IFLNK;
325 it->it_mode &= ~current->fs->umask;
327 size[2] = sizeof(struct mds_rec_create);
328 size[3] = de->d_name.len + 1;
329 size[4] = tgtlen + 1;
330 req = ptlrpc_prep_req(class_conn2cliimp(conn), LDLM_ENQUEUE, 5,
335 /* pack the intent */
336 lit = lustre_msg_buf(req->rq_reqmsg, 1);
337 lit->opc = NTOH__u64((__u64)it->it_op);
339 /* pack the intended request */
340 mds_create_pack(req, 2, dir, it->it_mode, 0, current->fsuid,
341 current->fsgid, CURRENT_TIME, de->d_name.name,
342 de->d_name.len, tgt, tgtlen);
343 req->rq_replen = lustre_msg_size(3, repsize);
344 } else if (it->it_op == IT_RENAME2) {
345 struct dentry *old_de = it->it_data;
347 size[2] = sizeof(struct mds_rec_rename);
348 size[3] = old_de->d_name.len + 1;
349 size[4] = de->d_name.len + 1;
350 req = ptlrpc_prep_req(class_conn2cliimp(conn), LDLM_ENQUEUE, 5,
355 /* pack the intent */
356 lit = lustre_msg_buf(req->rq_reqmsg, 1);
357 lit->opc = NTOH__u64((__u64)it->it_op);
359 /* pack the intended request */
360 mds_rename_pack(req, 2, old_de->d_parent->d_inode, dir,
361 old_de->d_name.name, old_de->d_name.len,
362 de->d_name.name, de->d_name.len);
363 req->rq_replen = lustre_msg_size(3, repsize);
364 } else if (it->it_op == IT_LINK2) {
365 struct dentry *old_de = it->it_data;
367 size[2] = sizeof(struct mds_rec_link);
368 size[3] = de->d_name.len + 1;
369 req = ptlrpc_prep_req(class_conn2cliimp(conn), LDLM_ENQUEUE, 4,
374 /* pack the intent */
375 lit = lustre_msg_buf(req->rq_reqmsg, 1);
376 lit->opc = NTOH__u64((__u64)it->it_op);
378 /* pack the intended request */
379 mds_link_pack(req, 2, old_de->d_inode, dir,
380 de->d_name.name, de->d_name.len);
381 req->rq_replen = lustre_msg_size(3, repsize);
382 } else if (it->it_op == IT_UNLINK || it->it_op == IT_RMDIR) {
383 size[2] = sizeof(struct mds_rec_unlink);
384 size[3] = de->d_name.len + 1;
385 req = ptlrpc_prep_req(class_conn2cliimp(conn), LDLM_ENQUEUE, 4,
390 /* pack the intent */
391 lit = lustre_msg_buf(req->rq_reqmsg, 1);
392 lit->opc = NTOH__u64((__u64)it->it_op);
394 /* pack the intended request */
395 mds_unlink_pack(req, 2, dir, NULL,
396 it->it_op == IT_UNLINK ? S_IFREG : S_IFDIR,
397 de->d_name.name, de->d_name.len);
399 req->rq_replen = lustre_msg_size(3, repsize);
400 } else if (it->it_op & (IT_GETATTR | IT_RENAME | IT_LINK |
401 IT_OPEN | IT_SETATTR | IT_LOOKUP | IT_READLINK)) {
402 size[2] = sizeof(struct mds_body);
403 size[3] = de->d_name.len + 1;
405 req = ptlrpc_prep_req(class_conn2cliimp(conn), LDLM_ENQUEUE, 4,
410 /* pack the intent */
411 lit = lustre_msg_buf(req->rq_reqmsg, 1);
412 lit->opc = NTOH__u64((__u64)it->it_op);
414 /* pack the intended request */
415 mds_getattr_pack(req, 2, dir, de->d_name.name, de->d_name.len);
417 /* get ready for the reply */
418 req->rq_replen = lustre_msg_size(3, repsize);
419 } else if (it->it_op == IT_READDIR) {
420 req = ptlrpc_prep_req(class_conn2cliimp(conn), LDLM_ENQUEUE, 1,
425 /* get ready for the reply */
426 req->rq_replen = lustre_msg_size(1, repsize);
432 rc = ldlm_cli_enqueue(conn, req, obddev->obd_namespace, NULL, res_id,
433 lock_type, NULL, 0, lock_mode, &flags,
434 ldlm_completion_ast, mdc_blocking_ast, data,
437 if (it->it_op != IT_READDIR) {
438 /* XXX This should become a lustre_msg flag, but for now... */
439 __u32 *opp = lustre_msg_buf(req->rq_reqmsg, 2);
440 *opp |= REINT_REPLAYING;
444 /* This can go when we're sure that this can never happen */
447 if (rc == ELDLM_LOCK_ABORTED) {
449 memset(lockh, 0, sizeof(*lockh));
451 } else if (rc != 0) {
452 CERROR("ldlm_cli_enqueue: %d\n", rc);
455 /* The server almost certainly gave us a lock other than the one
456 * that we asked for. If we already have a matching lock, then
457 * cancel this one--we don't need two. */
458 struct ldlm_lock *lock = ldlm_handle2lock(lockh);
459 struct lustre_handle lockh2;
462 LDLM_DEBUG(lock, "matching against this");
464 memcpy(&lockh2, lockh, sizeof(lockh2));
465 if (ldlm_lock_match(NULL, NULL, LDLM_PLAIN, NULL, 0, LCK_NL,
467 /* We already have a lock; cancel the old one */
468 ldlm_lock_decref(lockh, lock_mode);
470 //ldlm_cli_cancel(lockh);
471 memcpy(lockh, &lockh2, sizeof(lockh2));
476 /* On replay, we don't want the lock granted. */
477 lockreq = lustre_msg_buf(req->rq_reqmsg, 0);
478 lockreq->lock_flags |= LDLM_FL_INTENT_ONLY;
480 dlm_rep = lustre_msg_buf(req->rq_repmsg, 0);
481 it->it_disposition = (int) dlm_rep->lock_policy_res1;
482 it->it_status = (int) dlm_rep->lock_policy_res2;
483 it->it_lock_mode = lock_mode;
489 int mdc_cancel_unused(struct lustre_handle *conn, struct inode *inode,
492 __u64 res_id[RES_NAME_SIZE] = {inode->i_ino, inode->i_generation};
493 struct obd_device *obddev = class_conn2obd(conn);
495 RETURN(ldlm_cli_cancel_unused(obddev->obd_namespace, res_id, flags));
498 struct replay_open_data {
499 struct lustre_handle *fh;
502 static void mdc_replay_open(struct ptlrpc_request *req)
505 struct replay_open_data *saved;
506 struct mds_body *body = lustre_msg_buf(req->rq_repmsg, 0);
508 if (lustre_msg_get_op_flags(req->rq_reqmsg) & MDS_OPEN_HAS_EA)
513 saved = lustre_msg_buf(req->rq_reqmsg, offset);
514 mds_unpack_body(body);
515 CDEBUG(D_HA, "updating from "LPD64"/"LPD64" to "LPD64"/"LPD64"\n",
516 saved->fh->addr, saved->fh->cookie,
517 body->handle.addr, body->handle.cookie);
518 memcpy(saved->fh, &body->handle, sizeof(body->handle));
521 /* If lmm is non-NULL and lmm_size is non-zero, the stripe MD is stored on
522 * the MDS. Otherwise, we have already read a copy from the MDS (probably
523 * during mdc_enqueue() and we do not need to send it to the MDS again.
525 * In the future (when we support the non-intent case) we need to be able
526 * to read the stripe MD from the MDS here (need to fix mds_open() too).
528 int mdc_open(struct lustre_handle *conn, obd_id ino, int type, int flags,
529 struct lov_mds_md *lmm, int lmm_size, struct lustre_handle *fh,
530 struct ptlrpc_request **request)
532 struct mds_body *body;
533 struct replay_open_data *replay_data;
534 int rc, size[3] = {sizeof(*body), sizeof(*replay_data)}, bufcount = 2;
535 struct ptlrpc_request *req;
540 size[2] = size[1]; /* shuffle the replay data along */
544 req = ptlrpc_prep_req(class_conn2cliimp(conn), MDS_OPEN, bufcount, size,
547 GOTO(out, rc = -ENOMEM);
549 req->rq_flags |= PTL_RPC_FL_REPLAY;
550 body = lustre_msg_buf(req->rq_reqmsg, 0);
552 ll_ino2fid(&body->fid1, ino, 0, type);
553 body->flags = HTON__u32(flags);
554 memcpy(&body->handle, fh, sizeof(body->handle));
557 body->flags |= HTON__u32(OBD_MD_FLEASIZE);
559 CDEBUG(D_INODE, "sending %u bytes MD for ino "LPU64"\n",
561 lustre_msg_set_op_flags(req->rq_reqmsg,MDS_OPEN_HAS_EA);
562 memcpy(lustre_msg_buf(req->rq_reqmsg,1), lmm, lmm_size);
566 req->rq_replen = lustre_msg_size(1, size);
568 rc = ptlrpc_queue_wait(req);
570 body = lustre_msg_buf(req->rq_repmsg, 0);
571 mds_unpack_body(body);
572 memcpy(fh, &body->handle, sizeof(*fh));
574 /* If open is replayed, we need to fix up the fh. */
575 req->rq_replay_cb = mdc_replay_open;
576 replay_data = lustre_msg_buf(req->rq_reqmsg, lmm ? 2 : 1);
577 replay_data->fh = fh;
586 int mdc_close(struct lustre_handle *conn, obd_id ino, int type,
587 struct lustre_handle *fh, struct ptlrpc_request **request)
589 struct mds_body *body;
590 int rc, size = sizeof(*body);
591 struct ptlrpc_request *req;
594 req = ptlrpc_prep_req(class_conn2cliimp(conn), MDS_CLOSE, 1, &size,
597 GOTO(out, rc = -ENOMEM);
599 body = lustre_msg_buf(req->rq_reqmsg, 0);
600 ll_ino2fid(&body->fid1, ino, 0, type);
601 memcpy(&body->handle, fh, sizeof(body->handle));
603 req->rq_replen = lustre_msg_size(0, NULL);
605 rc = ptlrpc_queue_wait(req);
613 int mdc_readpage(struct lustre_handle *conn, obd_id ino, int type, __u64 offset,
614 char *addr, struct ptlrpc_request **request)
616 struct ptlrpc_connection *connection =
617 client_conn2cli(conn)->cl_import.imp_connection;
618 struct ptlrpc_request *req = NULL;
619 struct ptlrpc_bulk_desc *desc = NULL;
620 struct ptlrpc_bulk_page *bulk = NULL;
621 struct mds_body *body;
622 int rc, size = sizeof(*body);
625 CDEBUG(D_INODE, "inode: %ld\n", (long)ino);
627 desc = ptlrpc_prep_bulk(connection);
629 GOTO(out, rc = -ENOMEM);
631 req = ptlrpc_prep_req(class_conn2cliimp(conn), MDS_READPAGE, 1, &size,
634 GOTO(out2, rc = -ENOMEM);
636 bulk = ptlrpc_prep_bulk_page(desc);
637 bulk->bp_buflen = PAGE_SIZE;
639 bulk->bp_xid = req->rq_xid;
640 desc->bd_ptl_ev_hdlr = NULL;
641 desc->bd_portal = MDS_BULK_PORTAL;
643 rc = ptlrpc_register_bulk(desc);
645 CERROR("couldn't setup bulk sink: error %d.\n", rc);
649 mds_readdir_pack(req, offset, ino, type);
651 req->rq_replen = lustre_msg_size(1, &size);
652 rc = ptlrpc_queue_wait(req);
654 ptlrpc_abort_bulk(desc);
657 body = lustre_msg_buf(req->rq_repmsg, 0);
658 mds_unpack_body(body);
663 ptlrpc_bulk_decref(desc);
669 static int mdc_statfs(struct lustre_handle *conn, struct obd_statfs *osfs)
671 struct ptlrpc_request *req;
672 int rc, size = sizeof(*osfs);
675 req = ptlrpc_prep_req(class_conn2cliimp(conn), MDS_STATFS, 0, NULL,
680 req->rq_replen = lustre_msg_size(1, &size);
682 rc = ptlrpc_queue_wait(req);
687 obd_statfs_unpack(osfs, lustre_msg_buf(req->rq_repmsg, 0));
691 ptlrpc_req_finished(req);
696 static int mdc_attach(struct obd_device *dev, obd_count len, void *data)
698 return lprocfs_reg_obd(dev, status_var_nm_1, dev);
701 static int mdc_detach(struct obd_device *dev)
703 return lprocfs_dereg_obd(dev);
706 /* Send a mostly-dummy GETSTATUS request and indicate that we're done replay. */
707 static int signal_completed_replay(struct obd_import *imp)
711 return send_getstatus(imp, &fid, LUSTRE_CONN_RECOVD, MSG_LAST_REPLAY);
714 static int mdc_recover(struct obd_import *imp, int phase)
718 struct ptlrpc_request *req;
722 case PTLRPC_RECOVD_PHASE_PREPARE:
723 ldlm_cli_cancel_unused(imp->imp_obd->obd_namespace,
724 NULL, LDLM_FL_LOCAL_ONLY);
726 case PTLRPC_RECOVD_PHASE_RECOVER:
728 rc = ptlrpc_reconnect_import(imp, MDS_CONNECT, &req);
730 /* We were still connected, just go about our business. */
732 GOTO(skip_replay, rc);
735 ptlrpc_req_finished(req);
739 /* We can't replay, which might be a problem. */
740 if (!(lustre_msg_get_flags(req->rq_repmsg) &
741 MSG_REPLAY_IN_PROGRESS)) {
742 if (phase != PTLRPC_RECOVD_PHASE_NOTCONN) {
743 CERROR("can't replay, invalidating\n");
744 ldlm_namespace_cleanup(imp->imp_obd->obd_namespace,
746 ptlrpc_abort_inflight(imp);
751 rc = ptlrpc_replay(imp);
755 rc = ldlm_replay_locks(imp);
759 rc = signal_completed_replay(imp);
764 ptlrpc_req_finished(req);
765 spin_lock_irqsave(&imp->imp_lock, flags);
766 imp->imp_level = LUSTRE_CONN_FULL;
767 imp->imp_flags &= ~IMP_INVALID;
768 spin_unlock_irqrestore(&imp->imp_lock, flags);
770 ptlrpc_wake_delayed(imp);
772 rc = ptlrpc_resend(imp);
778 case PTLRPC_RECOVD_PHASE_NOTCONN:
779 ldlm_namespace_cleanup(imp->imp_obd->obd_namespace, 1);
780 ptlrpc_abort_inflight(imp);
788 static int mdc_connect(struct lustre_handle *conn, struct obd_device *obd,
789 obd_uuid_t cluuid, struct recovd_obd *recovd,
790 ptlrpc_recovery_cb_t recover)
792 struct obd_import *imp = &obd->u.cli.cl_import;
793 imp->imp_recover = mdc_recover;
794 return client_obd_connect(conn, obd, cluuid, recovd, recover);
797 struct obd_ops mdc_obd_ops = {
798 o_owner: THIS_MODULE,
799 o_attach: mdc_attach,
800 o_detach: mdc_detach,
801 o_setup: client_obd_setup,
802 o_cleanup: client_obd_cleanup,
803 o_connect: mdc_connect,
804 o_disconnect: client_obd_disconnect,
808 static int __init ptlrpc_request_init(void)
810 return class_register_type(&mdc_obd_ops, status_class_var,
814 static void __exit ptlrpc_request_exit(void)
816 class_unregister_type(LUSTRE_MDC_NAME);
819 MODULE_AUTHOR("Cluster File Systems <info@clusterfs.com>");
820 MODULE_DESCRIPTION("Lustre Metadata Client v1.0");
821 MODULE_LICENSE("GPL");
823 EXPORT_SYMBOL(d_delete_aliases);
824 EXPORT_SYMBOL(mdc_getstatus);
825 EXPORT_SYMBOL(mdc_getlovinfo);
826 EXPORT_SYMBOL(mdc_enqueue);
827 EXPORT_SYMBOL(mdc_cancel_unused);
828 EXPORT_SYMBOL(mdc_getattr);
829 EXPORT_SYMBOL(mdc_getattr_name);
830 EXPORT_SYMBOL(mdc_create);
831 EXPORT_SYMBOL(mdc_unlink);
832 EXPORT_SYMBOL(mdc_rename);
833 EXPORT_SYMBOL(mdc_link);
834 EXPORT_SYMBOL(mdc_readpage);
835 EXPORT_SYMBOL(mdc_setattr);
836 EXPORT_SYMBOL(mdc_close);
837 EXPORT_SYMBOL(mdc_open);
839 EXPORT_SYMBOL(mdc_store_inode_generation);
841 module_init(ptlrpc_request_init);
842 module_exit(ptlrpc_request_exit);