Whamcloud - gitweb
- added fid_lock()/fid_unlock()
authoryury <yury>
Tue, 4 Apr 2006 13:24:23 +0000 (13:24 +0000)
committeryury <yury>
Tue, 4 Apr 2006 13:24:23 +0000 (13:24 +0000)
- many changes about using fid. Idea is that we do not want to change whole mds stuff to use new fids but we want to use new fids for new modules.

42 files changed:
lustre/include/linux/lustre_idl.h
lustre/include/linux/lustre_mds.h
lustre/include/linux/lvfs.h
lustre/include/linux/lvfs_linux.h
lustre/include/linux/obd.h
lustre/liblustre/dir.c
lustre/liblustre/llite_lib.h
lustre/liblustre/super.c
lustre/llite/Makefile.in
lustre/llite/dcache.c
lustre/llite/dir.c
lustre/llite/file.c
lustre/llite/llite_fid.c [new file with mode: 0644]
lustre/llite/llite_internal.h
lustre/llite/llite_lib.c
lustre/llite/llite_nfs.c
lustre/llite/namei.c
lustre/llite/symlink.c
lustre/llite/xattr.c
lustre/mdc/mdc_internal.h
lustre/mdc/mdc_lib.c
lustre/mdc/mdc_locks.c
lustre/mdc/mdc_request.c
lustre/mds/handler.c
lustre/mds/mds_fs.c
lustre/mds/mds_internal.h
lustre/mds/mds_join.c
lustre/mds/mds_lib.c
lustre/mds/mds_open.c
lustre/mds/mds_reint.c
lustre/mds/mds_unlink_open.c
lustre/mdt/mdt.h
lustre/mdt/mdt_handler.c
lustre/mgs/mgs_fs.c
lustre/obdclass/llog_swab.c
lustre/obdclass/lu_object.c
lustre/obdfilter/filter_internal.h
lustre/obdfilter/filter_log.c
lustre/ptlrpc/pack_generic.c
lustre/ptlrpc/ptlrpc_module.c
lustre/utils/wirecheck.c
lustre/utils/wiretest.c

