Whamcloud - gitweb
include/linux/obdfs.h: add symlink_inode_operations, prototypes
[fs/lustre-release.git] / lustre / include / linux / obdfs.h
index 51f9762..ca8ebfb 100644 (file)
 
 #ifndef _OBDFS_H
 #define OBDFS_H
-#include <../obd/linux/obd_class.h>
+#include <linux/obd_class.h>
+
+/* super.c */
+void obdfs_read_inode(struct inode *inode);
+
 
 /* file.c */
 ssize_t obdfs_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos);
@@ -19,7 +23,6 @@ ssize_t obdfs_file_write(struct file *file, const char *buf, size_t count, loff_
 
 /* rw.c */
 struct page *obdfs_getpage(struct inode *inode, unsigned long offset, int create, int locked);
-int obdfs_writepage(struct file *file, struct page *page);
 int obdfs_write_one_page(struct file *file, struct page *page, unsigned long offset, unsigned long bytes, const char * buf);
 
 /* namei.c */
@@ -38,12 +41,17 @@ int obdfs_check_dir_entry (const char * function, struct inode * dir,
                          struct ext2_dir_entry_2 * de,
                          struct page * page,
                           unsigned long offset);
+/* symlink.c */
+int obdfs_readlink (struct dentry *, char *, int);
+struct dentry *obdfs_follow_link(struct dentry *, struct dentry *, unsigned int); 
 
 struct obdfs_sb_info {
-       struct obd_conn_info osi_conn_info;
+       struct obd_conn osi_conn;
        struct super_block *osi_super;
        struct obd_device *osi_obd;
-       struct obd_ops *osi_ops;
+       struct obd_ops *osi_ops;     
+       ino_t           osi_rootino; /* which root inode */
+       int             osi_minor;   /* minor of /dev/obdX */
 };
 
 void obdfs_sysctl_init(void);
@@ -53,16 +61,36 @@ struct obdfs_inode_info;
 
 extern struct file_operations obdfs_file_ops;
 extern struct inode_operations obdfs_inode_ops;
+extern struct inode_operations obdfs_symlink_inode_operations;
 
 static inline struct obd_ops *iops(struct inode *i)
 {
-       struct obdfs_sb_info *sbi = (struct obdfs_sb_info *) i->i_sb->u.generic_sbp;
+       struct obdfs_sb_info *sbi = (struct obdfs_sb_info *) &i->i_sb->u.generic_sbp;
        return sbi->osi_ops;
 }
 
+static inline struct obd_conn *iid(struct inode *i)
+{
+       struct obdfs_sb_info *sbi = (struct obdfs_sb_info *) &i->i_sb->u.generic_sbp;
+       return &sbi->osi_conn;
+}
+
 #define NOLOCK 0
 #define LOCKED 1
 
+#ifdef OPS
+#warning "*** WARNING redefining OPS"
+#else
+#define OPS(sb,op) ((struct obdfs_sb_info *)(& ## sb ## ->u.generic_sbp))->osi_ops->o_ ## op
+#define IOPS(inode,op) ((struct obdfs_sb_info *)(& ## inode->i_sb ## ->u.generic_sbp))->osi_ops->o_ ## op
+#endif
+
+#ifdef ID
+#warning "*** WARNING redefining ID"
+#else
+#define ID(sb) (&((struct obdfs_sb_info *)( & ## sb ## ->u.generic_sbp))->osi_conn)
+#define IID(inode) (&((struct obdfs_sb_info *)( & ## inode->i_sb ## ->u.generic_sbp))->osi_conn)
+#endif
 
 #define OBDFS_SUPER_MAGIC 0x4711