Whamcloud - gitweb
Add definitions of the MDS client filesystem methods to headers and Makefile.
authoradilger <adilger>
Fri, 29 Mar 2002 07:07:02 +0000 (07:07 +0000)
committeradilger <adilger>
Fri, 29 Mar 2002 07:07:02 +0000 (07:07 +0000)
lustre/include/linux/lustre_mds.h
lustre/include/linux/obd.h
lustre/mds/Makefile.am

index ac98f7a..d3a1a5b 100644 (file)
@@ -106,6 +106,61 @@ int mdc_rename(struct ptlrpc_client *peer, struct inode *src,
                struct ptlrpc_request **);
 int mdc_create_client(char *uuid, struct ptlrpc_client *cl);
 
+struct mds_fs_operations {
+        void   *(* fs_start)(struct inode *inode, int op);
+        int     (* fs_commit)(struct inode *inode, void *handle);
+        int     (* fs_setattr)(struct inode *inode, void *handle,
+                               struct iattr *iattr);
+        int     (* fs_set_objid)(struct inode *inode, void *handle, obd_id id);
+        void    (* fs_get_objid)(struct inode *inode, obd_id *id);
+        ssize_t (* fs_readpage)(struct file *file, char *buf, size_t count,
+                                loff_t *offset);
+        void    (* fs_delete_inode)(struct inode *inode);
+        void    (* cl_delete_inode)(struct inode *inode);
+};
+
+#define MDS_FSOP_UNLINK           1
+#define MDS_FSOP_RMDIR            2
+
+static inline void *mds_fs_start(struct mds_obd *mds, struct inode *inode,
+                                 int op)
+{
+        return mds->mds_fsops->fs_start(inode, op);
+}
+
+static inline int mds_fs_commit(struct mds_obd *mds, struct inode *inode,
+                                void *handle)
+{
+        return mds->mds_fsops->fs_commit(inode, handle);
+}
+
+static inline int mds_fs_setattr(struct mds_obd *mds, struct inode *inode,
+                                 void *handle, struct iattr *iattr)
+{
+        return mds->mds_fsops->fs_setattr(inode, handle, iattr);
+}
+
+static inline int mds_fs_set_objid(struct mds_obd *mds, struct inode *inode,
+                                   void *handle,  __u64 id)
+{
+        return mds->mds_fsops->fs_set_objid(inode, handle, id);
+}
+
+static inline void mds_fs_get_objid(struct mds_obd *mds, struct inode *inode,
+                                    __u64 *id)
+{
+        mds->mds_fsops->fs_get_objid(inode, id);
+}
+
+static inline ssize_t mds_fs_readpage(struct mds_obd *mds, struct file *file,
+                                      char *buf, size_t count, loff_t *offset)
+{
+        return mds->mds_fsops->fs_readpage(file, buf, count, offset);
+}
+
+extern struct mds_fs_operations mds_ext2_fs_ops;
+extern struct mds_fs_operations mds_ext3_fs_ops;
+
 /* ioctls for trying requests */
 #define IOC_REQUEST_TYPE                   'f'
 #define IOC_REQUEST_MIN_NR                 30
index cab3400..04c8b5b 100644 (file)
@@ -1,12 +1,15 @@
-#ifndef __OBD_H
-#define __OBD_H
-/*
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
+ *
+ *
  * Copyright (C) 2001  Cluster File Systems, Inc.
  *
  * This code is issued under the GNU General Public License.
  * See the file COPYING in this distribution
  */
 
+#ifndef __OBD_H
+#define __OBD_H
 #include <linux/fs.h>
 #include <linux/list.h>
 #include <linux/smp_lock.h>
@@ -72,6 +75,7 @@ struct mds_obd {
        struct file_operations *mds_fop; 
        struct inode_operations *mds_iop;
        struct address_space_operations *mds_aops;
+        struct mds_fs_operations *mds_fsops;
 };
 
 struct ldlm_obd {
index 91c3c5f..9960dbf 100644 (file)
@@ -15,7 +15,7 @@ mds_pack.c:
 mds_updates.c: 
        ln -s ../lib/mds_updates.c .
 
-mds_SOURCES = handler.c mds_reint.c $(LINX)
+mds_SOURCES = handler.c mds_reint.c mds_ext2.c mds_ext3.c $(LINX)
 
 dist-hook:
        list='$(LINX)'; for f in $$list; do rm -f $(distdir)/$$f; done