index a05c5d3..1675a5c 100644 (file)
@@ -623,6 +623,24 @@ typedef enum {
 #define MDS_INODELOCK_FULL ((1<<(MDS_INODELOCK_MAXSHIFT+1))-1)
 
 struct lu_fid {
+        __u32 f_seq;  /* holds fid sequence, each client should be able to 
+                         perform 2 ^ 32 connections. */
+        __u16 f_wid;  /* holds width of sequence. */
+        __u16 f_num;  /* holds fid number. */
+};
+
+#define fid_seq(fid) ((fid)->f_seq)
+#define fid_num(fid) ((fid)->f_num)
+#define fid_wid(fid) ((fid)->f_wid)
+
+#define DFID2 "%lu/%u"
+
+#define PFID2(fid) \
+        (unsigned long)fid_seq(fid), \
+        (unsigned int)fid_num(fid)
+
+/* temporary stuff for compatibility */
+struct ll_fid {
         __u64 id;         /* holds object id */
         __u32 generation; /* holds object generation */
 
@@ -630,13 +648,15 @@ struct lu_fid {
                            * OST for saving into EA. */
 };
 
+
+extern void lustre_swab_ll_fid (struct ll_fid *fid);
 extern void lustre_swab_lu_fid (struct lu_fid *fid);
 
-static inline int lfid_eq(const struct lu_fid *f0, const struct lu_fid *f1)
+static inline int lu_fid_eq(const struct lu_fid *f0, const struct lu_fid *f1)
 {
        /* check that there is no alignment padding */
        CLASSERT(sizeof *f0 ==
-                 sizeof f0->id + sizeof f0->generation + sizeof f0->f_type);
+                 sizeof f0->f_seq + sizeof f0->f_wid + sizeof f0->f_num);
        return memcmp(f0, f1, sizeof *f0) == 0;
 }
 
@@ -653,7 +673,7 @@ extern void lustre_swab_mds_status_req (struct mds_status_req *r);
 
 #define MDS_BFLAG_UNCOMMITTED_WRITES   0x1
 
-struct mds_body {
+struct mdt_body {
         struct lu_fid  fid1;
         struct lu_fid  fid2;
         struct lustre_handle handle;
@@ -683,7 +703,38 @@ struct mds_body {
         __u32          padding_4; /* also fix lustre_swab_mds_body */
 };
 
+struct mds_body {
+        struct ll_fid  fid1;
+        struct ll_fid  fid2;
+        struct lustre_handle handle;
+        __u64          valid;
+        __u64          size;   /* Offset, in the case of MDS_READPAGE */
+        __u64          mtime;
+        __u64          atime;
+        __u64          ctime;
+        __u64          blocks; /* XID, in the case of MDS_READPAGE */
+        __u64          io_epoch;
+        __u64          ino;
+        __u32          fsuid;
+        __u32          fsgid;
+        __u32          capability;
+        __u32          mode;
+        __u32          uid;
+        __u32          gid;
+        __u32          flags; /* from vfs for pin/unpin, MDS_BFLAG for close */
+        __u32          rdev;
+        __u32          nlink; /* #bytes to read in the case of MDS_READPAGE */
+        __u32          generation;
+        __u32          suppgid;
+        __u32          eadatasize;
+        __u32          aclsize;
+        __u32          max_mdsize;
+        __u32          max_cookiesize; /* also fix lustre_swab_mds_body */
+        __u32          padding_4; /* also fix lustre_swab_mds_body */
+};
+
 extern void lustre_swab_mds_body (struct mds_body *b);
+extern void lustre_swab_mdt_body (struct mdt_body *b);
 
 #define Q_QUOTACHECK    0x800100
 #define Q_INITQUOTA     0x800101        /* init slave limits */
@@ -714,7 +765,7 @@ struct mds_rec_setattr {
         __u32           sa_cap;
         __u32           sa_suppgid;
         __u32           sa_mode;
-        struct lu_fid   sa_fid;
+        struct ll_fid   sa_fid;
         __u64           sa_valid;
         __u64           sa_size;
         __u64           sa_mtime;
@@ -760,8 +811,8 @@ struct mds_rec_create {
         __u32           cr_cap;
         __u32           cr_flags; /* for use with open */
         __u32           cr_mode;
-        struct lu_fid   cr_fid;
-        struct lu_fid   cr_replayfid;
+        struct ll_fid   cr_fid;
+        struct ll_fid   cr_replayfid;
         __u64           cr_time;
         __u64           cr_rdev;
         __u32           cr_suppgid;
@@ -775,7 +826,7 @@ struct mds_rec_create {
 extern void lustre_swab_mds_rec_create (struct mds_rec_create *cr);
 
 struct mds_rec_join {
-        struct lu_fid  jr_fid;
+        struct ll_fid  jr_fid;
         __u64          jr_headsize;
 };
 
@@ -788,8 +839,8 @@ struct mds_rec_link {
         __u32           lk_cap;
         __u32           lk_suppgid1;
         __u32           lk_suppgid2;
-        struct lu_fid   lk_fid1;
-        struct lu_fid   lk_fid2;
+        struct ll_fid   lk_fid1;
+        struct ll_fid   lk_fid2;
         __u64           lk_time;
         __u32           lk_padding_1;  /* also fix lustre_swab_mds_rec_link */
         __u32           lk_padding_2;  /* also fix lustre_swab_mds_rec_link */
@@ -806,8 +857,8 @@ struct mds_rec_unlink {
         __u32           ul_cap;
         __u32           ul_suppgid;
         __u32           ul_mode;
-        struct lu_fid   ul_fid1;
-        struct lu_fid   ul_fid2;
+        struct ll_fid   ul_fid1;
+        struct ll_fid   ul_fid2;
         __u64           ul_time;
         __u32           ul_padding_1; /* also fix lustre_swab_mds_rec_unlink */
         __u32           ul_padding_2; /* also fix lustre_swab_mds_rec_unlink */
@@ -824,8 +875,8 @@ struct mds_rec_rename {
         __u32           rn_cap;
         __u32           rn_suppgid1;
         __u32           rn_suppgid2;
-        struct lu_fid   rn_fid1;
-        struct lu_fid   rn_fid2;
+        struct ll_fid   rn_fid1;
+        struct ll_fid   rn_fid2;
         __u64           rn_time;
         __u32           rn_padding_1; /* also fix lustre_swab_mds_rec_rename */
         __u32           rn_padding_2; /* also fix lustre_swab_mds_rec_rename */
@@ -1145,7 +1196,7 @@ struct llog_array_rec {
 
 struct llog_create_rec {
         struct llog_rec_hdr     lcr_hdr;
-        struct lu_fid           lcr_fid;
+        struct ll_fid           lcr_fid;
         obd_id                  lcr_oid;
         obd_count               lcr_ogen;
         __u32                   padding;
@@ -1180,7 +1231,7 @@ struct llog_setattr_rec {
 
 struct llog_size_change_rec {
         struct llog_rec_hdr     lsc_hdr;
-        struct lu_fid           lsc_fid;
+        struct ll_fid           lsc_fid;
         __u32                   lsc_io_epoch;
         __u32                   padding;
         struct llog_rec_tail    lsc_tail;
index a9d29e0..eba9531 100644 (file)
@@ -43,8 +43,8 @@ struct lustre_md {
 };
 
 struct mdc_op_data {
-        struct lu_fid    fid1;
-        struct lu_fid    fid2;
+        struct ll_fid    fid1;
+        struct ll_fid    fid2;
         __u64            mod_time;
         const char      *name;
         int              namelen;
@@ -54,8 +54,8 @@ struct mdc_op_data {
 
 struct mds_update_record {
         __u32 ur_opcode;
-        struct lu_fid *ur_fid1;
-        struct lu_fid *ur_fid2;
+        struct ll_fid *ur_fid1;
+        struct ll_fid *ur_fid2;
         int ur_namelen;
         char *ur_name;
         int ur_tgtlen;
@@ -98,11 +98,11 @@ int mds_reint_rec(struct mds_update_record *r, int offset,
 
 /* mds/handler.c */
 #ifdef __KERNEL__
-struct dentry *mds_fid2locked_dentry(struct obd_device *obd, struct lu_fid *fid,
+struct dentry *mds_fid2locked_dentry(struct obd_device *obd, struct ll_fid *fid,
                                      struct vfsmount **mnt, int lock_mode,
                                      struct lustre_handle *lockh,
                                      __u64 lockpart);
-struct dentry *mds_fid2dentry(struct mds_obd *mds, struct lu_fid *fid,
+struct dentry *mds_fid2dentry(struct mds_obd *mds, struct ll_fid *fid,
                               struct vfsmount **mnt);
 int mds_update_server_data(struct obd_device *, int force_sync);
 
@@ -118,7 +118,7 @@ int it_disposition(struct lookup_intent *it, int flag);
 void it_set_disposition(struct lookup_intent *it, int flag);
 int it_open_error(int phase, struct lookup_intent *it);
 void mdc_set_lock_data(__u64 *lockh, void *data);
-int mdc_change_cbdata(struct obd_export *exp, struct lu_fid *fid,
+int mdc_change_cbdata(struct obd_export *exp, struct ll_fid *fid,
                       ldlm_iterator_t it, void *data);
 int mdc_intent_lock(struct obd_export *exp,
                     struct mdc_op_data *,
@@ -145,22 +145,22 @@ int mdc_req2lustre_md(struct ptlrpc_request *req, int offset,
                       struct obd_export *exp, struct lustre_md *md);
 void mdc_free_lustre_md(struct obd_export *exp, struct lustre_md *md);
 
-int mdc_getstatus(struct obd_export *exp, struct lu_fid *rootfid);
-int mdc_getattr(struct obd_export *exp, struct lu_fid *fid,
+int mdc_getstatus(struct obd_export *exp, struct ll_fid *rootfid);
+int mdc_getattr(struct obd_export *exp, struct ll_fid *fid,
                 obd_valid valid, unsigned int ea_size,
                 struct ptlrpc_request **request);
-int mdc_getattr_name(struct obd_export *exp, struct lu_fid *fid,
+int mdc_getattr_name(struct obd_export *exp, struct ll_fid *fid,
                      const char *filename, int namelen, unsigned long valid,
                      unsigned int ea_size, struct ptlrpc_request **request);
 int mdc_setattr(struct obd_export *exp, struct mdc_op_data *data,
                 struct iattr *iattr, void *ea, int ealen, void *ea2, int ea2len,
                 struct ptlrpc_request **request);
-int mdc_setxattr(struct obd_export *exp, struct lu_fid *fid,
+int mdc_setxattr(struct obd_export *exp, struct ll_fid *fid,
                  obd_valid valid, const char *xattr_name,
                  const char *input, int input_size,
                  int output_size, int flags,
                  struct ptlrpc_request **request);
-int mdc_getxattr(struct obd_export *exp, struct lu_fid *fid,
+int mdc_getxattr(struct obd_export *exp, struct ll_fid *fid,
                  obd_valid valid, const char *xattr_name,
                  const char *input, int input_size,
                  int output_size, struct ptlrpc_request **request);
@@ -173,7 +173,7 @@ void mdc_set_open_replay_data(struct obd_client_handle *och,
 void mdc_clear_open_replay_data(struct obd_client_handle *och);
 int mdc_close(struct obd_export *, struct obdo *, struct obd_client_handle *,
               struct ptlrpc_request **);
-int mdc_readpage(struct obd_export *exp, struct lu_fid *mdc_fid, __u64 offset,
+int mdc_readpage(struct obd_export *exp, struct ll_fid *mdc_fid, __u64 offset,
                  struct page *, struct ptlrpc_request **);
 int mdc_create(struct obd_export *exp, struct mdc_op_data *op_data,
                const void *data, int datalen, int mode, __u32 uid, __u32 gid,
@@ -185,7 +185,7 @@ int mdc_link(struct obd_export *exp, struct mdc_op_data *data,
 int mdc_rename(struct obd_export *exp, struct mdc_op_data *data,
                const char *old, int oldlen, const char *new, int newlen,
                struct ptlrpc_request **request);
-int mdc_sync(struct obd_export *exp, struct lu_fid *fid,
+int mdc_sync(struct obd_export *exp, struct ll_fid *fid,
              struct ptlrpc_request **);
 int mdc_create_client(struct obd_uuid uuid, struct ptlrpc_client *cl);
 
@@ -195,7 +195,7 @@ void mdc_store_inode_generation(struct ptlrpc_request *req, int reqoff,
 int mdc_llog_process(struct obd_export *, char *logname, llog_cb_t, void *data);
 int mdc_done_writing(struct obd_export *exp, struct obdo *);
 
-static inline void mdc_pack_fid(struct lu_fid *fid, obd_id ino, __u32 gen,
+static inline void mdc_pack_fid(struct ll_fid *fid, obd_id ino, __u32 gen,
                                 int type)
 {
         fid->id = ino;
index 76a5569..858e3f5 100644 (file)
@@ -27,7 +27,7 @@
 #include <libcfs/kp30.h>
 #include <linux/lustre_ucache.h>
 
-#define LU_FID_NAMELEN (16 + 1 + 8 + 1)
+#define LL_FID_NAMELEN (16 + 1 + 8 + 1)
 
 #if defined __KERNEL__
 #include <linux/lustre_compat25.h>
@@ -142,7 +142,7 @@ static inline void ll_sleep(int t)
 }
 #endif
 
-static inline int lu_fid2str(char *str, __u64 id, __u32 generation)
+static inline int ll_fid2str(char *str, __u64 id, __u32 generation)
 {
         return sprintf(str, "%llx:%08x", (unsigned long long)id, generation);
 }
index d455307..7c31b31 100644 (file)
@@ -25,7 +25,7 @@ struct l_linux_dirent {
         struct list_head lld_list;
         ino_t           lld_ino;
         unsigned long   lld_off;
-        char            lld_name[LU_FID_NAMELEN];
+        char            lld_name[LL_FID_NAMELEN];
 };
 struct l_readdir_callback {
         struct l_linux_dirent *lrc_dirent;
index f3489cd..55b61c1 100644 (file)
@@ -399,7 +399,7 @@ struct mds_obd {
         __u64                            mds_io_epoch;
         unsigned long                    mds_atime_diff;
         struct semaphore                 mds_epoch_sem;
-        struct lu_fid                    mds_rootfid;
+        struct ll_fid                    mds_rootfid;
         struct lr_server_data           *mds_server_data;
         struct dentry                   *mds_pending_dir;
         struct dentry                   *mds_logs_dir;
index 6437fab..3a59da9 100644 (file)
@@ -67,7 +67,7 @@ static int llu_dir_do_readpage(struct inode *inode, struct page *page)
         struct llu_inode_info *lli = llu_i2info(inode);
         struct intnl_stat *st = llu_i2stat(inode);
         struct llu_sb_info *sbi = llu_i2sbi(inode);
-        struct lu_fid mdc_fid;
+        struct ll_fid mdc_fid;
         __u64 offset;
         int rc = 0;
         struct ptlrpc_request *request;
index 1d2d19d..b853899 100644 (file)
@@ -28,7 +28,7 @@ struct llu_sb_info
         struct obd_uuid          ll_sb_uuid;
         struct obd_export       *ll_mdc_exp;
         struct obd_export       *ll_osc_exp;
-        obd_id                   ll_rootino;
+        struct ll_fid            ll_root_fid;
         int                      ll_flags;
         struct lustre_client_ocd ll_lco;
         struct list_head         ll_conn_chain;
@@ -45,7 +45,7 @@ struct llu_sb_info
 
 struct llu_inode_info {
         struct llu_sb_info     *lli_sbi;
-        struct lu_fid           lli_fid;
+        struct ll_fid           lli_fid;
 
         struct lov_stripe_md   *lli_smd;
         char                   *lli_symlink_name;
@@ -107,7 +107,7 @@ static inline struct obd_export *llu_i2mdcexp(struct inode *inode)
 static inline int llu_is_root_inode(struct inode *inode)
 {
         return (llu_i2info(inode)->lli_fid.id ==
-                llu_i2info(inode)->lli_sbi->ll_rootino);
+                llu_i2info(inode)->lli_sbi->ll_root_fid.id);
 }
 
 #define LL_SAVE_INTENT(inode, it)                                              \
@@ -136,7 +136,7 @@ do {                                                                           \
 #define LL_LOOKUP_POSITIVE 1
 #define LL_LOOKUP_NEGATIVE 2
 
-static inline void ll_inode2fid(struct lu_fid *fid, struct inode *inode)
+static inline void ll_inode2fid(struct ll_fid *fid, struct inode *inode)
 {
         *fid = llu_i2info(inode)->lli_fid;
 }
index 99197b3..3db4b5f 100644 (file)
@@ -346,7 +346,7 @@ int llu_inode_getattr(struct inode *inode, struct lov_stripe_md *lsm)
 }
 
 static struct inode* llu_new_inode(struct filesys *fs,
-                                   struct lu_fid *fid)
+                                   struct ll_fid *fid)
 {
         struct inode *inode;
         struct llu_inode_info *lli;
@@ -436,7 +436,7 @@ static int llu_inode_revalidate(struct inode *inode)
                 struct lustre_md md;
                 struct ptlrpc_request *req = NULL;
                 struct llu_sb_info *sbi = llu_i2sbi(inode);
-                struct lu_fid fid;
+                struct ll_fid fid;
                 unsigned long valid = OBD_MD_FLGETATTR;
                 int rc, ealen = 0;
 
@@ -538,7 +538,7 @@ static int null_if_equal(struct ldlm_lock *lock, void *data)
 
 void llu_clear_inode(struct inode *inode)
 {
-        struct lu_fid fid;
+        struct ll_fid fid;
         struct llu_inode_info *lli = llu_i2info(inode);
         struct llu_sb_info *sbi = llu_i2sbi(inode);
         ENTRY;
@@ -882,7 +882,7 @@ static int llu_readlink_internal(struct inode *inode,
 {
         struct llu_inode_info *lli = llu_i2info(inode);
         struct llu_sb_info *sbi = llu_i2sbi(inode);
-        struct lu_fid fid;
+        struct ll_fid fid;
         struct mds_body *body;
         struct intnl_stat *st = llu_i2stat(inode);
         int rc, symlen = st->st_size + 1;
@@ -1631,7 +1631,7 @@ struct filesys_ops llu_filesys_ops =
 struct inode *llu_iget(struct filesys *fs, struct lustre_md *md)
 {
         struct inode *inode;
-        struct lu_fid fid;
+        struct ll_fid fid;
         struct file_identifier fileid = {&fid, sizeof(fid)};
 
         if ((md->body->valid &
@@ -1679,7 +1679,7 @@ llu_fsswop_mount(const char *source,
         struct inode *root;
         struct pnode_base *rootpb;
         struct obd_device *obd;
-        struct lu_fid rootfid;
+        struct ll_fid rootfid;
         struct llu_sb_info *sbi;
         struct obd_statfs osfs;
         static struct qstr noname = { NULL, 0, 0 };
@@ -1817,7 +1817,7 @@ llu_fsswop_mount(const char *source,
                 GOTO(out_osc, err);
         }
         CDEBUG(D_SUPER, "rootfid "LPU64"\n", rootfid.id);
-        sbi->ll_rootino = rootfid.id;
+        sbi->ll_root_fid = rootfid;
 
         /* fetch attr of root inode */
         err = mdc_getattr(sbi->ll_mdc_exp, &rootfid,
@@ -1833,7 +1833,7 @@ llu_fsswop_mount(const char *source,
                 GOTO(out_request, err);
         }
 
-        LASSERT(sbi->ll_rootino != 0);
+        LASSERT(sbi->ll_root_fid.id != 0);
 
         root = llu_iget(fs, &md);
         if (!root || IS_ERR(root)) {
index 7a908d7..96a0a49 100644 (file)
@@ -1,5 +1,5 @@
 MODULES := llite
-llite-objs := dcache.o dir.o file.o llite_close.o llite_lib.o llite_nfs.o rw.o lproc_llite.o namei.o special.o symlink.o llite_mmap.o xattr.o
+llite-objs := dcache.o dir.o file.o llite_close.o llite_lib.o llite_nfs.o llite_fid.o rw.o lproc_llite.o namei.o special.o symlink.o llite_mmap.o xattr.o
 
 ifeq ($(PATCHLEVEL),4)
 llite-objs += rw24.o super.o
index addd08c..6ceebfb 100644 (file)
@@ -231,7 +231,7 @@ static int revalidate_it_finish(struct ptlrpc_request *request, int offset,
                 RETURN(-ENOENT);
 
         sbi = ll_i2sbi(de->d_inode);
-        rc = ll_prep_inode(sbi->ll_osc_exp, &de->d_inode, request, offset,NULL);
+        rc = ll_prep_inode(sbi->ll_osc_exp, &de->d_inode, request, offset, NULL);
 
         RETURN(rc);
 }
index 04ed1a7..8102e50 100644 (file)
@@ -59,7 +59,7 @@ typedef struct ext2_dir_entry_2 ext2_dirent;
 static int ll_dir_readpage(struct file *file, struct page *page)
 {
         struct inode *inode = page->mapping->host;
-        struct lu_fid mdc_fid;
+        struct ll_fid mdc_fid;
         __u64 offset;
         struct ptlrpc_request *request;
         struct mds_body *body;
@@ -406,7 +406,7 @@ static int ll_dir_ioctl(struct inode *inode, struct file *file,
         */
         case IOC_MDC_LOOKUP: {
                 struct ptlrpc_request *request = NULL;
-                struct lu_fid fid;
+                struct ll_fid fid;
                 char *buf = NULL;
                 char *filename;
                 int namelen, rc, len = 0;
@@ -483,7 +483,7 @@ static int ll_dir_ioctl(struct inode *inode, struct file *file,
                 struct ptlrpc_request *request = NULL;
                 struct lov_user_md *lump = (struct lov_user_md *)arg;
                 struct lov_mds_md *lmm;
-                struct lu_fid fid;
+                struct ll_fid fid;
                 struct mds_body *body;
                 int rc, lmmsize;
 
@@ -536,7 +536,7 @@ static int ll_dir_ioctl(struct inode *inode, struct file *file,
         case IOC_MDC_GETFILEINFO:
         case IOC_MDC_GETSTRIPE: {
                 struct ptlrpc_request *request = NULL;
-                struct lu_fid fid;
+                struct ll_fid fid;
                 struct mds_body *body;
                 struct lov_user_md *lump;
                 struct lov_mds_md *lmm;
index 8a90ae2..063eed3 100644 (file)
@@ -1555,7 +1555,7 @@ int ll_fsync(struct file *file, struct dentry *dentry, int data)
         struct inode *inode = dentry->d_inode;
         struct ll_inode_info *lli = ll_i2info(inode);
         struct lov_stripe_md *lsm = lli->lli_smd;
-        struct lu_fid fid;
+        struct ll_fid fid;
         struct ptlrpc_request *req;
         int rc, err;
         ENTRY;
@@ -1741,7 +1741,7 @@ int ll_inode_revalidate_it(struct dentry *dentry, struct lookup_intent *it)
         if (!ll_have_md_lock(dentry)) {
                 struct ptlrpc_request *req = NULL;
                 struct ll_sb_info *sbi = ll_i2sbi(dentry->d_inode);
-                struct lu_fid fid;
+                struct ll_fid fid;
                 obd_valid valid = OBD_MD_FLGETATTR;
                 int ealen = 0;
 
diff --git a/lustre/llite/llite_fid.c b/lustre/llite/llite_fid.c
new file mode 100644 (file)
index 0000000..48eec2e
--- /dev/null
@@ -0,0 +1,44 @@
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
+ *
+ * Lustre Light Super operations
+ *
+ *  Copyright (c) 2002-2005 Cluster File Systems, Inc.
+ *
+ *   This file is part of Lustre, http://www.lustre.org.
+ *
+ *   Lustre is free software; you can redistribute it and/or
+ *   modify it under the terms of version 2 of the GNU General Public
+ *   License as published by the Free Software Foundation.
+ *
+ *   Lustre is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with Lustre; if not, write to the Free Software
+ *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#define DEBUG_SUBSYSTEM S_LLITE
+
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/random.h>
+#include <linux/version.h>
+
+#include <linux/lustre_lite.h>
+#include <linux/lustre_ha.h>
+#include <linux/lustre_ver.h>
+#include <linux/lustre_dlm.h>
+#include <linux/lustre_disk.h>
+#include "llite_internal.h"
+
+/* allocates passed fid, that is assigns f_num and f_seq to the @fid */
+int ll_fid_alloc(struct ll_sb_info *sbi, struct lu_fid *fid)
+{
+    ENTRY;
+    RETURN(0);
+}
+
index 1a76746..a590e89 100644 (file)
@@ -90,6 +90,9 @@ struct ll_inode_info {
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
         struct inode            lli_vfs_inode;
 #endif
+
+        /* inode fid */
+        struct lu_fid           lli_fid;
 };
 
 /*
@@ -155,7 +158,7 @@ struct ll_sb_info {
         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 ll_fid             ll_root_fid; /* root object fid */
 
         int                       ll_flags;
         struct list_head          ll_conn_chain; /* per-conn chain of SBs */
@@ -540,7 +543,7 @@ static inline struct obd_export *ll_i2mdcexp(struct inode *inode)
         return ll_s2mdcexp(inode->i_sb);
 }
 
-static inline void ll_inode2fid(struct lu_fid *fid, struct inode *inode)
+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);
@@ -564,4 +567,7 @@ ssize_t ll_getxattr(struct dentry *dentry, const char *name,
 ssize_t ll_listxattr(struct dentry *dentry, char *buffer, size_t size);
 int ll_removexattr(struct dentry *dentry, const char *name);
 
+/* llite/llite_fid.c*/
+int ll_fid_alloc(struct ll_sb_info *sbi, struct lu_fid *fid);
+
 #endif /* LLITE_INTERNAL_H */
index 37c8e65..dfeb8fd 100644 (file)
@@ -109,7 +109,7 @@ int client_common_fill_super(struct super_block *sb, char *mdc, char *osc)
         struct inode *root = 0;
         struct ll_sb_info *sbi = ll_s2sbi(sb);
         struct obd_device *obd;
-        struct lu_fid rootfid;
+        struct ll_fid rootfid;
         struct obd_statfs osfs;
         struct ptlrpc_request *request = NULL;
         struct lustre_handle osc_conn = {0, };
@@ -267,7 +267,7 @@ int client_common_fill_super(struct super_block *sb, char *mdc, char *osc)
                 GOTO(out_osc, err);
         }
         CDEBUG(D_SUPER, "rootfid "LPU64"\n", rootfid.id);
-        sbi->ll_rootino = rootfid.id;
+        sbi->ll_root_fid = rootfid;
 
         sb->s_op = &lustre_super_operations;
 
@@ -289,8 +289,8 @@ int client_common_fill_super(struct super_block *sb, char *mdc, char *osc)
                 GOTO(out_osc, err);
         }
 
-        LASSERT(sbi->ll_rootino != 0);
-        root = ll_iget(sb, sbi->ll_rootino, &md);
+        LASSERT(sbi->ll_root_fid.id != 0);
+        root = ll_iget(sb, sbi->ll_root_fid.id, &md);
 
         ptlrpc_req_finished(request);
 
@@ -773,7 +773,7 @@ static int null_if_equal(struct ldlm_lock *lock, void *data)
 
 void ll_clear_inode(struct inode *inode)
 {
-        struct lu_fid fid;
+        struct ll_fid fid;
         struct ll_inode_info *lli = ll_i2info(inode);
         struct ll_sb_info *sbi = ll_i2sbi(inode);
         ENTRY;
@@ -1340,7 +1340,7 @@ int ll_iocontrol(struct inode *inode, struct file *file,
 
         switch(cmd) {
         case EXT3_IOC_GETFLAGS: {
-                struct lu_fid fid;
+                struct ll_fid fid;
                 struct mds_body *body;
 
                 ll_inode2fid(&fid, inode);
@@ -1499,7 +1499,8 @@ int ll_remount_fs(struct super_block *sb, int *flags, char *data)
 }
 
 int ll_prep_inode(struct obd_export *exp, struct inode **inode,
-                  struct ptlrpc_request *req, int offset,struct super_block *sb)
+                  struct ptlrpc_request *req, int offset,
+                  struct super_block *sb)
 {
         struct lustre_md md;
         struct ll_sb_info *sbi = NULL;
@@ -1525,6 +1526,20 @@ int ll_prep_inode(struct obd_export *exp, struct inode **inode,
                         CERROR("new_inode -fatal: rc %d\n", rc);
                         GOTO(out, rc);
                 }
+#if 0
+                {
+                        struct ll_inode_info *lli;
+                
+                        lli = ll_i2info(*inode);
+                        rc = ll_fid_alloc(sbi, lli->lli_fid);
+                        if (rc) {
+                                CERROR("cannot allocate new fid, rc %d\n", 
+                                       rc);
+                                mdc_free_lustre_md(exp, &md);
+                                GOTO(out, rc);
+                        }
+                }
+#endif
         }
 
         rc = obd_checkmd(exp, ll_i2mdcexp(*inode),
index 9aa0da8..bfe864a 100644 (file)
@@ -43,7 +43,7 @@ static int ll_nfs_test_inode(struct inode *inode, unsigned long ino, void *opaqu
 static int ll_nfs_test_inode(struct inode *inode, void *opaque)
 #endif
 {
-        struct lu_fid *iid = opaque;
+        struct ll_fid *iid = opaque;
 
         if (inode->i_ino == iid->id && inode->i_generation == iid->generation)
                 return 1;
@@ -58,11 +58,11 @@ static struct inode * search_inode_for_lustre(struct super_block *sb,
 {
         struct ptlrpc_request *req = NULL;
         struct ll_sb_info *sbi = ll_s2sbi(sb);
-        struct lu_fid fid;
+        struct ll_fid fid;
         unsigned long valid = 0;
         int eadatalen = 0, rc;
         struct inode *inode = NULL;
-        struct lu_fid iid = { .id = ino, .generation = generation };
+        struct ll_fid iid = { .id = ino, .generation = generation };
 
         inode = ILOOKUP(sb, ino, ll_nfs_test_inode, &iid);
 
index 7645a0a..724ef88 100644 (file)
@@ -176,11 +176,25 @@ int ll_mdc_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
                 if (inode == NULL)
                         break;
 
+#ifdef ENABLED_FID
+                {
+                        struct ll_inode_info *lli;
+                
+                        lli = ll_i2info(inode);
+                
+                        if (lock->l_resource->lr_name.name[0] != fid_seq(&lli->lli_fid) ||
+                            lock->l_resource->lr_name.name[1] != fid_num(&lli->lli_fid)) {
+                                LDLM_ERROR(lock, "data mismatch with object "DLID2" (%p)",
+                                           PLID2(&lli->lli_fid), inode);
+                        }
+                }
+#else
                 if (lock->l_resource->lr_name.name[0] != inode->i_ino ||
                     lock->l_resource->lr_name.name[1] != inode->i_generation) {
-                        LDLM_ERROR(lock, "data mismatch with ino %lu/%u (%p)",
+                        LDLM_ERROR(lock, "data mismatch with object %lu/%u (%p)",
                                    inode->i_ino, inode->i_generation, inode);
                 }
+#endif
 
                 if (bits & MDS_INODELOCK_UPDATE)
                         clear_bit(LLI_F_HAVE_MDS_SIZE_LOCK,
index ad077c5..f069420 100644 (file)
@@ -34,7 +34,7 @@ static int ll_readlink_internal(struct inode *inode,
 {
         struct ll_inode_info *lli = ll_i2info(inode);
         struct ll_sb_info *sbi = ll_i2sbi(inode);
-        struct lu_fid fid;
+        struct ll_fid fid;
         struct mds_body *body;
         int rc, symlen = inode->i_size + 1;
         ENTRY;
index 72ee1b2..da0a951 100644 (file)
@@ -94,7 +94,7 @@ int ll_setxattr_common(struct inode *inode, const char *name,
 {
         struct ll_sb_info *sbi = ll_i2sbi(inode);
         struct ptlrpc_request *req;
-        struct lu_fid fid;
+        struct ll_fid fid;
         int xattr_type, rc;
         ENTRY;
 
@@ -157,7 +157,7 @@ int ll_getxattr_common(struct inode *inode, const char *name,
         struct ll_sb_info *sbi = ll_i2sbi(inode);
         struct ptlrpc_request *req = NULL;
         struct mds_body *body;
-        struct lu_fid fid;
+        struct ll_fid fid;
         void *xdata;
         int xattr_type, rc;
         ENTRY;
index 8bf4a06..9459b51 100644 (file)
@@ -1,9 +1,9 @@
 #include <linux/lustre_mds.h>
 void mdc_pack_req_body(struct ptlrpc_request *req, int offset,
-                       __u64 valid, struct lu_fid *fid, int ea_size);
+                       __u64 valid, struct ll_fid *fid, int ea_size);
 void mdc_pack_rep_body(struct ptlrpc_request *);
 void mdc_readdir_pack(struct ptlrpc_request *req, int pos, __u64 offset,
-                     __u32 size, struct lu_fid *mdc_fid);
+                     __u32 size, struct ll_fid *mdc_fid);
 void mdc_getattr_pack(struct ptlrpc_request *req, int valid, int offset,
                       int flags, struct mdc_op_data *data);
 void mdc_setattr_pack(struct ptlrpc_request *req, int offset,
index 8415bf9..1f614df 100644 (file)
@@ -40,7 +40,7 @@
 #endif
 
 void mdc_readdir_pack(struct ptlrpc_request *req, int pos, __u64 offset,
-                      __u32 size, struct lu_fid *mdc_fid)
+                      __u32 size, struct ll_fid *mdc_fid)
 {
         struct mds_body *b;
 
@@ -64,7 +64,7 @@ static void mdc_pack_body(struct mds_body *b)
 }
 
 void mdc_pack_req_body(struct ptlrpc_request *req, int offset,
-                       __u64 valid, struct lu_fid *fid, int ea_size)
+                       __u64 valid, struct ll_fid *fid, int ea_size)
 {
         struct mds_body *b = lustre_msg_buf(req->rq_reqmsg, offset, sizeof(*b));
 
index 83ffd70..0d85c2e 100644 (file)
@@ -143,7 +143,7 @@ void mdc_set_lock_data(__u64 *l, void *data)
 }
 EXPORT_SYMBOL(mdc_set_lock_data);
 
-int mdc_change_cbdata(struct obd_export *exp, struct lu_fid *fid, 
+int mdc_change_cbdata(struct obd_export *exp, struct ll_fid *fid, 
                       ldlm_iterator_t it, void *data)
 {
         struct ldlm_res_id res_id = { .name = {0} };
index 111cb81..c647c90 100644 (file)
@@ -49,7 +49,7 @@ static int mdc_cleanup(struct obd_device *obd);
 extern int mds_queue_req(struct ptlrpc_request *);
 /* Helper that implements most of mdc_getstatus and signal_completed_replay. */
 /* XXX this should become mdc_get_info("key"), sending MDS_GET_INFO RPC */
-static int send_getstatus(struct obd_import *imp, struct lu_fid *rootfid,
+static int send_getstatus(struct obd_import *imp, struct ll_fid *rootfid,
                           int level, int msg_flags)
 {
         struct ptlrpc_request *req;
@@ -93,7 +93,7 @@ static int send_getstatus(struct obd_import *imp, struct lu_fid *rootfid,
 }
 
 /* This should be mdc_get_info("rootfid") */
-int mdc_getstatus(struct obd_export *exp, struct lu_fid *rootfid)
+int mdc_getstatus(struct obd_export *exp, struct ll_fid *rootfid)
 {
         return send_getstatus(class_exp2cliimp(exp), rootfid, LUSTRE_IMP_FULL,
                               0);
@@ -162,7 +162,7 @@ int mdc_getattr_common(struct obd_export *exp, unsigned int ea_size,
         RETURN (0);
 }
 
-int mdc_getattr(struct obd_export *exp, struct lu_fid *fid,
+int mdc_getattr(struct obd_export *exp, struct ll_fid *fid,
                 obd_valid valid, unsigned int ea_size,
                 struct ptlrpc_request **request)
 {
@@ -196,7 +196,7 @@ int mdc_getattr(struct obd_export *exp, struct lu_fid *fid,
         RETURN (rc);
 }
 
-int mdc_getattr_name(struct obd_export *exp, struct lu_fid *fid,
+int mdc_getattr_name(struct obd_export *exp, struct ll_fid *fid,
                      const char *filename, int namelen, unsigned long valid,
                      unsigned int ea_len, struct ptlrpc_request **request)
 {
@@ -225,7 +225,7 @@ int mdc_getattr_name(struct obd_export *exp, struct lu_fid *fid,
 }
 
 static
-int mdc_xattr_common(struct obd_export *exp, struct lu_fid *fid,
+int mdc_xattr_common(struct obd_export *exp, struct ll_fid *fid,
                      int opcode, obd_valid valid, const char *xattr_name,
                      const char *input, int input_size, int output_size,
                      int flags, struct ptlrpc_request **request)
@@ -306,7 +306,7 @@ err_out:
         goto out;
 }
 
-int mdc_setxattr(struct obd_export *exp, struct lu_fid *fid,
+int mdc_setxattr(struct obd_export *exp, struct ll_fid *fid,
                  obd_valid valid, const char *xattr_name,
                  const char *input, int input_size,
                  int output_size, int flags,
@@ -316,7 +316,7 @@ int mdc_setxattr(struct obd_export *exp, struct lu_fid *fid,
                                 input, input_size, output_size, flags, request);
 }
 
-int mdc_getxattr(struct obd_export *exp, struct lu_fid *fid,
+int mdc_getxattr(struct obd_export *exp, struct ll_fid *fid,
                  obd_valid valid, const char *xattr_name,
                  const char *input, int input_size,
                  int output_size, struct ptlrpc_request **request)
@@ -712,7 +712,7 @@ int mdc_done_writing(struct obd_export *exp, struct obdo *obdo)
         RETURN(rc);
 }
 
-int mdc_readpage(struct obd_export *exp, struct lu_fid *fid, __u64 offset,
+int mdc_readpage(struct obd_export *exp, struct ll_fid *fid, __u64 offset,
                  struct page *page, struct ptlrpc_request **request)
 {
         struct obd_import *imp = class_exp2cliimp(exp);
@@ -1026,7 +1026,7 @@ static int mdc_unpin(struct obd_export *exp,
         RETURN(rc);
 }
 
-int mdc_sync(struct obd_export *exp, struct lu_fid *fid,
+int mdc_sync(struct obd_export *exp, struct ll_fid *fid,
              struct ptlrpc_request **request)
 {
         struct ptlrpc_request *req;
index d1aa2dd..823e36e 100644 (file)
@@ -162,7 +162,7 @@ static int mds_sendpage(struct ptlrpc_request *req, struct file *file,
 }
 
 /* only valid locked dentries or errors should be returned */
-struct dentry *mds_fid2locked_dentry(struct obd_device *obd, struct lu_fid *fid,
+struct dentry *mds_fid2locked_dentry(struct obd_device *obd, struct ll_fid *fid,
                                      struct vfsmount **mnt, int lock_mode,
                                      struct lustre_handle *lockh,
                                      __u64 lockpart)
@@ -194,7 +194,7 @@ struct dentry *mds_fid2locked_dentry(struct obd_device *obd, struct lu_fid *fid,
 /* Look up an entry by inode number. */
 /* this function ONLY returns valid dget'd dentries with an initialized inode
    or errors */
-struct dentry *mds_fid2dentry(struct mds_obd *mds, struct lu_fid *fid,
+struct dentry *mds_fid2dentry(struct mds_obd *mds, struct ll_fid *fid,
                               struct vfsmount **mnt)
 {
         char fid_name[32];
@@ -878,7 +878,7 @@ static int mds_getattr_name(int offset, struct ptlrpc_request *req,
                     GOTO(cleanup, rc);
         } else {
                 struct ldlm_lock *granted_lock;
-                struct lu_fid child_fid;
+                struct ll_fid child_fid;
                 struct ldlm_resource *res;
                 DEBUG_REQ(D_DLMTRACE, req, "resent, not enqueuing new locks");
                 granted_lock = ldlm_handle2lock(child_lockh);
@@ -2552,7 +2552,7 @@ static struct dentry *mds_lvfs_fid2dentry(__u64 id, __u32 gen, __u64 gr,
                                           void *data)
 {
         struct obd_device *obd = data;
-        struct lu_fid fid;
+        struct ll_fid fid;
         fid.id = id;
         fid.generation = gen;
         return mds_fid2dentry(&obd->u.mds, &fid, NULL);
index 4fb2949..0ff7870 100644 (file)
@@ -644,7 +644,7 @@ int mds_obd_create(struct obd_export *exp, struct obdo *oa,
         struct file *filp;
         struct dentry *new_child;
         struct lvfs_run_ctxt saved;
-        char fidname[LU_FID_NAMELEN];
+        char fidname[LL_FID_NAMELEN];
         void *handle;
         struct lvfs_ucred ucred = { 0 };
         int rc = 0, err, namelen;
@@ -672,7 +672,7 @@ int mds_obd_create(struct obd_export *exp, struct obdo *oa,
 
         oa->o_id = filp->f_dentry->d_inode->i_ino;
         oa->o_generation = filp->f_dentry->d_inode->i_generation;
-        namelen = lu_fid2str(fidname, oa->o_id, oa->o_generation);
+        namelen = ll_fid2str(fidname, oa->o_id, oa->o_generation);
 
         down(&parent_inode->i_sem);
         new_child = lookup_one_len(fidname, mds->mds_objects_dir, namelen);
@@ -730,7 +730,7 @@ int mds_obd_destroy(struct obd_export *exp, struct obdo *oa,
         struct obd_device *obd = exp->exp_obd;
         struct lvfs_run_ctxt saved;
         struct lvfs_ucred ucred = { 0 };
-        char fidname[LU_FID_NAMELEN];
+        char fidname[LL_FID_NAMELEN];
         struct dentry *de;
         void *handle;
         int err, namelen, rc = 0;
@@ -739,7 +739,7 @@ int mds_obd_destroy(struct obd_export *exp, struct obdo *oa,
         ucred.luc_cap = current->cap_effective | CAP_SYS_RESOURCE;
         push_ctxt(&saved, &obd->obd_lvfs_ctxt, &ucred);
 
-        namelen = lu_fid2str(fidname, oa->o_id, oa->o_generation);
+        namelen = ll_fid2str(fidname, oa->o_id, oa->o_generation);
 
         down(&parent_inode->i_sem);
         de = lookup_one_len(fidname, mds->mds_objects_dir, namelen);
index 6b95e7f..38eb3c9 100644 (file)
@@ -127,7 +127,7 @@ int mds_finish_transno(struct mds_obd *mds, struct inode *inode, void *handle,
 void mds_reconstruct_generic(struct ptlrpc_request *req);
 void mds_req_from_mcd(struct ptlrpc_request *req, struct mds_client_data *mcd);
 int mds_get_parent_child_locked(struct obd_device *obd, struct mds_obd *mds,
-                                struct lu_fid *fid,
+                                struct ll_fid *fid,
                                 struct lustre_handle *parent_lockh,
                                 struct dentry **dparentp, int parent_mode,
                                 __u64 parent_lockpart,
@@ -139,13 +139,13 @@ int mds_lock_new_child(struct obd_device *obd, struct inode *inode,
                        struct lustre_handle *child_lockh);
 int mds_osc_setattr_async(struct obd_device *obd, struct inode *inode,
                           struct lov_mds_md *lmm, int lmm_size,
-                          struct llog_cookie *logcookies, struct lu_fid *fid);
+                          struct llog_cookie *logcookies, struct ll_fid *fid);
 
 int mds_get_parents_children_locked(struct obd_device *obd,
                                     struct mds_obd *mds,
-                                    struct lu_fid *p1_fid,
+                                    struct ll_fid *p1_fid,
                                     struct dentry **de_srcdirp,
-                                    struct lu_fid *p2_fid,
+                                    struct ll_fid *p2_fid,
                                     struct dentry **de_tgtdirp,
                                     int parent_mode,
                                     const char *old_name, int old_len,
@@ -234,7 +234,7 @@ int mds_get_md(struct obd_device *, struct inode *, void *md, int *size,
                int lock);
 int mds_pack_md(struct obd_device *, struct lustre_msg *, int offset,
                 struct mds_body *, struct inode *, int lock);
-void mds_pack_inode2fid(struct lu_fid *fid, struct inode *inode);
+void mds_pack_inode2fid(struct ll_fid *fid, struct inode *inode);
 void mds_pack_inode2body(struct mds_body *body, struct inode *inode);
 #endif
 int mds_pack_acl(struct mds_export_data *med, struct inode *inode,
index 450eb76..1a56542 100644 (file)
@@ -252,7 +252,7 @@ static int mds_join_unlink_tail_inode(struct mds_update_record *rec,
         struct inode *tail_inode, *head_inode;
         struct dentry *de_tailparent = NULL, *de_tail = NULL, *de_head = NULL;
         struct lustre_handle dlm_handles[4] = {{0}, {0}, {0}, {0}};
-        struct lu_fid head_fid;
+        struct ll_fid head_fid;
         int rc;
         ENTRY;
 
index 0c35476..4bc0f1b 100644 (file)
@@ -52,7 +52,7 @@
 #include <linux/lustre_lib.h>
 #include "mds_internal.h"
 
-void mds_pack_inode2fid(struct lu_fid *fid, struct inode *inode)
+void mds_pack_inode2fid(struct ll_fid *fid, struct inode *inode)
 {
         fid->id = inode->i_ino;
         fid->generation = inode->i_generation;
index 3d98bc2..4586573 100644 (file)
@@ -757,18 +757,18 @@ static int mds_finish_open(struct ptlrpc_request *req, struct dentry *dchild,
         RETURN(rc);
 }
 
-static int mds_open_by_fid(struct ptlrpc_request *req, struct lu_fid *fid,
+static int mds_open_by_fid(struct ptlrpc_request *req, struct ll_fid *fid,
                            struct mds_body *body, int flags,
                            struct mds_update_record *rec,struct ldlm_reply *rep)
 {
         struct mds_obd *mds = mds_req2mds(req);
         struct dentry *dchild;
-        char fidname[LU_FID_NAMELEN];
+        char fidname[LL_FID_NAMELEN];
         int fidlen = 0, rc;
         void *handle = NULL;
         ENTRY;
 
-        fidlen = lu_fid2str(fidname, fid->id, fid->generation);
+        fidlen = ll_fid2str(fidname, fid->id, fid->generation);
         dchild = ll_lookup_one_len(fidname, mds->mds_pending_dir, fidlen);
         if (IS_ERR(dchild)) {
                 rc = PTR_ERR(dchild);
@@ -1158,7 +1158,7 @@ int mds_mfd_close(struct ptlrpc_request *req, int offset,struct obd_device *obd,
                   struct mds_file_data *mfd, int unlink_orphan)
 {
         struct inode *inode = mfd->mfd_dentry->d_inode;
-        char fidname[LU_FID_NAMELEN];
+        char fidname[LL_FID_NAMELEN];
         int last_orphan, fidlen, rc = 0, cleanup_phase = 0;
         struct dentry *pending_child = NULL;
         struct mds_obd *mds = &obd->u.mds;
@@ -1176,7 +1176,7 @@ int mds_mfd_close(struct ptlrpc_request *req, int offset,struct obd_device *obd,
                 reply_body = lustre_msg_buf(req->rq_repmsg, 0,
                                             sizeof(*reply_body));
 
-        fidlen = lu_fid2str(fidname, inode->i_ino, inode->i_generation);
+        fidlen = ll_fid2str(fidname, inode->i_ino, inode->i_generation);
 
         CDEBUG(D_INODE, "inode %p ino %s nlink %d orphan %d\n", inode, fidname,
                inode->i_nlink, mds_orphan_open_count(inode));
index bc65e86..4e4c2ce 100644 (file)
@@ -390,7 +390,7 @@ static void reconstruct_reint_setattr(struct mds_update_record *rec,
 
 int mds_osc_setattr_async(struct obd_device *obd, struct inode *inode,
                           struct lov_mds_md *lmm, int lmm_size,
-                          struct llog_cookie *logcookies, struct lu_fid *fid)
+                          struct llog_cookie *logcookies, struct ll_fid *fid)
 {
         struct mds_obd *mds = &obd->u.mds;
         struct lov_stripe_md *lsm = NULL;
@@ -1225,7 +1225,7 @@ cleanup:
 }
 
 int mds_get_parent_child_locked(struct obd_device *obd, struct mds_obd *mds,
-                                struct lu_fid *fid,
+                                struct ll_fid *fid,
                                 struct lustre_handle *parent_lockh,
                                 struct dentry **dparentp, int parent_mode,
                                 __u64 parent_lockpart,
@@ -1355,7 +1355,7 @@ static int mds_orphan_add_link(struct mds_update_record *rec,
         struct inode *pending_dir = mds->mds_pending_dir->d_inode;
         struct inode *inode = dentry->d_inode;
         struct dentry *pending_child;
-        char fidname[LU_FID_NAMELEN];
+        char fidname[LL_FID_NAMELEN];
         int fidlen = 0, rc, mode;
         ENTRY;
 
@@ -1366,7 +1366,7 @@ static int mds_orphan_add_link(struct mds_update_record *rec,
 #endif
         LASSERT(down_trylock(&pending_dir->i_sem) != 0);
 
-        fidlen = lu_fid2str(fidname, inode->i_ino, inode->i_generation);
+        fidlen = ll_fid2str(fidname, inode->i_ino, inode->i_generation);
 
         CDEBUG(D_INODE, "pending destroy of %dx open %d linked %s %s = %s\n",
                mds_orphan_open_count(inode), inode->i_nlink,
@@ -1831,9 +1831,9 @@ cleanup:
  */
 int mds_get_parents_children_locked(struct obd_device *obd,
                                     struct mds_obd *mds,
-                                    struct lu_fid *p1_fid,
+                                    struct ll_fid *p1_fid,
                                     struct dentry **de_srcdirp,
-                                    struct lu_fid *p2_fid,
+                                    struct ll_fid *p2_fid,
                                     struct dentry **de_tgtdirp,
                                     int parent_mode,
                                     const char *old_name, int old_len,
index 08d2510..925967a 100644 (file)
@@ -179,7 +179,7 @@ int mds_cleanup_pending(struct obd_device *obd)
         struct inode *child_inode, *pending_dir = mds->mds_pending_dir->d_inode;
         struct l_linux_dirent *dirent, *n;
         struct list_head dentry_list;
-        char d_name[LU_FID_NAMELEN];
+        char d_name[LL_FID_NAMELEN];
         unsigned long inum;
         int i = 0, rc = 0, item = 0, namlen;
         ENTRY;
index 9ab4985..694f743 100644 (file)
@@ -87,6 +87,7 @@ struct mdt_object {
 struct mdt_lock_handle {
         struct lustre_handle    mlh_lh;
         ldlm_mode_t             mlh_mode;
+        __u64                   mlh_part;
 };
 
 void mdt_lock_handle_init(struct mdt_lock_handle *lh);
@@ -131,7 +132,7 @@ struct mdt_thread_info {
         /*
          * Body for "habeo corpus" operations.
          */
-        struct mds_body       *mti_body;
+        struct mdt_body       *mti_body;
         /*
          * Host object. This is released at the end of mdt_handler().
          */
@@ -148,8 +149,11 @@ struct mdt_thread_info {
 
 };
 
-int fid_lock(const struct lu_fid *, struct lustre_handle *, ldlm_mode_t);
-void fid_unlock(const struct lu_fid *, struct lustre_handle *, ldlm_mode_t);
+int fid_lock(struct ldlm_namespace *, const struct lu_fid *, 
+             struct lustre_handle *, ldlm_mode_t, __u64);
+             
+void fid_unlock(struct ldlm_namespace *, const struct lu_fid *, 
+                struct lustre_handle *, ldlm_mode_t);
 
 #endif /* __KERNEL__ */
 #endif /* _MDT_H */
index e5915e5..dc11c06 100644 (file)
@@ -69,7 +69,7 @@ static int mdt_getstatus(struct mdt_thread_info *info,
                          struct ptlrpc_request *req, int offset)
 {
         struct md_device *mdd  = info->mti_mdt->mdt_child;
-        struct mds_body  *body;
+        struct mdt_body  *body;
         int               size = sizeof *body;
         int               result;
 
@@ -188,15 +188,49 @@ static int mdt_handle_quotactl(struct mdt_thread_info *info,
         return -EOPNOTSUPP;
 }
 
-
-int fid_lock(const struct lu_fid *f, struct lustre_handle *lh, ldlm_mode_t mode)
+/* issues dlm lock on passed @ns, @f stores it lock handle into @lh. */
+int fid_lock(struct ldlm_namespace *ns, const struct lu_fid *f, 
+             struct lustre_handle *lh, ldlm_mode_t mode, __u64 lockpart)
 {
-        return 0;
-}
-
-void fid_unlock(const struct lu_fid *f,
+        ldlm_policy_data_t policy = { .l_inodebits = { lockpart} };
+        struct ldlm_res_id res_id = { .name = {0} };
+        int flags = 0, rc;
+        ENTRY;
+        
+        LASSERT(ns != NULL);
+        LASSERT(lh != NULL);
+        LASSERT(f != NULL);
+        
+        res_id.name[0] = fid_seq(f);
+        res_id.name[1] = fid_num(f);
+        
+        /* FIXME: is that correct to have @flags=0 here? */
+        rc = ldlm_cli_enqueue(NULL, NULL, ns, res_id, LDLM_IBITS, 
+                              &policy, mode, &flags, ldlm_blocking_ast, 
+                              ldlm_completion_ast, NULL, NULL, NULL, 0, NULL, lh);
+        if (rc != ELDLM_OK)
+                RETURN(-EIO);
+        RETURN(0);
+}
+
+void fid_unlock(struct ldlm_namespace *ns, const struct lu_fid *f,
                 struct lustre_handle *lh, ldlm_mode_t mode)
 {
+        struct ldlm_lock *lock;
+        ENTRY;
+
+        /* FIXME: this is debug stuff, remove it later. */
+        lock = ldlm_handle2lock(lh);
+        if (!lock) {
+                CERROR("invalid lock handle "LPX64, lh->cookie);
+                LBUG();
+        }
+        
+        LASSERT(fid_seq(f) == lock->l_resource->lr_name.name[0] && 
+                fid_num(f) == lock->l_resource->lr_name.name[1]);
+
+        ldlm_lock_decref(lh, mode);
+        EXIT;
 }
 
 static struct lu_device_operations mdt_lu_ops;
@@ -236,18 +270,21 @@ static struct lu_fid *mdt_object_fid(struct mdt_object *o)
         return lu_object_fid(&o->mot_obj.mo_lu);
 }
 
-static int mdt_object_lock(struct mdt_object *o, struct mdt_lock_handle *lh)
+static int mdt_object_lock(struct ldlm_namespace *ns, struct mdt_object *o, 
+                           struct mdt_lock_handle *lh)
 {
         LASSERT(!lustre_handle_is_used(&lh->mlh_lh));
         LASSERT(lh->mlh_mode != LCK_MINMODE);
 
-        return fid_lock(mdt_object_fid(o), &lh->mlh_lh, lh->mlh_mode);
+        return fid_lock(ns, mdt_object_fid(o), &lh->mlh_lh, lh->mlh_mode, 
+                        lh->mlh_part);
 }
 
-static void mdt_object_unlock(struct mdt_object *o, struct mdt_lock_handle *lh)
+static void mdt_object_unlock(struct ldlm_namespace *ns, struct mdt_object *o, 
+                              struct mdt_lock_handle *lh)
 {
         if (lustre_handle_is_used(&lh->mlh_lh)) {
-                fid_unlock(mdt_object_fid(o), &lh->mlh_lh, lh->mlh_mode);
+                fid_unlock(ns, mdt_object_fid(o), &lh->mlh_lh, lh->mlh_mode);
                 lh->mlh_lh.cookie = 0;
         }
 }
@@ -261,7 +298,7 @@ struct mdt_object *mdt_object_find_lock(struct mdt_device *d, struct lu_fid *f,
         if (!IS_ERR(o)) {
                 int result;
 
-                result = mdt_object_lock(o, lh);
+                result = mdt_object_lock(d->mdt_namespace, o, lh);
                 if (result != 0) {
                         mdt_object_put(o);
                         o = ERR_PTR(result);
@@ -281,7 +318,7 @@ struct mdt_handler {
 
 enum mdt_handler_flags {
         /*
-         * struct mds_body is passed in the 0-th incoming buffer.
+         * struct mdt_body is passed in the 0-th incoming buffer.
          */
         HABEO_CORPUS = (1 << 0)
 };
@@ -346,7 +383,7 @@ static int mdt_req_handle(struct mdt_thread_info *info,
         if (h->mh_flags & HABEO_CORPUS) {
                 info->mti_body = lustre_swab_reqbuf(req, off,
                                                     sizeof *info->mti_body,
-                                                    lustre_swab_mds_body);
+                                                    lustre_swab_mdt_body);
                 if (info->mti_body == NULL) {
                         CERROR("Can't unpack body\n");
                         result = req->rq_status = -EFAULT;
@@ -838,7 +875,9 @@ int mdt_mkdir(struct mdt_thread_info *info, struct mdt_device *d,
 
         int result;
 
-        (lh = &info->mti_lh[MDT_LH_PARENT])->mlh_mode = LCK_PW;
+        lh = &info->mti_lh[MDT_LH_PARENT];
+        lh->mlh_mode = LCK_PW;
+        lh->mlh_part = MDS_INODELOCK_UPDATE;
 
         o = mdt_object_find_lock(d, pfid, lh);
         if (IS_ERR(o))
@@ -851,7 +890,7 @@ int mdt_mkdir(struct mdt_thread_info *info, struct mdt_device *d,
                 mdt_object_put(child);
         } else
                 result = PTR_ERR(child);
-        mdt_object_unlock(o, lh);
+        mdt_object_unlock(d->mdt_namespace, o, lh);
         mdt_object_put(o);
         return result;
 }
index 7c826aa..868db40 100644 (file)
@@ -48,7 +48,7 @@
 /* Look up an entry by inode number. */
 /* this function ONLY returns valid dget'd dentries with an initialized inode
    or errors */
-static struct dentry *mgs_fid2dentry(struct mgs_obd *mgs, struct lu_fid *fid)
+static struct dentry *mgs_fid2dentry(struct mgs_obd *mgs, struct ll_fid *fid)
 {
         char fid_name[32];
         unsigned long ino = fid->id;
@@ -102,7 +102,7 @@ static struct dentry *mgs_lvfs_fid2dentry(__u64 id, __u32 gen, __u64 gr,
                                           void *data)
 {
         struct obd_device *obd = data;
-        struct lu_fid fid;
+        struct ll_fid fid;
         fid.id = id;
         fid.generation = gen;
         return mgs_fid2dentry(&obd->u.mgs, &fid);
index c04c574..c1e911a 100644 (file)
@@ -77,12 +77,20 @@ void lustre_swab_llogd_conn_body (struct llogd_conn_body *d)
 }
 EXPORT_SYMBOL(lustre_swab_llogd_conn_body);
 
-void lustre_swab_lu_fid(struct lu_fid *fid)
+void lustre_swab_ll_fid(struct ll_fid *fid)
 {
         __swab64s (&fid->id);
         __swab32s (&fid->generation);
         __swab32s (&fid->f_type);
 }
+EXPORT_SYMBOL(lustre_swab_ll_fid);
+
+void lustre_swab_lu_fid(struct lu_fid *fid)
+{
+        __swab32s (&fid->f_seq);
+        __swab16s (&fid->f_wid);
+        __swab16s (&fid->f_num);
+}
 EXPORT_SYMBOL(lustre_swab_lu_fid);
 
 void lustre_swab_llog_rec(struct llog_rec_hdr *rec, struct llog_rec_tail *tail)
@@ -96,7 +104,7 @@ void lustre_swab_llog_rec(struct llog_rec_hdr *rec, struct llog_rec_tail *tail)
                 struct llog_size_change_rec *lsc =
                         (struct llog_size_change_rec *)rec;
 
-                lustre_swab_lu_fid(&lsc->lsc_fid);
+                lustre_swab_ll_fid(&lsc->lsc_fid);
                 __swab32s(&lsc->lsc_io_epoch);
 
                 break;
index 5652d28..5f76f3f 100644 (file)
@@ -174,7 +174,7 @@ static struct lu_object *htable_lookup(struct lu_site *s,
 
         hlist_for_each_entry(h, scan, bucket, loh_hash) {
                 s->ls_stats.s_cache_check ++;
-                if (lfid_eq(&h->loh_fid, f) && !lu_object_is_dying(h)) {
+                if (lu_fid_eq(&h->loh_fid, f) && !lu_object_is_dying(h)) {
                         /* bump reference count... */
                         if (h->loh_ref ++ == 0)
                                 ++ s->ls_busy;
@@ -188,9 +188,14 @@ static struct lu_object *htable_lookup(struct lu_site *s,
         return NULL;
 }
 
+/* maximal objects in sequence */
+#define FID_SEQ_WIDTH 10000
+
 static __u32 fid_hash(const struct lu_fid *f)
 {
-        return f->id + f->generation + f->f_type;
+        /* FIXME: this is proto anyway, so we do not care of getting rid 
+           of hardcoded things in it like sequence width, etc. */
+        return fid_seq(f) * FID_SEQ_WIDTH + fid_num(f);
 }
 
 struct lu_object *lu_object_find(struct lu_site *s, const struct lu_fid *f)
@@ -211,7 +216,7 @@ struct lu_object *lu_object_find(struct lu_site *s, const struct lu_fid *f)
                 return o;
 
         ++ s->ls_total;
-        LASSERT(lfid_eq(lu_object_fid(o), f));
+        LASSERT(lu_fid_eq(lu_object_fid(o), f));
 
         spin_lock(&s->ls_guard);
         shadow = htable_lookup(s, bucket, f);
index 8d03db8..9006728 100644 (file)
@@ -43,7 +43,7 @@ struct filter_client_data {
                             OBD_MD_FLATIME | OBD_MD_FLMTIME | OBD_MD_FLCTIME)
 
 struct filter_fid {
-        struct lu_fid   ff_fid;
+        struct ll_fid   ff_fid;
         __u64           ff_objid;
         __u64           ff_group;
 };
@@ -134,7 +134,7 @@ struct ost_filterdata {
         __u32  ofd_epoch;
 };
 int filter_log_sz_change(struct llog_handle *cathandle,
-                         struct lu_fid *mds_fid,
+                         struct ll_fid *mds_fid,
                          __u32 io_epoch,
                          struct llog_cookie *logcookie,
                          struct inode *inode);
index 31cc67e..0dbd077 100644 (file)
@@ -41,7 +41,7 @@
 #include "filter_internal.h"
 
 int filter_log_sz_change(struct llog_handle *cathandle,
-                         struct lu_fid *mds_fid,
+                         struct ll_fid *mds_fid,
                          __u32 io_epoch,
                          struct llog_cookie *logcookie,
                          struct inode *inode)
index 781ad54..2d9934f 100644 (file)
@@ -600,6 +600,37 @@ void lustre_swab_mds_status_req (struct mds_status_req *r)
 
 void lustre_swab_mds_body (struct mds_body *b)
 {
+        lustre_swab_ll_fid (&b->fid1);
+        lustre_swab_ll_fid (&b->fid2);
+        /* handle is opaque */
+        __swab64s (&b->valid);
+        __swab64s (&b->size);
+        __swab64s (&b->mtime);
+        __swab64s (&b->atime);
+        __swab64s (&b->ctime);
+        __swab64s (&b->blocks);
+        __swab64s (&b->io_epoch);
+        __swab64s (&b->ino);
+        __swab32s (&b->fsuid);
+        __swab32s (&b->fsgid);
+        __swab32s (&b->capability);
+        __swab32s (&b->mode);
+        __swab32s (&b->uid);
+        __swab32s (&b->gid);
+        __swab32s (&b->flags);
+        __swab32s (&b->rdev);
+        __swab32s (&b->nlink);
+        __swab32s (&b->generation);
+        __swab32s (&b->suppgid);
+        __swab32s (&b->eadatasize);
+        __swab32s (&b->aclsize);
+        __swab32s (&b->max_mdsize);
+        __swab32s (&b->max_cookiesize);
+        __swab32s (&b->padding_4);
+}
+
+void lustre_swab_mdt_body (struct mdt_body *b)
+{
         lustre_swab_lu_fid (&b->fid1);
         lustre_swab_lu_fid (&b->fid2);
         /* handle is opaque */
@@ -687,7 +718,7 @@ void lustre_swab_mds_rec_setattr (struct mds_rec_setattr *sa)
         __swab32s (&sa->sa_cap);
         __swab32s (&sa->sa_suppgid);
         __swab32s (&sa->sa_mode);
-        lustre_swab_lu_fid (&sa->sa_fid);
+        lustre_swab_ll_fid (&sa->sa_fid);
         __swab64s (&sa->sa_valid);
         __swab64s (&sa->sa_size);
         __swab64s (&sa->sa_mtime);
@@ -702,7 +733,7 @@ void lustre_swab_mds_rec_setattr (struct mds_rec_setattr *sa)
 void lustre_swab_mds_rec_join (struct mds_rec_join *jr)
 {
         __swab64s(&jr->jr_headsize);
-        lustre_swab_lu_fid(&jr->jr_fid);
+        lustre_swab_ll_fid(&jr->jr_fid);
 }
 
 void lustre_swab_mds_rec_create (struct mds_rec_create *cr)
@@ -713,8 +744,8 @@ void lustre_swab_mds_rec_create (struct mds_rec_create *cr)
         __swab32s (&cr->cr_cap);
         __swab32s (&cr->cr_flags); /* for use with open */
         __swab32s (&cr->cr_mode);
-        lustre_swab_lu_fid (&cr->cr_fid);
-        lustre_swab_lu_fid (&cr->cr_replayfid);
+        lustre_swab_ll_fid (&cr->cr_fid);
+        lustre_swab_ll_fid (&cr->cr_replayfid);
         __swab64s (&cr->cr_time);
         __swab64s (&cr->cr_rdev);
         __swab32s (&cr->cr_suppgid);
@@ -733,8 +764,8 @@ void lustre_swab_mds_rec_link (struct mds_rec_link *lk)
         __swab32s (&lk->lk_cap);
         __swab32s (&lk->lk_suppgid1);
         __swab32s (&lk->lk_suppgid2);
-        lustre_swab_lu_fid (&lk->lk_fid1);
-        lustre_swab_lu_fid (&lk->lk_fid2);
+        lustre_swab_ll_fid (&lk->lk_fid1);
+        lustre_swab_ll_fid (&lk->lk_fid2);
         __swab64s (&lk->lk_time);
         CLASSERT(offsetof(typeof(*lk), lk_padding_1) != 0);
         CLASSERT(offsetof(typeof(*lk), lk_padding_2) != 0);
@@ -750,8 +781,8 @@ void lustre_swab_mds_rec_unlink (struct mds_rec_unlink *ul)
         __swab32s (&ul->ul_cap);
         __swab32s (&ul->ul_suppgid);
         __swab32s (&ul->ul_mode);
-        lustre_swab_lu_fid (&ul->ul_fid1);
-        lustre_swab_lu_fid (&ul->ul_fid2);
+        lustre_swab_ll_fid (&ul->ul_fid1);
+        lustre_swab_ll_fid (&ul->ul_fid2);
         __swab64s (&ul->ul_time);
         CLASSERT(offsetof(typeof(*ul), ul_padding_1) != 0);
         CLASSERT(offsetof(typeof(*ul), ul_padding_2) != 0);
@@ -767,8 +798,8 @@ void lustre_swab_mds_rec_rename (struct mds_rec_rename *rn)
         __swab32s (&rn->rn_cap);
         __swab32s (&rn->rn_suppgid1);
         __swab32s (&rn->rn_suppgid2);
-        lustre_swab_lu_fid (&rn->rn_fid1);
-        lustre_swab_lu_fid (&rn->rn_fid2);
+        lustre_swab_ll_fid (&rn->rn_fid1);
+        lustre_swab_ll_fid (&rn->rn_fid2);
         __swab64s (&rn->rn_time);
         CLASSERT(offsetof(typeof(*rn), rn_padding_1) != 0);
         CLASSERT(offsetof(typeof(*rn), rn_padding_2) != 0);
@@ -1650,21 +1681,21 @@ void lustre_assert_wire_constants(void)
         LASSERTF((int)sizeof(((struct ost_body *)0)->oa) == 208, " found %lld\n",
                  (long long)(int)sizeof(((struct ost_body *)0)->oa));
 
-        /* Checks for struct lu_fid */
-        LASSERTF((int)sizeof(struct lu_fid) == 16, " found %lld\n",
-                 (long long)(int)sizeof(struct lu_fid));
-        LASSERTF((int)offsetof(struct lu_fid, id) == 0, " found %lld\n",
-                 (long long)(int)offsetof(struct lu_fid, id));
-        LASSERTF((int)sizeof(((struct lu_fid *)0)->id) == 8, " found %lld\n",
-                 (long long)(int)sizeof(((struct lu_fid *)0)->id));
-        LASSERTF((int)offsetof(struct lu_fid, generation) == 8, " found %lld\n",
-                 (long long)(int)offsetof(struct lu_fid, generation));
-        LASSERTF((int)sizeof(((struct lu_fid *)0)->generation) == 4, " found %lld\n",
-                 (long long)(int)sizeof(((struct lu_fid *)0)->generation));
-        LASSERTF((int)offsetof(struct lu_fid, f_type) == 12, " found %lld\n",
-                 (long long)(int)offsetof(struct lu_fid, f_type));
-        LASSERTF((int)sizeof(((struct lu_fid *)0)->f_type) == 4, " found %lld\n",
-                 (long long)(int)sizeof(((struct lu_fid *)0)->f_type));
+        /* Checks for struct ll_fid */
+        LASSERTF((int)sizeof(struct ll_fid) == 16, " found %lld\n",
+                 (long long)(int)sizeof(struct ll_fid));
+        LASSERTF((int)offsetof(struct ll_fid, id) == 0, " found %lld\n",
+                 (long long)(int)offsetof(struct ll_fid, id));
+        LASSERTF((int)sizeof(((struct ll_fid *)0)->id) == 8, " found %lld\n",
+                 (long long)(int)sizeof(((struct ll_fid *)0)->id));
+        LASSERTF((int)offsetof(struct ll_fid, generation) == 8, " found %lld\n",
+                 (long long)(int)offsetof(struct ll_fid, generation));
+        LASSERTF((int)sizeof(((struct ll_fid *)0)->generation) == 4, " found %lld\n",
+                 (long long)(int)sizeof(((struct ll_fid *)0)->generation));
+        LASSERTF((int)offsetof(struct ll_fid, f_type) == 12, " found %lld\n",
+                 (long long)(int)offsetof(struct ll_fid, f_type));
+        LASSERTF((int)sizeof(((struct ll_fid *)0)->f_type) == 4, " found %lld\n",
+                 (long long)(int)sizeof(((struct ll_fid *)0)->f_type));
 
         /* Checks for struct mds_status_req */
         LASSERTF((int)sizeof(struct mds_status_req) == 8, " found %lld\n",
index 744c1d0..182537e 100644 (file)
@@ -191,6 +191,7 @@ EXPORT_SYMBOL(lustre_swab_ost_last_id);
 EXPORT_SYMBOL(lustre_swab_ost_lvb);
 EXPORT_SYMBOL(lustre_swab_mds_status_req);
 EXPORT_SYMBOL(lustre_swab_mds_body);
+EXPORT_SYMBOL(lustre_swab_mdt_body);
 EXPORT_SYMBOL(lustre_swab_obd_quotactl);
 EXPORT_SYMBOL(lustre_swab_mds_rec_setattr);
 EXPORT_SYMBOL(lustre_swab_mds_rec_create);
index ba8c00a..69e5aef 100644 (file)
@@ -287,13 +287,13 @@ check_ost_body(void)
 }
 
 static void
-check_lu_fid(void)
+check_ll_fid(void)
 {
         BLANK_LINE();
-        CHECK_STRUCT(lu_fid);
-        CHECK_MEMBER(lu_fid, id);
-        CHECK_MEMBER(lu_fid, generation);
-        CHECK_MEMBER(lu_fid, f_type);
+        CHECK_STRUCT(ll_fid);
+        CHECK_MEMBER(ll_fid, id);
+        CHECK_MEMBER(ll_fid, generation);
+        CHECK_MEMBER(ll_fid, f_type);
 }
 
 static void
@@ -975,7 +975,7 @@ main(int argc, char **argv)
         check_obd_quotactl();
         check_niobuf_remote();
         check_ost_body();
-        check_lu_fid();
+        check_ll_fid();
         check_mds_status_req();
         check_mds_body();
         check_mds_rec_setattr();
index 45070e0..a44712c 100644 (file)
@@ -722,21 +722,21 @@ void lustre_assert_wire_constants(void)
         LASSERTF((int)sizeof(((struct ost_body *)0)->oa) == 208, " found %lld\n",
                  (long long)(int)sizeof(((struct ost_body *)0)->oa));
 
-        /* Checks for struct lu_fid */
-        LASSERTF((int)sizeof(struct lu_fid) == 16, " found %lld\n",
-                 (long long)(int)sizeof(struct lu_fid));
-        LASSERTF((int)offsetof(struct lu_fid, id) == 0, " found %lld\n",
-                 (long long)(int)offsetof(struct lu_fid, id));
-        LASSERTF((int)sizeof(((struct lu_fid *)0)->id) == 8, " found %lld\n",
-                 (long long)(int)sizeof(((struct lu_fid *)0)->id));
-        LASSERTF((int)offsetof(struct lu_fid, generation) == 8, " found %lld\n",
-                 (long long)(int)offsetof(struct lu_fid, generation));
-        LASSERTF((int)sizeof(((struct lu_fid *)0)->generation) == 4, " found %lld\n",
-                 (long long)(int)sizeof(((struct lu_fid *)0)->generation));
-        LASSERTF((int)offsetof(struct lu_fid, f_type) == 12, " found %lld\n",
-                 (long long)(int)offsetof(struct lu_fid, f_type));
-        LASSERTF((int)sizeof(((struct lu_fid *)0)->f_type) == 4, " found %lld\n",
-                 (long long)(int)sizeof(((struct lu_fid *)0)->f_type));
+        /* Checks for struct ll_fid */
+        LASSERTF((int)sizeof(struct ll_fid) == 16, " found %lld\n",
+                 (long long)(int)sizeof(struct ll_fid));
+        LASSERTF((int)offsetof(struct ll_fid, id) == 0, " found %lld\n",
+                 (long long)(int)offsetof(struct ll_fid, id));
+        LASSERTF((int)sizeof(((struct ll_fid *)0)->id) == 8, " found %lld\n",
+                 (long long)(int)sizeof(((struct ll_fid *)0)->id));
+        LASSERTF((int)offsetof(struct ll_fid, generation) == 8, " found %lld\n",
+                 (long long)(int)offsetof(struct ll_fid, generation));
+        LASSERTF((int)sizeof(((struct ll_fid *)0)->generation) == 4, " found %lld\n",
+                 (long long)(int)sizeof(((struct ll_fid *)0)->generation));
+        LASSERTF((int)offsetof(struct ll_fid, f_type) == 12, " found %lld\n",
+                 (long long)(int)offsetof(struct ll_fid, f_type));
+        LASSERTF((int)sizeof(((struct ll_fid *)0)->f_type) == 4, " found %lld\n",
+                 (long long)(int)sizeof(((struct ll_fid *)0)->f_type));
 
         /* Checks for struct mds_status_req */
         LASSERTF((int)sizeof(struct mds_status_req) == 8, " found %lld\n",