- 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.
#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 */
* 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;
}
#define MDS_BFLAG_UNCOMMITTED_WRITES 0x1
-struct mds_body {
+struct mdt_body {
struct lu_fid fid1;
struct lu_fid fid2;
struct lustre_handle handle;
__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 */
__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;
__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;
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;
};
__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 */
__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 */
__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 */
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;
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;
};
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;
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;
/* 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);
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 *,
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);
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,
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);
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;
#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>
}
#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);
}
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;
__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;
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;
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;
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;
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) \
#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;
}
}
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;
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;
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;
{
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;
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 &
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 };
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,
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)) {
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
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);
}
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;
*/
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;
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;
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;
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;
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;
--- /dev/null
+/* -*- 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);
+}
+
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
struct inode lli_vfs_inode;
#endif
+
+ /* inode fid */
+ struct lu_fid lli_fid;
};
/*
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 */
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);
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 */
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, };
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;
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);
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;
switch(cmd) {
case EXT3_IOC_GETFLAGS: {
- struct lu_fid fid;
+ struct ll_fid fid;
struct mds_body *body;
ll_inode2fid(&fid, inode);
}
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;
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),
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;
{
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);
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,
{
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;
{
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;
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;
#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,
#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;
}
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));
}
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} };
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;
}
/* 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);
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)
{
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)
{
}
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)
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,
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)
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);
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;
}
/* 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)
/* 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];
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);
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);
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;
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);
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;
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);
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,
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,
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,
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;
#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;
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);
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;
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));
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;
}
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,
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;
#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,
*/
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,
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;
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);
/*
* 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().
*/
};
-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 */
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;
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;
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;
}
}
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);
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)
};
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;
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))
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;
}
/* 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;
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);
}
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)
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;
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;
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)
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);
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;
};
__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);
#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)
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 */
__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);
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)
__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);
__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);
__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);
__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);
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",
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);
}
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
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();
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",