From 149390c383ca9619773c193ee28ab710936c9712 Mon Sep 17 00:00:00 2001 From: adilger Date: Fri, 29 Mar 2002 07:07:02 +0000 Subject: [PATCH] Add definitions of the MDS client filesystem methods to headers and Makefile. --- lustre/include/linux/lustre_mds.h | 55 +++++++++++++++++++++++++++++++++++++++ lustre/include/linux/obd.h | 10 ++++--- lustre/mds/Makefile.am | 2 +- 3 files changed, 63 insertions(+), 4 deletions(-) diff --git a/lustre/include/linux/lustre_mds.h b/lustre/include/linux/lustre_mds.h index ac98f7a..d3a1a5b 100644 --- a/lustre/include/linux/lustre_mds.h +++ b/lustre/include/linux/lustre_mds.h @@ -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 diff --git a/lustre/include/linux/obd.h b/lustre/include/linux/obd.h index cab3400..04c8b5b 100644 --- a/lustre/include/linux/obd.h +++ b/lustre/include/linux/obd.h @@ -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 #include #include @@ -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 { diff --git a/lustre/mds/Makefile.am b/lustre/mds/Makefile.am index 91c3c5f..9960dbf 100644 --- a/lustre/mds/Makefile.am +++ b/lustre/mds/Makefile.am @@ -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 -- 1.8.3.1