From 72f8c202ca7ae1ef50fa124058310e683ef3f3e7 Mon Sep 17 00:00:00 2001 From: phil Date: Fri, 14 Nov 2003 09:24:31 +0000 Subject: [PATCH] I touched one thing in lustre_mds.h, and I was dismayed to see the entire source tree rebuild! It took just a few minutes to remove a number of #includes which violated all manner of abstraction boundary. ericm assures me that I have not broken anything major in liblustre. Also, I moved a good chunk of inline functions into llite_internal.h (which is where I secretly believe that most of lustre_lite.h will end up), and renamed ll_ino2fid (which no longer takes an inode) to mdc_pack_fid. --- lustre/ldlm/ldlm_lib.c | 4 +- lustre/llite/llite_internal.h | 104 +++++++++++++++++++++++++++++++++++++++++- lustre/lov/lov_internal.h | 7 +++ lustre/lov/lov_log.c | 1 - lustre/mdc/mdc_lib.c | 1 - lustre/mds/mds_internal.h | 2 + 6 files changed, 113 insertions(+), 6 deletions(-) diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 7c6aadf..fbc4555 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -30,10 +30,10 @@ # include #endif #include -#include +#include /* for LUSTRE_OSC_NAME */ +#include /* for LUSTRE_MDC_NAME */ #include #include -#include #include int client_obd_setup(struct obd_device *obddev, obd_count len, void *buf) diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index 3a2b1e6..49ef45a 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -10,8 +10,35 @@ #ifndef LLITE_INTERNAL_H #define LLITE_INTERNAL_H +struct ll_sb_info { + struct obd_uuid ll_sb_uuid; +// struct lustre_handle ll_mdc_conn; + struct obd_export *ll_mdc_exp; + struct obd_export *ll_osc_exp; + struct proc_dir_entry* ll_proc_root; + obd_id ll_rootino; /* number of root inode */ + + struct obd_uuid ll_mds_uuid; + struct obd_uuid ll_mds_peer_uuid; + struct lustre_mount_data *ll_lmd; + char *ll_instance; + + int ll_flags; + wait_queue_head_t ll_commitcbd_waitq; + wait_queue_head_t ll_commitcbd_ctl_waitq; + int ll_commitcbd_flags; + struct task_struct *ll_commitcbd_thread; + time_t ll_commitcbd_waketime; + time_t ll_commitcbd_timeout; + spinlock_t ll_commitcbd_lock; + struct list_head ll_conn_chain; /* per-conn chain of SBs */ + + struct hlist_head ll_orphan_dentry_list; /*please don't ask -p*/ + struct ll_close_queue *ll_lcq; + + struct lprocfs_stats *ll_stats; /* lprocfs stats counter */ +}; -struct ll_sb_info; struct lustre_handle; struct lov_stripe_md; @@ -36,7 +63,6 @@ static inline struct inode *ll_info2i(struct ll_inode_info *lli) static inline void ll_i2uctxt(struct ll_uctxt *ctxt, struct inode *i1, struct inode *i2) { - LASSERT(i1); LASSERT(ctxt); @@ -183,4 +209,78 @@ int ll_dentry_to_fh(struct dentry *, __u32 *datap, int *lenp, int need_parent); /* llite/symlink.c */ extern struct inode_operations ll_fast_symlink_inode_operations; +/* generic */ +#define LL_SUPER_MAGIC 0x0BD00BD0 + +#define LL_SBI_NOLCK 0x1 +#define LL_SBI_READAHEAD 0x2 + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)) +#define ll_s2sbi(sb) ((struct ll_sb_info *)((sb)->s_fs_info)) +void __d_rehash(struct dentry * entry, int lock); +static inline __u64 ll_ts2u64(struct timespec *time) +{ + __u64 t = time->tv_sec; + return t; +} +#else /* 2.4 here */ +#define ll_s2sbi(sb) ((struct ll_sb_info *)((sb)->u.generic_sbp)) +static inline __u64 ll_ts2u64(time_t *time) +{ + return *time; +} +#endif + +/* don't need an addref as the sb_info should be holding one */ +static inline struct obd_export *ll_s2obdexp(struct super_block *sb) +{ + return ll_s2sbi(sb)->ll_osc_exp; +} + +/* don't need an addref as the sb_info should be holding one */ +static inline struct obd_export *ll_s2mdcexp(struct super_block *sb) +{ + return ll_s2sbi(sb)->ll_mdc_exp; +} + +static inline struct client_obd *sbi2mdc(struct ll_sb_info *sbi) +{ + struct obd_device *obd = sbi->ll_mdc_exp->exp_obd; + if (obd == NULL) + LBUG(); + return &obd->u.cli; +} + +// FIXME: replace the name of this with LL_SB to conform to kernel stuff +static inline struct ll_sb_info *ll_i2sbi(struct inode *inode) +{ + return ll_s2sbi(inode->i_sb); +} + +static inline struct obd_export *ll_i2obdexp(struct inode *inode) +{ + return ll_s2obdexp(inode->i_sb); +} + +static inline struct obd_export *ll_i2mdcexp(struct inode *inode) +{ + return ll_s2mdcexp(inode->i_sb); +} + +static inline void ll_inode2fid(struct ll_fid *fid, struct inode *inode) +{ + mdc_pack_fid(fid, inode->i_ino, inode->i_generation, + inode->i_mode & S_IFMT); +} + +static inline int ll_mds_max_easize(struct super_block *sb) +{ + return sbi2mdc(ll_s2sbi(sb))->cl_max_mds_easize; +} + +static inline __u64 ll_file_maxbytes(struct inode *inode) +{ + return ll_i2info(inode)->lli_maxbytes; +} + #endif /* LLITE_INTERNAL_H */ diff --git a/lustre/lov/lov_internal.h b/lustre/lov/lov_internal.h index 672a546..6c26a16 100644 --- a/lustre/lov/lov_internal.h +++ b/lustre/lov/lov_internal.h @@ -7,6 +7,11 @@ * See the file COPYING in this distribution */ +#ifndef LOV_INTERNAL_H +#define LOV_INTERNAL_H + +#include + #define LAP_MAGIC 8200 struct lov_async_page { @@ -41,3 +46,5 @@ int lov_getstripe(struct obd_export *exp, /* lproc_lov.c */ extern struct file_operations lov_proc_target_fops; + +#endif diff --git a/lustre/lov/lov_log.c b/lustre/lov/lov_log.c index 6ef7497..b8f0e67 100644 --- a/lustre/lov/lov_log.c +++ b/lustre/lov/lov_log.c @@ -41,7 +41,6 @@ #include #include #include -#include /* for LL_IOC_LOV_[GS]ETSTRIPE */ #include #include #include diff --git a/lustre/mdc/mdc_lib.c b/lustre/mdc/mdc_lib.c index d573eea7..3713e2c 100644 --- a/lustre/mdc/mdc_lib.c +++ b/lustre/mdc/mdc_lib.c @@ -26,7 +26,6 @@ #include #include #include -#include #include "mdc_internal.h" void mdc_readdir_pack(struct ptlrpc_request *req, __u64 offset, __u32 size, diff --git a/lustre/mds/mds_internal.h b/lustre/mds/mds_internal.h index bb2f1e2..96d7653 100644 --- a/lustre/mds/mds_internal.h +++ b/lustre/mds/mds_internal.h @@ -5,6 +5,8 @@ #ifndef _MDS_INTERNAL_H #define _MDS_INTERNAL_H +#include + struct mds_filter_data { __u64 io_epoch; }; -- 1.8.3.1