#define CFS_ALLOC_PTR(ptr) LIBCFS_ALLOC(ptr, sizeof (*(ptr)));
#define CFS_FREE_PTR(ptr) LIBCFS_FREE(ptr, sizeof (*(ptr)));
-/** Compile-time assertion.
+/** Compile-time assertion.
* Check an invariant described by a constant expression at compile time by
* forcing a compiler error if it does not hold. \a cond must be a constant
static int hf_lustre_ptlrpc_body_pb_flags = -1;
static int hf_lustre_obd_statfs_os_spare4 = -1;
static int hf_lustre_obd_connect_data_ocd_group = -1;
-static int hf_lustre_lov_ost_data_v1_l_object_seq = -1;
-static int hf_lustre_lov_mds_md_v1_lmm_object_seq = -1;
+static int hf_lustre_lov_ost_data_v1_l_object_gr = -1;
+static int hf_lustre_lov_mds_md_v1_lmm_object_gr = -1;
static int hf_lustre_obd_connect_data_ocd_brw_size = -1;
static int hf_lustre_ptlrpc_body_pb_limit = -1;
static int hf_lustre_obd_statfs_os_maxbytes = -1;
static int hf_lustre_obd_connect_data_padding1 = -1;
static int hf_lustre_lov_ost_data_v1_l_ost_idx = -1;
static int hf_lustre_obd_connect_data_padding2 = -1;
-static int hf_lustre_obd_ioobj_ioo_seq = -1;
+static int hf_lustre_obd_ioobj_ioo_gr = -1;
static int hf_lustre_niobuf_remote_offset=-1;
static int hf_lustre_mds_status_req_repbuf = -1;
static int hf_lustre_obd_statfs_os_spare2 = -1;
static int hf_lustre_mds_rec_unlink_ul_time = -1;
static int hf_lustre_llog_create_rec_lcr_tail = -1;
static int hf_lustre_mds_rec_setattr_sa_mode = -1;
-static int hf_lustre_llog_logid_lgl_oseq = -1;
+static int hf_lustre_llog_logid_lgl_ogr = -1;
static int hf_lustre_llog_create_rec_lcr_hdr = -1;
static int hf_lustre_llog_cookie_lgc_padding = -1;
static int hf_lustre_mds_rec_create_cr_cap = -1;
static int hf_lustre_qunit_data_padding = -1;
static int hf_lustre_quota_adjust_qunit_qaq_flags = -1;
static int hf_lustre_ldlm_lock_desc_l_granted_mode = -1;
-static int hf_lustre_obdo_o_seq = -1;
+static int hf_lustre_obdo_o_gr = -1;
static int hf_lustre_mds_rec_unlink_ul_padding_2 = -1;
static int hf_lustre_obdo_o_gid = -1;
static int hf_lustre_llog_catid_lci_logid = -1;
static int hf_lustre_llogd_conn_body_lgdc_ctxt_idx = -1;
static int hf_lustre_cfg_marker_cm_canceltime = -1;
static int hf_lustre_mgs_target_info_mti_lustre_ver = -1;
-static int hf_lustre_obdo_o_parent_ver = -1;
+static int hf_lustre_obdo_o_padding_1 = -1;
static int hf_lustre_qunit_data_qd_flags = -1;
static int hf_lustre_llog_logid_rec_lid_id = -1;
-static int hf_lustre_obdo_o_parent_oid = -1;
+static int hf_lustre_obdo_o_generation = -1;
static int hf_lustre_llog_gen_mnt_cnt = -1;
static int hf_lustre_llog_size_change_rec_lsc_tail = -1;
static int hf_lustre_obdo_o_padding_5 = -1;
static int hf_lustre_ldlm_lock_desc_l_resource = -1;
static int hf_lustre_mds_rec_rename_rn_time = -1;
static int hf_lustre_mds_rec_create_cr_rdev = -1;
-static int hf_lustre_obdo_o_parent_seq = -1;
+static int hf_lustre_obdo_o_fid = -1;
static int hf_lustre_mds_rec_setattr_sa_fid = -1;
static int hf_lustre_ldlm_request_lock_count = -1;
static int hf_lustre_ldlm_flock_end = -1;
/* IDL: struct lov_ost_data_v1 { */
/* IDL: uint64 l_object_id; */
-/* IDL: uint64 l_object_seq; */
+/* IDL: uint64 l_object_gr; */
/* IDL: uint32 l_ost_gen; */
/* IDL: uint32 l_ost_idx; */
/* IDL: } */
}
static int
-lustre_dissect_element_lov_ost_data_v1_l_object_seq(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
+lustre_dissect_element_lov_ost_data_v1_l_object_gr(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
{
- offset=dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_lov_ost_data_v1_l_object_seq);
+ offset=dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_lov_ost_data_v1_l_object_gr);
return offset;
}
offset=lustre_dissect_element_lov_ost_data_v1_l_object_id(tvb, offset, pinfo, tree);
- offset=lustre_dissect_element_lov_ost_data_v1_l_object_seq(tvb, offset, pinfo, tree);
+ offset=lustre_dissect_element_lov_ost_data_v1_l_object_gr(tvb, offset, pinfo, tree);
offset=lustre_dissect_element_lov_ost_data_v1_l_ost_gen(tvb, offset, pinfo, tree);
/* IDL: uint32 lmm_magic; */
/* IDL: uint32 lmm_pattern; */
/* IDL: uint64 lmm_object_id; */
-/* IDL: uint64 lmm_object_seq; */
+/* IDL: uint64 lmm_object_gr; */
/* IDL: uint32 lmm_stripe_size; */
/* IDL: uint32 lmm_stripe_count; */
/* IDL: struct lov_ost_data_v1 { */
}
static int
-lustre_dissect_element_lov_mds_md_v1_lmm_object_seq(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
+lustre_dissect_element_lov_mds_md_v1_lmm_object_gr(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
{
- offset=dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_lov_mds_md_v1_lmm_object_seq);
+ offset=dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_lov_mds_md_v1_lmm_object_gr);
return offset;
}
offset=lustre_dissect_element_lov_mds_md_v1_lmm_object_id(tvb, offset, pinfo, tree);
- offset=lustre_dissect_element_lov_mds_md_v1_lmm_object_seq(tvb, offset, pinfo, tree);
+ offset=lustre_dissect_element_lov_mds_md_v1_lmm_object_gr(tvb, offset, pinfo, tree);
offset=lustre_dissect_element_lov_mds_md_v1_lmm_stripe_size(tvb, offset, pinfo, tree);
/* IDL: struct obd_ioobj { */
/* IDL: uint64 ioo_id; */
-/* IDL: uint64 ioo_seq; */
+/* IDL: uint64 ioo_gr; */
/* IDL: uint32 ioo_type; */
/* IDL: uint32 ioo_bufcnt; */
/* IDL: } */
}
static int
-lustre_dissect_element_obd_ioobj_ioo_seq(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
+lustre_dissect_element_obd_ioobj_ioo_gr(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
{
- offset=dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_obd_ioobj_ioo_seq);
+ offset=dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_obd_ioobj_ioo_gr);
return offset;
}
offset=lustre_dissect_element_obd_ioobj_ioo_id(tvb, offset, pinfo, tree);
- offset=lustre_dissect_element_obd_ioobj_ioo_seq(tvb, offset, pinfo, tree);
+ offset=lustre_dissect_element_obd_ioobj_ioo_gr(tvb, offset, pinfo, tree);
offset=lustre_dissect_element_obd_ioobj_ioo_type(tvb, offset, pinfo, tree);
/* IDL: struct llog_logid { */
/* IDL: uint64 lgl_oid; */
-/* IDL: uint64 lgl_oseq; */
+/* IDL: uint64 lgl_ogr; */
/* IDL: uint32 lgl_ogen; */
/* IDL: } */
}
static int
-lustre_dissect_element_llog_logid_lgl_oseq(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
+lustre_dissect_element_llog_logid_lgl_ogr(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
{
- offset=dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_llog_logid_lgl_oseq);
+ offset=dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_llog_logid_lgl_ogr);
return offset;
}
offset=lustre_dissect_element_llog_logid_lgl_oid(tvb, offset, pinfo, tree);
- offset=lustre_dissect_element_llog_logid_lgl_oseq(tvb, offset, pinfo, tree);
+ offset=lustre_dissect_element_llog_logid_lgl_ogr(tvb, offset, pinfo, tree);
offset=lustre_dissect_element_llog_logid_lgl_ogen(tvb, offset, pinfo, tree);
/* IDL: struct obdo { */
/* IDL: uint64 o_valid; */
/* IDL: uint64 o_id; */
-/* IDL: uint64 o_seq; */
-/* IDL: uint64 o_parent_seq; */
+/* IDL: uint64 o_gr; */
+/* IDL: uint64 o_fid; */
/* IDL: uint64 o_size; */
/* IDL: uint64 o_mtime; */
/* IDL: uint64 o_atime; */
/* IDL: uint32 o_gid; */
/* IDL: uint32 o_flags; */
/* IDL: uint32 o_nlink; */
-/* IDL: uint32 o_parent_oid; */
+/* IDL: uint32 o_generation; */
/* IDL: uint32 o_misc; */
/* IDL: uint64 o_ioepoch; */
/* IDL: uint32 o_stripe_idx; */
-/* IDL: uint32 o_parent_ver; */
+/* IDL: uint32 o_padding_1; */
/* IDL: struct lustre_handle { */
/* IDL: } o_handle; */
/* IDL: struct llog_cookie { */
}
static int
-lustre_dissect_element_obdo_o_seq(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
+lustre_dissect_element_obdo_o_gr(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
{
- offset=dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_obdo_o_seq);
+ offset=dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_obdo_o_gr);
return offset;
}
static int
-lustre_dissect_element_obdo_o_parent_seq(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
+lustre_dissect_element_obdo_o_fid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
{
- offset=dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_obdo_o_parent_seq);
+ offset=dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_obdo_o_fid);
return offset;
}
}
static int
-lustre_dissect_element_obdo_o_parent_oid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
+lustre_dissect_element_obdo_o_generation(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
{
- offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_obdo_o_parent_oid);
+ offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_obdo_o_generation);
return offset;
}
}
static int
-lustre_dissect_element_obdo_o_parent_ver(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
+lustre_dissect_element_obdo_o_padding_1(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
{
- offset=dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_obdo_o_parent_ver);
+ offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_obdo_o_padding_1);
return offset;
}
offset=lustre_dissect_element_obdo_o_id(tvb, offset, pinfo, tree);
- offset=lustre_dissect_element_obdo_o_seq(tvb, offset, pinfo, tree);
+ offset=lustre_dissect_element_obdo_o_gr(tvb, offset, pinfo, tree);
- offset=lustre_dissect_element_obdo_o_parent_seq(tvb, offset, pinfo, tree);
+ offset=lustre_dissect_element_obdo_o_fid(tvb, offset, pinfo, tree);
offset=lustre_dissect_element_obdo_o_size(tvb, offset, pinfo, tree);
offset=lustre_dissect_element_obdo_o_nlink(tvb, offset, pinfo, tree);
- offset=lustre_dissect_element_obdo_o_parent_oid(tvb, offset, pinfo, tree);
+ offset=lustre_dissect_element_obdo_o_generation(tvb, offset, pinfo, tree);
offset=lustre_dissect_element_obdo_o_misc(tvb, offset, pinfo, tree);
offset=lustre_dissect_element_obdo_o_stripe_idx(tvb, offset, pinfo, tree);
- offset=lustre_dissect_element_obdo_o_parent_ver(tvb, offset, pinfo, tree);
+ offset=lustre_dissect_element_obdo_o_padding_1(tvb, offset, pinfo, tree);
offset=lustre_dissect_element_obdo_o_handle(tvb, offset, pinfo, tree);
{ "Os Spare4", "lustre.obd_statfs.os_spare4", FT_UINT32, BASE_DEC, NULL, 0, "", HFILL }},
{ &hf_lustre_obd_connect_data_ocd_group,
{ "Ocd Group", "lustre.obd_connect_data.ocd_group", FT_UINT32, BASE_DEC, NULL, 0, "", HFILL }},
- { &hf_lustre_lov_ost_data_v1_l_object_seq,
- { "L Object SEQ", "lustre.lov_ost_data_v1.l_object_seq", FT_UINT64, BASE_DEC, NULL, 0, "", HFILL }},
- { &hf_lustre_lov_mds_md_v1_lmm_object_seq,
- { "Lmm Object SEQ", "lustre.lov_mds_md_v1.lmm_object_seq", FT_UINT64, BASE_DEC, NULL, 0, "", HFILL }},
+ { &hf_lustre_lov_ost_data_v1_l_object_gr,
+ { "L Object Gr", "lustre.lov_ost_data_v1.l_object_gr", FT_UINT64, BASE_DEC, NULL, 0, "", HFILL }},
+ { &hf_lustre_lov_mds_md_v1_lmm_object_gr,
+ { "Lmm Object Gr", "lustre.lov_mds_md_v1.lmm_object_gr", FT_UINT64, BASE_DEC, NULL, 0, "", HFILL }},
{ &hf_lustre_obd_connect_data_ocd_brw_size,
{ "Ocd Brw Size", "lustre.obd_connect_data.ocd_brw_size", FT_UINT32, BASE_DEC, NULL, 0, "", HFILL }},
{ &hf_lustre_ptlrpc_body_pb_limit,
{ "L Ost Idx", "lustre.lov_ost_data_v1.l_ost_idx", FT_UINT32, BASE_DEC, NULL, 0, "", HFILL }},
{ &hf_lustre_obd_connect_data_padding2,
{ "Padding2", "lustre.obd_connect_data.padding2", FT_UINT64, BASE_DEC, NULL, 0, "", HFILL }},
- { &hf_lustre_obd_ioobj_ioo_seq,
- { "Ioo Gr", "lustre.obd_ioobj.ioo_seq", FT_UINT64, BASE_DEC, NULL, 0, "", HFILL }},
+ { &hf_lustre_obd_ioobj_ioo_gr,
+ { "Ioo Gr", "lustre.obd_ioobj.ioo_gr", FT_UINT64, BASE_DEC, NULL, 0, "", HFILL }},
{ &hf_lustre_niobuf_remote_offset,
{ "Offset", "lustre.niobuf_remote.offset", FT_UINT64, BASE_DEC, NULL, 0, "", HFILL }},
{ &hf_lustre_mds_status_req_repbuf,
{ "Lcr Tail", "lustre.llog_create_rec.lcr_tail", FT_NONE, BASE_HEX, NULL, 0, "", HFILL }},
{ &hf_lustre_mds_rec_setattr_sa_mode,
{ "Sa Mode", "lustre.mds_rec_setattr.sa_mode", FT_UINT32, BASE_DEC, NULL, 0, "", HFILL }},
- { &hf_lustre_llog_logid_lgl_oseq,
- { "Lgl SEQ", "lustre.llog_logid.lgl_oseq", FT_UINT64, BASE_DEC, NULL, 0, "", HFILL }},
+ { &hf_lustre_llog_logid_lgl_ogr,
+ { "Lgl Ogr", "lustre.llog_logid.lgl_ogr", FT_UINT64, BASE_DEC, NULL, 0, "", HFILL }},
{ &hf_lustre_llog_create_rec_lcr_hdr,
{ "Lcr Hdr", "lustre.llog_create_rec.lcr_hdr", FT_NONE, BASE_HEX, NULL, 0, "", HFILL }},
{ &hf_lustre_llog_cookie_lgc_padding,
{ "Qaq Flags", "lustre.quota_adjust_qunit.qaq_flags", FT_UINT32, BASE_DEC, NULL, 0, "", HFILL }},
{ &hf_lustre_ldlm_lock_desc_l_granted_mode,
{ "L Granted Mode", "lustre.ldlm_lock_desc.l_granted_mode", FT_UINT16, BASE_DEC, VALS(lustre_ldlm_mode_t_vals), 0, "", HFILL }},
- { &hf_lustre_obdo_o_seq,
- { "O SEQ", "lustre.obdo.o_seq", FT_UINT64, BASE_DEC, NULL, 0, "", HFILL }},
+ { &hf_lustre_obdo_o_gr,
+ { "O Gr", "lustre.obdo.o_gr", FT_UINT64, BASE_DEC, NULL, 0, "", HFILL }},
{ &hf_lustre_mds_rec_unlink_ul_padding_2,
{ "Ul Padding 2", "lustre.mds_rec_unlink.ul_padding_2", FT_UINT32, BASE_DEC, NULL, 0, "", HFILL }},
{ &hf_lustre_obdo_o_gid,
{ "Cm Canceltime", "lustre.cfg_marker.cm_canceltime",FT_ABSOLUTE_TIME, BASE_DEC, NULL, 0, "", HFILL }},
{ &hf_lustre_mgs_target_info_mti_lustre_ver,
{ "Mti Lustre Ver", "lustre.mgs_target_info.mti_lustre_ver", FT_UINT32, BASE_DEC, NULL, 0, "", HFILL }},
- { &hf_lustre_obdo_o_parent_ver,
- { "O Parent VER", "lustre.obdo.o_parent_ver", FT_UINT32, BASE_HEX, NULL, 0, "", HFILL }},
+ { &hf_lustre_obdo_o_padding_1,
+ { "O Padding 1", "lustre.obdo.o_padding_1", FT_UINT32, BASE_DEC, NULL, 0, "", HFILL }},
{ &hf_lustre_qunit_data_qd_flags,
{ "Qd Flags", "lustre.qunit_data.qd_flags", FT_UINT32, BASE_DEC, NULL, 0, "", HFILL }},
{ &hf_lustre_llog_logid_rec_lid_id,
{ "Lid Id", "lustre.llog_logid_rec.lid_id", FT_NONE, BASE_HEX, NULL, 0, "", HFILL }},
- { &hf_lustre_obdo_o_parent_oid,
- { "O Parent OID", "lustre.obdo.o_parent_oid", FT_UINT32, BASE_HEX, NULL, 0, "", HFILL }},
+ { &hf_lustre_obdo_o_generation,
+ { "O Generation", "lustre.obdo.o_generation", FT_UINT32, BASE_DEC, NULL, 0, "", HFILL }},
{ &hf_lustre_llog_gen_mnt_cnt,
{ "Mnt Cnt", "lustre.llog_gen.mnt_cnt", FT_UINT64, BASE_DEC, NULL, 0, "", HFILL }},
{ &hf_lustre_llog_size_change_rec_lsc_tail,
{ "Rn Time", "lustre.mds_rec_rename.rn_time",FT_ABSOLUTE_TIME, BASE_DEC, NULL, 0, "", HFILL }},
{ &hf_lustre_mds_rec_create_cr_rdev,
{ "Cr Rdev", "lustre.mds_rec_create.cr_rdev", FT_UINT64, BASE_DEC, NULL, 0, "", HFILL }},
- { &hf_lustre_obdo_o_parent_seq,
- { "O Parent SEQ", "lustre.obdo.o_parent_seq", FT_UINT64, BASE_HEX, NULL, 0, "", HFILL }},
+ { &hf_lustre_obdo_o_fid,
+ { "O Fid", "lustre.obdo.o_fid", FT_UINT64, BASE_DEC, NULL, 0, "", HFILL }},
{ &hf_lustre_mds_rec_setattr_sa_fid,
{ "Sa Fid", "lustre.mds_rec_setattr.sa_fid", FT_NONE, BASE_HEX, NULL, 0, "", HFILL }},
{ &hf_lustre_ldlm_request_lock_count,
__u32 lmm_magic;
__u32 lmm_pattern;
__u64 lmm_object_id;
- __u64 lmm_object_seq;
+ __u64 lmm_object_gr;
__u32 lmm_stripe_size;
__u16 lmm_stripe_count;
__u16 lmm_stripe_offset;
__u32 lmm_magic;
__u32 lmm_pattern;
__u64 lmm_object_id;
- __u64 lmm_object_seq;
+ __u64 lmm_object_gr;
__u32 lmm_stripe_size;
__u16 lmm_stripe_count;
__u16 lmm_stripe_offset;
.nf
struct lov_user_ost_data_v1 {
__u64 l_object_id;
- __u64 l_object_seq;
+ __u64 l_object_gr;
__u32 l_ost_gen;
__u32 l_ost_idx;
} __attribute__((packed));
.I l_object_id
holds the OST object id.
.TP 20
-.I l_object_seq
+.I l_object_gr
holds the OST object group.
.TP 20
.I l_ost_gen
site = req->rq_export->exp_obd->obd_lu_dev->ld_site;
LASSERT(site != NULL);
-
+
rc = req_capsule_server_pack(info->sti_pill);
if (rc)
RETURN(err_serious(rc));
static const struct lu_seq_range IGIF_FLD_RANGE = {
.lsr_start = 1,
- .lsr_end = FID_SEQ_IDIF,
+ .lsr_end = IDIF_SEQ_START,
.lsr_mdt = 0
};
*
* @{
*/
-#include <fcntl.h>
-#include <sys/queue.h>
#ifdef __KERNEL__
#error Kernel files should not #include <liblustre.h>
#define OFFSET_MAX INT_LIMIT(loff_t)
#endif
-#define i_atime i_stbuf.st_atime
-#define i_mtime i_stbuf.st_mtime
-#define i_ctime i_stbuf.st_ctime
-#define i_size i_stbuf.st_size
-#define i_blocks i_stbuf.st_blocks
-#define i_blksize i_stbuf.st_blksize
-#define i_mode i_stbuf.st_mode
-#define i_uid i_stbuf.st_uid
-#define i_gid i_stbuf.st_gid
-
/* XXX: defined in kernel */
#define FL_POSIX 1
#define FL_SLEEP 128
{
}
-#define S_IRWXUGO (S_IRWXU|S_IRWXG|S_IRWXO)
-#define S_IALLUGO (S_ISUID|S_ISGID|S_ISVTX|S_IRWXUGO)
-
#include <obd_support.h>
#include <lustre/lustre_idl.h>
#include <lustre_lib.h>
/* obdo.c */
#ifdef __KERNEL__
+void obdo_from_inode(struct obdo *dst, struct inode *src, obd_flag valid);
void obdo_from_la(struct obdo *dst, struct lu_attr *la, obd_flag valid);
void obdo_refresh_inode(struct inode *dst, struct obdo *src, obd_flag valid);
void obdo_to_inode(struct inode *dst, struct obdo *src, obd_flag valid);
-#define ll_inode_flags(inode) (inode->i_flags)
#endif
-
#if !defined(__KERNEL__)
#define to_kdev_t(dev) dev
#define kdev_t_to_nr(dev) dev
typedef __u32 mdsno_t;
typedef __u64 seqno_t;
-typedef __u64 obd_id;
-typedef __u64 obd_seq;
-typedef __u64 obd_time;
-typedef __u64 obd_size;
-typedef __u64 obd_off;
-typedef __u64 obd_blocks;
-typedef __u64 obd_valid;
-typedef __u32 obd_blksize;
-typedef __u32 obd_mode;
-typedef __u32 obd_uid;
-typedef __u32 obd_gid;
-typedef __u32 obd_flag;
-typedef __u32 obd_count;
/**
* Describes a range of sequence, lsr_start is included but lsr_end is
}
};
-/* This is the maximum number of MDTs allowed in CMD testing until such
- * a time that FID-on-OST is implemented. This is due to the limitations
- * of packing non-0-MDT numbers into the FID SEQ namespace. Once FID-on-OST
- * is implemented this limit will be virtually unlimited. */
-#define MAX_MDT_COUNT 8
-
/**
* fid constants
memset(fid, 0, sizeof(*fid));
}
-static inline obd_id fid_ver_oid(const struct lu_fid *fid)
-{
- return ((__u64)fid_ver(fid) << 32 | fid_oid(fid));
-}
-
-/**
- * Different FID Format
- * http://arch.lustre.org/index.php?title=Interoperability_fids_zfs#NEW.0
- */
-enum fid_seq {
- FID_SEQ_OST_MDT0 = 0,
- FID_SEQ_LLOG = 1,
- FID_SEQ_ECHO = 2,
- FID_SEQ_OST_MDT1 = 3,
- FID_SEQ_OST_MAX = 9, /* Max MDT count before OST_on_FID */
- FID_SEQ_RSVD = 11,
- FID_SEQ_IGIF = 12,
- FID_SEQ_IGIF_MAX = 0x0ffffffffULL,
- FID_SEQ_IDIF = 0x100000000ULL,
- FID_SEQ_IDIF_MAX = 0x1ffffffffULL,
- /* Normal FID sequence starts from this value, i.e. 1<<33 */
- FID_SEQ_START = 0x200000000ULL,
- FID_SEQ_LOCAL_FILE = 0x200000001ULL,
- FID_SEQ_DOT_LUSTRE = 0x200000002ULL,
- FID_SEQ_NORMAL = 0x200000400ULL
-};
-
-#define OBIF_OID_MAX_BITS 32
-#define OBIF_MAX_OID (1ULL << OBIF_OID_MAX_BITS)
-#define OBIF_OID_MASK ((1ULL << OBIF_OID_MAX_BITS) - 1)
-#define IDIF_OID_MAX_BITS 48
-#define IDIF_MAX_OID (1ULL << IDIF_OID_MAX_BITS)
-#define IDIF_OID_MASK ((1ULL << IDIF_OID_MAX_BITS) - 1)
-
-
-static inline int fid_seq_is_mdt0(obd_seq seq)
-{
- return (seq == FID_SEQ_OST_MDT0);
-}
-
-static inline int fid_seq_is_cmd(const __u64 seq)
-{
- return (seq >= FID_SEQ_OST_MDT1 && seq <= FID_SEQ_OST_MAX);
-};
+/* Normal FID sequence starts from this value, i.e. 1<<33 */
+#define FID_SEQ_START 0x200000000ULL
-static inline int fid_seq_is_mdt(const __u64 seq)
-{
- return seq == FID_SEQ_OST_MDT0 ||
- (seq >= FID_SEQ_OST_MDT1 && seq <= FID_SEQ_OST_MAX);
-};
-
-static inline int fid_seq_is_rsvd(const __u64 seq)
-{
- return seq <= FID_SEQ_RSVD;
-};
-
-static inline int fid_is_mdt0(const struct lu_fid *fid)
-{
- return fid_seq_is_mdt0(fid_seq(fid));
-}
+/* IDIF sequence starts from this value, i.e. 1<<32 */
+#define IDIF_SEQ_START 0x100000000ULL
/**
* Check if a fid is igif or not.
* \param fid the fid to be tested.
* \return true if the fid is a igif; otherwise false.
*/
-static inline int fid_seq_is_igif(const __u64 seq)
-{
- return seq >= FID_SEQ_IGIF && seq <= FID_SEQ_IGIF_MAX;
-}
-
static inline int fid_is_igif(const struct lu_fid *fid)
{
- return fid_seq_is_igif(fid_seq(fid));
+ return fid_seq(fid) > 0 && fid_seq(fid) < IDIF_SEQ_START;
}
/**
* \param fid the fid to be tested.
* \return true if the fid is a idif; otherwise false.
*/
-static inline int fid_seq_is_idif(const __u64 seq)
-{
- return seq >= FID_SEQ_IDIF && seq <= FID_SEQ_IDIF_MAX;
-}
-
static inline int fid_is_idif(const struct lu_fid *fid)
{
- return fid_seq_is_igif(fid_seq(fid));
-}
-
-struct ost_id {
- obd_id oi_id;
- obd_seq oi_seq;
-};
-
-static inline int fid_seq_is_norm(const __u64 seq)
-{
- return (seq >= FID_SEQ_NORMAL);
-}
-
-static inline int fid_is_norm(const struct lu_fid *fid)
-{
- return fid_seq_is_norm(fid_seq(fid));
-}
-
-/* convert an OST objid into an IDIF FID SEQ number */
-static inline obd_seq fid_idif_seq(obd_id id, __u32 ost_idx)
-{
- return FID_SEQ_IDIF | (ost_idx << 16) | ((id >> 32) & 0xffff);
-}
-
-/* convert a packed IDIF FID into an OST objid */
-static inline obd_id fid_idif_id(obd_seq seq, __u32 oid, __u32 ver)
-{
- return ((__u64)ver << 48) | ((seq & 0xffff) << 32) | oid;
-}
-
-/* unpack an ostid (id/seq) from a wire/disk structure into an IDIF FID */
-static inline void ostid_idif_unpack(struct ost_id *ostid,
- struct lu_fid *fid, __u32 ost_idx)
-{
- fid->f_seq = fid_idif_seq(ostid->oi_id, ost_idx);
- fid->f_oid = ostid->oi_id; /* truncate to 32 bits by assignment */
- fid->f_ver = ostid->oi_id >> 48; /* in theory, not currently used */
-}
-
-/* unpack an ostid (id/seq) from a wire/disk structure into a non-IDIF FID */
-static inline void ostid_fid_unpack(struct ost_id *ostid, struct lu_fid *fid)
-{
- fid->f_seq = ostid->oi_seq;
- fid->f_oid = ostid->oi_id; /* truncate to 32 bits by assignment */
- fid->f_ver = ostid->oi_id >> 32; /* in theory, not currently used */
-}
-
-/* Unpack an OST object id/seq (group) into a FID. This is needed for
- * converting all obdo, lmm, lsm, etc. 64-bit id/seq pairs into proper
- * FIDs. Note that if an id/seq is already in FID/IDIF format it will
- * be passed through unchanged. Only legacy OST objects in "group 0"
- * will be mapped into the IDIF namespace so that they can fit into the
- * struct lu_fid fields without loss. For reference see:
- * http://arch.lustre.org/index.php?title=Interoperability_fids_zfs
- */
-static inline int fid_ostid_unpack(struct lu_fid *fid, struct ost_id *ostid,
- __u32 ost_idx)
-{
- if (ost_idx > 0xffff) {
- CERROR("bad ost_idx, seq:"LPU64" id:"LPU64" ost_idx:%u\n",
- ostid->oi_seq, ostid->oi_id, ost_idx);
- return -EBADF;
- }
-
- if (fid_seq_is_mdt0(ostid->oi_seq)) {
- /* This is a "legacy" (old 1.x/2.early) OST object in "group 0"
- * that we map into the IDIF namespace. It allows up to 2^48
- * objects per OST, as this is the object namespace that has
- * been in production for years. This can handle create rates
- * of 1M objects/s/OST for 9 years, or combinations thereof. */
- if (ostid->oi_id >= IDIF_MAX_OID) {
- CERROR("bad MDT0 id, seq:"LPU64" id:"LPU64" ost_idx:%u\n",
- ostid->oi_seq, ostid->oi_id, ost_idx);
- return -EBADF;
- }
- ostid_idif_unpack(ostid, fid, ost_idx);
-
- } else if (fid_seq_is_rsvd(ostid->oi_seq)) {
- /* These are legacy OST objects for LLOG/ECHO and CMD testing.
- * We only support 2^32 objects in these groups, and cannot
- * uniquely identify them in the system (i.e. they are the
- * duplicated on all OSTs), but this is not strictly required
- * for the old object protocol, which has a separate ost_idx. */
- if (ostid->oi_id >= 0xffffffffULL) {
- CERROR("bad RSVD id, seq:"LPU64" id:"LPU64" ost_idx:%u\n",
- ostid->oi_seq, ostid->oi_id, ost_idx);
- return -EBADF;
- }
- ostid_fid_unpack(ostid, fid);
-
- } else if (unlikely(fid_seq_is_igif(ostid->oi_seq))) {
- /* This is an MDT inode number, which should never collide with
- * proper OST object IDs, and is probably a broken filesystem */
- CERROR("bad IGIF, seq:"LPU64" id:"LPU64" ost_idx:%u\n",
- ostid->oi_seq, ostid->oi_id, ost_idx);
- return -EBADF;
-
- } else /* if (fid_seq_is_idif(seq) || fid_seq_is_norm(seq)) */ {
- /* This is either an IDIF object, which identifies objects across
- * all OSTs, or a regular FID. The IDIF namespace maps legacy
- * OST objects into the FID namespace. In both cases, we just
- * pass the FID through, no conversion needed. */
- ostid_fid_unpack(ostid, fid);
- }
-
- return 0;
-}
-
-/* pack an IDIF FID into an ostid (id/seq) for the wire/disk */
-static inline void ostid_idif_pack(struct lu_fid *fid, struct ost_id *ostid)
-{
- ostid->oi_seq = FID_SEQ_OST_MDT0;
- ostid->oi_id = fid_idif_id(fid->f_seq, fid->f_oid, fid->f_ver);
-}
-
-/* pack a non-IDIF FID into an ostid (id/seq) for the wire/disk */
-static inline void ostid_fid_pack(struct lu_fid *fid, struct ost_id *ostid)
-{
- ostid->oi_seq = fid_seq(fid);
- ostid->oi_id = fid_ver_oid(fid);
-}
-
-/* pack any OST FID into an ostid (id/seq) for the wire/disk */
-static inline int fid_ostid_pack(struct lu_fid *fid, struct ost_id *ostid)
-{
- if (unlikely(fid_seq_is_igif(fid->f_seq))) {
- CERROR("bad IGIF, "DFID"\n", PFID(fid));
- return -EBADF;
- }
-
- if (fid_is_idif(fid))
- ostid_idif_pack(fid, ostid);
- else
- ostid_fid_pack(fid, ostid);
-
- return 0;
-}
-
-/* extract OST sequence (group) from a wire ost_id (id/seq) pair */
-static inline obd_seq ostid_seq(struct ost_id *ostid)
-{
- if (unlikely(fid_seq_is_igif(ostid->oi_seq)))
- CWARN("bad IGIF, oi_seq: "LPU64" oi_id: "LPX64"\n",
- ostid->oi_seq, ostid->oi_id);
-
- if (unlikely(fid_seq_is_idif(ostid->oi_seq)))
- return FID_SEQ_OST_MDT0;
-
- return ostid->oi_seq;
-}
-
-/* extract OST objid from a wire ost_id (id/seq) pair */
-static inline obd_id ostid_id(struct ost_id *ostid)
-{
- if (ostid->oi_seq == FID_SEQ_OST_MDT0)
- return ostid->oi_id & IDIF_OID_MASK;
-
- if (fid_seq_is_rsvd(ostid->oi_seq))
- return ostid->oi_id & OBIF_OID_MASK;
-
- if (fid_seq_is_idif(ostid->oi_seq))
- return fid_idif_id(ostid->oi_seq, ostid->oi_id, 0);
-
- return ostid->oi_id;
+ return fid_seq(fid) >= IDIF_SEQ_START && fid_seq(fid) < FID_SEQ_START;
}
/**
}
/**
- * Build igif from the inode number/generation.
- */
-#define LU_IGIF_BUILD(fid, ino, gen) \
-do { \
- fid->f_seq = ino; \
- fid->f_oid = gen; \
- fid->f_ver = 0; \
-} while(0)
-static inline void lu_igif_build(struct lu_fid *fid, __u32 ino, __u32 gen)
-{
- LU_IGIF_BUILD(fid, ino, gen);
- LASSERT(fid_is_igif(fid));
-}
-
-/**
* Get inode generation from a igif.
* \param fid a igif to get inode generation from.
* \return inode generation for the igif.
} ost_cmd_t;
#define OST_FIRST_OPC OST_REPLY
+typedef __u64 obd_id;
+typedef __u64 obd_gr;
+typedef __u64 obd_time;
+typedef __u64 obd_size;
+typedef __u64 obd_off;
+typedef __u64 obd_blocks;
+typedef __u64 obd_valid;
+typedef __u32 obd_blksize;
+typedef __u32 obd_mode;
+typedef __u32 obd_uid;
+typedef __u32 obd_gid;
+typedef __u32 obd_flag;
+typedef __u32 obd_count;
+
enum obdo_flags {
OBD_FL_INLINEDATA = 0x00000001,
OBD_FL_OBDMDEXISTS = 0x00000002,
#define lov_ost_data lov_ost_data_v1
struct lov_ost_data_v1 { /* per-stripe data structure (little-endian)*/
__u64 l_object_id; /* OST object ID */
- __u64 l_object_seq; /* OST object seq number */
+ __u64 l_object_gr; /* OST object group (creating MDS number) */
__u32 l_ost_gen; /* generation of this l_ost_idx */
__u32 l_ost_idx; /* OST index in LOV (lov_tgt_desc->tgts) */
};
__u32 lmm_magic; /* magic number = LOV_MAGIC_V1 */
__u32 lmm_pattern; /* LOV_PATTERN_RAID0, LOV_PATTERN_RAID1 */
__u64 lmm_object_id; /* LOV object ID */
- __u64 lmm_object_seq; /* LOV object seq number */
+ __u64 lmm_object_gr; /* LOV object group */
__u32 lmm_stripe_size; /* size of stripe in bytes */
__u32 lmm_stripe_count; /* num stripes in use for this object */
struct lov_ost_data_v1 lmm_objects[0]; /* per-stripe data */
__u32 lmm_magic; /* magic number = LOV_MAGIC_V3 */
__u32 lmm_pattern; /* LOV_PATTERN_RAID0, LOV_PATTERN_RAID1 */
__u64 lmm_object_id; /* LOV object ID */
- __u64 lmm_object_seq; /* LOV object seq number */
+ __u64 lmm_object_gr; /* LOV object group */
__u32 lmm_stripe_size; /* size of stripe in bytes */
__u32 lmm_stripe_count; /* num stripes in use for this object */
char lmm_pool_name[LOV_MAXPOOLNAME]; /* must be 32bit aligned */
struct obd_ioobj {
obd_id ioo_id;
- obd_seq ioo_seq;
+ obd_gr ioo_gr;
__u32 ioo_type;
__u32 ioo_bufcnt;
};
/** Identifier for a single log object */
struct llog_logid {
__u64 lgl_oid;
- __u64 lgl_oseq;
+ __u64 lgl_ogr;
__u32 lgl_ogen;
} __attribute__((packed));
struct llog_rec_hdr lcr_hdr;
struct ll_fid lcr_fid;
obd_id lcr_oid;
- obd_count lcr_oseq;
+ obd_count lcr_ogr;
__u32 padding;
struct llog_rec_tail lcr_tail;
} __attribute__((packed));
struct llog_unlink_rec {
struct llog_rec_hdr lur_hdr;
obd_id lur_oid;
- obd_count lur_oseq;
+ obd_count lur_ogr;
obd_count lur_count;
struct llog_rec_tail lur_tail;
} __attribute__((packed));
struct llog_setattr_rec {
struct llog_rec_hdr lsr_hdr;
obd_id lsr_oid;
- obd_count lsr_oseq;
+ obd_count lsr_ogr;
__u32 lsr_uid;
__u32 lsr_gid;
__u32 padding;
struct llog_setattr64_rec {
struct llog_rec_hdr lsr_hdr;
obd_id lsr_oid;
- obd_count lsr_oseq;
+ obd_count lsr_ogr;
__u32 padding;
__u32 lsr_uid;
__u32 lsr_uid_h;
/* Note: 64-bit types are 64-bit aligned in structure */
struct obdo {
obd_valid o_valid; /* hot fields in this obdo */
- struct ost_id o_oi;
- obd_id o_parent_seq;
+ obd_id o_id;
+ obd_gr o_gr;
+ obd_id o_fid;
obd_size o_size; /* o_size-o_blocks == ost_lvb */
obd_time o_mtime;
obd_time o_atime;
obd_gid o_gid;
obd_flag o_flags;
obd_count o_nlink; /* brw: checksum */
- obd_count o_parent_oid;
+ obd_count o_generation;
obd_count o_misc; /* brw: o_dropped */
__u64 o_ioepoch; /* epoch in ost writes */
__u32 o_stripe_idx; /* holds stripe idx */
- __u32 o_parent_ver;
+ __u32 o_padding_1;
struct lustre_handle o_handle; /* brw: lock handle to prolong locks */
struct llog_cookie o_lcookie; /* destroy: unlink cookie from MDS */
__u64 o_padding_6;
};
-#define o_id o_oi.oi_id
-#define o_seq o_oi.oi_seq
#define o_dirty o_blocks
#define o_undirty o_mode
#define o_dropped o_misc
#define o_cksum o_nlink
-static inline void obdo_unpack_ostid(struct obdo *oa, struct ost_id *ostid)
-{
- ostid->oi_id = ostid_id(&oa->o_oi);
- ostid->oi_seq = ostid_seq(&oa->o_oi);
-}
-
static inline void lustre_set_wire_obdo(struct obdo *wobdo, struct obdo *lobdo)
{
memcpy(wobdo, lobdo, sizeof(*lobdo));
#define CAPA_HMAC_ALG_MASK 0xff000000
struct lustre_capa_key {
- __u64 lk_seq; /**< mds# */
+ __u64 lk_mdsid; /**< mds# */
__u32 lk_keyid; /**< key# */
__u32 lk_padding;
__u8 lk_key[CAPA_HMAC_KEY_MAX_LEN]; /**< key */
#define lov_user_ost_data lov_user_ost_data_v1
struct lov_user_ost_data_v1 { /* per-stripe data structure */
__u64 l_object_id; /* OST object ID */
- __u64 l_object_seq; /* OST object seq number */
+ __u64 l_object_gr; /* OST object group (creating MDS number) */
__u32 l_ost_gen; /* generation of this OST index */
__u32 l_ost_idx; /* OST index in LOV */
} __attribute__((packed));
__u32 lmm_magic; /* magic number = LOV_USER_MAGIC_V1 */
__u32 lmm_pattern; /* LOV_PATTERN_RAID0, LOV_PATTERN_RAID1 */
__u64 lmm_object_id; /* LOV object ID */
- __u64 lmm_object_seq; /* LOV object seq */
+ __u64 lmm_object_gr; /* LOV object group */
__u32 lmm_stripe_size; /* size of stripe in bytes */
__u16 lmm_stripe_count; /* num stripes in use for this object */
__u16 lmm_stripe_offset; /* starting stripe offset in lmm_objects */
__u32 lmm_magic; /* magic number = LOV_USER_MAGIC_V3 */
__u32 lmm_pattern; /* LOV_PATTERN_RAID0, LOV_PATTERN_RAID1 */
__u64 lmm_object_id; /* LOV object ID */
- __u64 lmm_object_seq; /* LOV object seq */
+ __u64 lmm_object_gr; /* LOV object group */
__u32 lmm_stripe_size; /* size of stripe in bytes */
__u16 lmm_stripe_count; /* num stripes in use for this object */
__u16 lmm_stripe_offset; /* starting stripe offset in lmm_objects */
struct ll_recreate_obj {
__u64 lrc_id;
- __u64 lrc_seq;
+ __u64 lrc_group;
__u32 lrc_ost_idx;
};
* OST for saving into EA. */
};
+struct filter_fid {
+ struct ll_fid ff_fid; /* ff_fid.f_type == file stripe number */
+ __u64 ff_objid;
+ __u64 ff_group;
+};
+
struct obd_uuid {
char uuid[40];
};
__u32 f_ver;
};
-struct filter_fid {
- struct lu_fid ff_parent; /* ff_parent.f_ver == file stripe number */
- __u64 ff_objid;
- __u64 ff_seq;
-};
-
/* Userspace should treat lu_fid as opaque, and only use the following methods
to print or parse them. Other functions (e.g. compare, swab) could be moved
here from lustre_idl.h if needed. */
return capa->lc_keyid;
}
-static inline __u64 capa_key_seq(struct lustre_capa_key *key)
+static inline __u64 capa_key_mdsid(struct lustre_capa_key *key)
{
- return key->lk_seq;
+ return key->lk_mdsid;
}
static inline __u32 capa_key_keyid(struct lustre_capa_key *key)
#define DEBUG_CAPA_KEY(level, k, fmt, args...) \
do { \
-CDEBUG(level, fmt " capability key@%p seq "LPU64" keyid %u\n", \
- ##args, k, capa_key_seq(k), capa_key_keyid(k)); \
+CDEBUG(level, fmt " capability key@%p mdsid "LPU64" keyid %u\n", \
+ ##args, k, capa_key_mdsid(k), capa_key_keyid(k)); \
} while (0)
typedef int (* renew_capa_cb_t)(struct obd_capa *, struct lustre_capa *);
cfs_waitq_init(&olg->olg_waitq);
cfs_spin_lock_init(&olg->olg_lock);
cfs_sema_init(&olg->olg_cat_processing, 1);
- olg->olg_seq = group;
+ olg->olg_group = group;
}
static inline void llog_group_set_export(struct obd_llog_group *olg,
cfs_spin_lock(&olg->olg_lock);
if (olg->olg_exp != NULL && olg->olg_exp != exp)
CWARN("%s: export for group %d is changed: 0x%p -> 0x%p\n",
- exp->exp_obd->obd_name, olg->olg_seq,
+ exp->exp_obd->obd_name, olg->olg_group,
olg->olg_exp, exp);
olg->olg_exp = exp;
cfs_spin_unlock(&olg->olg_lock);
};
struct lov_oinfo { /* per-stripe data structure */
- struct ost_id loi_oi; /* object ID/Sequence on the target OST */
+ __u64 loi_id; /* object ID on the target OST */
+ __u64 loi_gr; /* object group on the target OST */
int loi_ost_idx; /* OST stripe index in lov_tgt_desc->tgts */
int loi_ost_gen; /* generation of this loi_ost_idx */
struct ost_lvb loi_lvb;
struct osc_async_rc loi_ar;
};
-#define loi_id loi_oi.oi_id
-#define loi_seq loi_oi.oi_seq
static inline void loi_kms_set(struct lov_oinfo *oinfo, __u64 kms)
{
struct {
/* Public members. */
__u64 lw_object_id; /* lov object id */
- __u64 lw_object_seq; /* lov object seq */
+ __u64 lw_object_gr; /* lov object group */
__u64 lw_maxbytes; /* maximum possible file size */
/* LOV-private members start here -- only for use in lov/. */
};
#define lsm_object_id lsm_wire.lw_object_id
-#define lsm_object_seq lsm_wire.lw_object_seq
+#define lsm_object_gr lsm_wire.lw_object_gr
#define lsm_maxbytes lsm_wire.lw_maxbytes
#define lsm_magic lsm_wire.lw_magic
#define lsm_stripe_size lsm_wire.lw_stripe_size
cfs_completion_t trd_finishing;
};
+enum filter_groups {
+ FILTER_GROUP_MDS0 = 0,
+ FILTER_GROUP_LLOG = 1,
+ FILTER_GROUP_ECHO = 2 ,
+ FILTER_GROUP_MDS1_N_BASE = 3
+};
+
/**
* In HEAD for CMD, the object is created in group number which is 3>=
* or indexing starts from 3. To test this assertions are added to disallow
* 2. The group number indexing starts from 0 instead of 3
*/
-#define LASSERT_SEQ_IS_MDT(seq) LASSERT(fid_seq_is_mdt(seq))
+static inline int filter_group_is_mds(obd_gr group)
+{
+ return (group == FILTER_GROUP_MDS0 ||
+ group >= FILTER_GROUP_MDS1_N_BASE);
+}
+
+#define LASSERT_MDS_GROUP(group) LASSERT(filter_group_is_mds(group))
-static inline __u64 objseq_to_mdsno(obd_seq seq)
+static inline __u64 objgrp_to_mdsno(obd_gr group)
{
- LASSERT_SEQ_IS_MDT(seq);
- if (seq == FID_SEQ_OST_MDT0)
+ LASSERT(filter_group_is_mds(group));
+ if (group == FILTER_GROUP_MDS0)
return 0;
- return seq - FID_SEQ_OST_MDT1 + 1;
+ return group - FILTER_GROUP_MDS1_N_BASE + 1;
}
-static inline int mdt_to_obd_objseq(int mdtid)
+static inline int mdt_to_obd_objgrp(int mdtid)
{
/**
- * MDS0 uses seq 0 pre FID-on-OST, other MDSes will use seq from
- * FID_SEQ_OST_MDT1
+ * MDS0 uses group 0 always, other MDSes will use groups from
+ * FILTER_GROUP_MDS1_N_BASE
*/
if (mdtid)
- return FID_SEQ_OST_MDT1 + mdtid - 1;
+ return FILTER_GROUP_MDS1_N_BASE + mdtid - 1;
return 0;
}
+static inline __u64 obdo_mdsno(struct obdo *oa)
+{
+ LASSERT((oa->o_valid & OBD_MD_FLGROUP));
+ return objgrp_to_mdsno(oa->o_gr);
+}
+
+static inline int obdo_is_mds(struct obdo *oa)
+{
+ LASSERT(oa->o_valid & OBD_MD_FLGROUP);
+ return filter_group_is_mds(oa->o_gr);
+}
+
struct obd_llog_group {
cfs_list_t olg_list;
- int olg_seq;
+ int olg_group;
struct llog_ctxt *olg_ctxts[LLOG_MAX_CTXTS];
cfs_waitq_t olg_waitq;
cfs_spinlock_t olg_lock;
struct lustre_handle *srconn, struct lov_stripe_md *src,
obd_size start, obd_size end, struct obd_trans_info *);
int (*o_iterate)(struct lustre_handle *conn,
- int (*)(obd_id, obd_seq, void *),
- obd_id *startid, obd_seq seq, void *data);
+ int (*)(obd_id, obd_gr, void *),
+ obd_id *startid, obd_gr group, void *data);
int (*o_preprw)(int cmd, struct obd_export *exp, struct obdo *oa,
int objcount, struct obd_ioobj *obj,
struct niobuf_remote *remote, int *nr_pages,
} \
})
-extern void obdo_from_inode(struct obdo *dst, struct inode *src,
- struct lu_fid *parent, obd_flag valid);
-
#endif /* __OBD_H */
#include <sys/stat.h>
#include <sys/queue.h>
#include <fcntl.h>
-#include <liblustre.h>
+# include <sysio.h>
+# ifdef HAVE_XTIO_H
+# include <xtio.h>
+# endif
+# include <fs.h>
+# include <mount.h>
+# include <inode.h>
+# ifdef HAVE_FILE_H
+# include <file.h>
+# endif
+# include <liblustre.h>
#endif
#include "cl_object.h"
#include <sys/stat.h>
#include <sys/queue.h>
#include <fcntl.h>
+# include <sysio.h>
+# ifdef HAVE_XTIO_H
+# include <xtio.h>
+# endif
+# include <fs.h>
+# include <mount.h>
+# include <inode.h>
+# ifdef HAVE_FILE_H
+# include <file.h>
+# endif
# include <liblustre.h>
#endif
*
* - o_mode
*
- * - o_parent_seq
+ * - o_fid (filled with inode number?!)
*
* - o_[ug]id
*
- * - o_parent_oid
- *
- * - o_parent_ver
+ * - o_generation
*
* - o_ioepoch,
*
oa->o_valid |= OBD_MD_FLEPOCH;
oa->o_ioepoch = cl_i2info(inode)->lli_ioepoch;
valid_flags |= OBD_MD_FLMTIME|OBD_MD_FLCTIME|
- OBD_MD_FLUID|OBD_MD_FLGID;
+ OBD_MD_FLUID|OBD_MD_FLGID|
+ OBD_MD_FLFID|OBD_MD_FLGENER;
}
}
- obdo_from_inode(oa, inode, &cl_i2info(inode)->lli_fid,
- valid_flags & flags);
+ obdo_from_inode(oa, inode, valid_flags & flags);
}
const struct cl_req_operations ccc_req_ops = {
#include <fcntl.h>
#include <sys/queue.h>
+#include <sysio.h>
+#ifdef HAVE_XTIO_H
+#include <xtio.h>
+#endif
+#include <fs.h>
+#include <mount.h>
+#include <inode.h>
+#ifdef HAVE_FILE_H
+#include <file.h>
+#endif
+
#ifdef HAVE_LINUX_UNISTD_H
#include <linux/unistd.h>
#elif defined(HAVE_UNISTD_H)
#include <sys/queue.h>
#include <fcntl.h>
+#include <sysio.h>
+#ifdef HAVE_XTIO_H
+#include <xtio.h>
+#endif
+#include <fs.h>
+#include <mount.h>
+#include <inode.h>
+#ifdef HAVE_FILE_H
+#include <file.h>
+#endif
+
#include "llite_lib.h"
/* Pack the required supplementary groups into the supplied groups array.
GOTO(out_free_memmd, rc = -ENOMEM);
oa->o_id = lsm->lsm_object_id;
- oa->o_seq = lsm->lsm_object_seq;
+ oa->o_gr = lsm->lsm_object_gr;
oa->o_mode = body->mode & S_IFMT;
oa->o_valid = OBD_MD_FLID | OBD_MD_FLTYPE | OBD_MD_FLGROUP;
- obdo_from_inode(oa, NULL, &llu_i2info(dir)->lli_fid, 0);
if (body->valid & OBD_MD_FLCOOKIE) {
oa->o_valid |= OBD_MD_FLCOOKIE;
# include <sys/statfs.h>
#endif
+#include <sysio.h>
+#ifdef HAVE_XTIO_H
+#include <xtio.h>
+#endif
+#include <fs.h>
+#include <mount.h>
+#include <inode.h>
+#ifdef HAVE_FILE_H
+#include <file.h>
+#endif
#include <liblustre.h>
#include <obd.h>
#include <sys/stat.h>
#include <sys/queue.h>
+#include <sysio.h>
+#ifdef HAVE_XTIO_H
+#include <xtio.h>
+#endif
+#include <fs.h>
+#include <mount.h>
+#include <inode.h>
+#ifdef HAVE_FILE_H
+#include <file.h>
+#endif
+
#include <liblustre.h>
#include <lnet/lnetctl.h> /* needed for parse_dump */
#ifndef __LLU_H_
#define __LLU_H_
-#include <fcntl.h>
-#include <sys/queue.h>
-#include <sysio.h>
-#ifdef HAVE_XTIO_H
-#include <xtio.h>
-#endif
-#include <fs.h>
-#include <mount.h>
-#include <inode.h>
-#ifdef HAVE_FILE_H
-#include <file.h>
-#endif
#include <liblustre.h>
#include <obd.h>
/* This should not be "optimized" use ~0ULL because page->index is a long and
* 32-bit systems are therefore limited to 16TB in a mapping */
#define PAGE_CACHE_MAXBYTES ((__u64)(~0UL) << CFS_PAGE_SHIFT)
+
struct ll_file_data {
struct obd_client_handle fd_mds_och;
__u32 fd_flags;
struct ost_lvb lli_lvb;
};
+
static inline struct llu_sb_info *llu_fs2sbi(struct filesys *fs)
{
return (struct llu_sb_info*)(fs->fs_private);
return (struct llu_inode_info*)(inode->i_private);
}
-static inline int ll_inode_flags(struct inode *inode)
-{
- return llu_i2info(inode)->lli_st_flags;
-}
-
static inline struct intnl_stat *llu_i2stat(struct inode *inode)
{
return &inode->i_stbuf;
}
-#define ll_inode_blksize(inode) (llu_i2stat(inode)->st_blksize)
-
static inline struct llu_sb_info *llu_i2sbi(struct inode *inode)
{
return llu_i2info(inode)->lli_sbi;
/* super.c */
void llu_update_inode(struct inode *inode, struct lustre_md *md);
void obdo_to_inode(struct inode *dst, struct obdo *src, obd_flag valid);
+void obdo_from_inode(struct obdo *dst, struct inode *src, obd_flag valid);
int ll_it_open_error(int phase, struct lookup_intent *it);
struct inode *llu_iget(struct filesys *fs, struct lustre_md *md);
int llu_inode_getattr(struct inode *inode, struct obdo *obdo,
#include <fcntl.h>
#include <sys/queue.h>
+#include <sysio.h>
+#ifdef HAVE_XTIO_H
+#include <xtio.h>
+#endif
+#include <fs.h>
+#include <mount.h>
+#include <inode.h>
+#ifdef HAVE_FILE_H
+#include <file.h>
+#endif
+
#include "llite_lib.h"
void ll_intent_drop_lock(struct lookup_intent *it)
#include <fcntl.h>
#include <sys/uio.h>
+#include <sysio.h>
+#ifdef HAVE_XTIO_H
+#include <xtio.h>
+#endif
+#include <fs.h>
+#include <mount.h>
+#include <inode.h>
+#ifdef HAVE_FILE_H
+#include <file.h>
+#endif
+
#include "llite_lib.h"
typedef ssize_t llu_file_piov_t(const struct iovec *iovec, int iovlen,
# include <sys/statfs.h>
#endif
+#include <sysio.h>
+#ifdef HAVE_XTIO_H
+#include <xtio.h>
+#endif
+#include <fs.h>
+#include <mount.h>
+#include <inode.h>
+#ifdef HAVE_FILE_H
+#include <file.h>
+#endif
+
#include "llite_lib.h"
#ifndef MAY_EXEC
valid &= src->o_valid;
- LASSERTF(!(valid & (OBD_MD_FLTYPE | OBD_MD_FLGENER | OBD_MD_FLFID |
- OBD_MD_FLID | OBD_MD_FLGROUP)),
- "object "LPU64"/"LPU64", valid %x\n",
- src->o_id, src->o_seq, valid);
-
if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME))
CDEBUG(D_INODE,"valid "LPX64", cur time "CFS_TIME_T"/"CFS_TIME_T
- ", new %lu/%lu\n",
+ ", new %lu/%lu\n",
src->o_valid,
LTIME_S(st->st_mtime), LTIME_S(st->st_ctime),
(long)src->o_mtime, (long)src->o_ctime);
lli->lli_st_flags = src->o_flags;
}
+#define S_IRWXUGO (S_IRWXU|S_IRWXG|S_IRWXO)
+#define S_IALLUGO (S_ISUID|S_ISGID|S_ISVTX|S_IRWXUGO)
+
+void obdo_from_inode(struct obdo *dst, struct inode *src, obd_flag valid)
+{
+ struct llu_inode_info *lli = llu_i2info(src);
+ struct intnl_stat *st = llu_i2stat(src);
+ obd_flag newvalid = 0;
+
+ if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME))
+ CDEBUG(D_INODE, "valid %x, new time "CFS_TIME_T"/"CFS_TIME_T"\n",
+ valid, LTIME_S(st->st_mtime),
+ LTIME_S(st->st_ctime));
+
+ if (valid & OBD_MD_FLATIME) {
+ dst->o_atime = LTIME_S(st->st_atime);
+ newvalid |= OBD_MD_FLATIME;
+ }
+ if (valid & OBD_MD_FLMTIME) {
+ dst->o_mtime = LTIME_S(st->st_mtime);
+ newvalid |= OBD_MD_FLMTIME;
+ }
+ if (valid & OBD_MD_FLCTIME) {
+ dst->o_ctime = LTIME_S(st->st_ctime);
+ newvalid |= OBD_MD_FLCTIME;
+ }
+ if (valid & OBD_MD_FLSIZE) {
+ dst->o_size = st->st_size;
+ newvalid |= OBD_MD_FLSIZE;
+ }
+ if (valid & OBD_MD_FLBLOCKS) { /* allocation of space (x512 bytes) */
+ dst->o_blocks = st->st_blocks;
+ newvalid |= OBD_MD_FLBLOCKS;
+ }
+ if (valid & OBD_MD_FLBLKSZ) { /* optimal block size */
+ dst->o_blksize = st->st_blksize;
+ newvalid |= OBD_MD_FLBLKSZ;
+ }
+ if (valid & OBD_MD_FLTYPE) {
+ dst->o_mode = (dst->o_mode & S_IALLUGO)|(st->st_mode & S_IFMT);
+ newvalid |= OBD_MD_FLTYPE;
+ }
+ if (valid & OBD_MD_FLMODE) {
+ dst->o_mode = (dst->o_mode & S_IFMT)|(st->st_mode & S_IALLUGO);
+ newvalid |= OBD_MD_FLMODE;
+ }
+ if (valid & OBD_MD_FLUID) {
+ dst->o_uid = st->st_uid;
+ newvalid |= OBD_MD_FLUID;
+ }
+ if (valid & OBD_MD_FLGID) {
+ dst->o_gid = st->st_gid;
+ newvalid |= OBD_MD_FLGID;
+ }
+ if (valid & OBD_MD_FLFLAGS) {
+ dst->o_flags = lli->lli_st_flags;
+ newvalid |= OBD_MD_FLFLAGS;
+ }
+ if (valid & OBD_MD_FLGENER) {
+ dst->o_generation = lli->lli_st_generation;
+ newvalid |= OBD_MD_FLGENER;
+ }
+ if (valid & OBD_MD_FLFID) {
+ dst->o_fid = st->st_ino;
+ newvalid |= OBD_MD_FLFID;
+ }
+
+ dst->o_valid |= newvalid;
+}
+
/**
* Performs the getattr on the inode and updates its fields.
* If @sync != 0, perform the getattr under the server-side lock.
oinfo.oi_md = lsm;
oinfo.oi_oa = obdo;
oinfo.oi_oa->o_id = lsm->lsm_object_id;
- oinfo.oi_oa->o_seq = lsm->lsm_object_seq;
+ oinfo.oi_oa->o_gr = lsm->lsm_object_gr;
oinfo.oi_oa->o_mode = S_IFREG;
oinfo.oi_oa->o_ioepoch = ioepoch;
oinfo.oi_oa->o_valid = OBD_MD_FLID | OBD_MD_FLTYPE |
OBD_MD_FLBLKSZ | OBD_MD_FLMTIME |
OBD_MD_FLCTIME | OBD_MD_FLGROUP |
OBD_MD_FLATIME | OBD_MD_FLEPOCH;
- obdo_from_inode(oinfo.oi_oa, NULL, &llu_i2info(inode)->lli_fid, 0);
if (sync) {
oinfo.oi_oa->o_valid |= OBD_MD_FLFLAGS;
oinfo.oi_oa->o_flags |= OBD_FL_SRVLOCK;
if (opt_verbose) {
printf("lmm_magic: 0x%08X\n", lum->lmm_magic);
printf("lmm_object_id: "LPX64"\n", lum->lmm_object_id);
- printf("lmm_object_seq: "LPX64"\n", lum->lmm_object_seq);
+ printf("lmm_object_gr: "LPX64"\n", lum->lmm_object_gr);
printf("lmm_stripe_count: %u\n", (int)lum->lmm_stripe_count);
printf("lmm_stripe_size: %u\n", lum->lmm_stripe_size);
printf("lmm_stripe_pattern: %x\n", lum->lmm_pattern);
for (index = 0; index < lum->lmm_stripe_count; index++) {
lo = lum->lmm_objects + index;
printf("object %d:\n", index);
- printf("\tobject_seq: "LPX64"\n", lo->l_object_seq);
+ printf("\tobject_gr: "LPX64"\n", lo->l_object_gr);
printf("\tobject_id: "LPX64"\n", lo->l_object_id);
printf("\tost_gen: %#x\n", lo->l_ost_gen);
printf("\tost_idx: %u\n", lo->l_ost_idx);
if (opt_verbose) {
printf("lmm_magic: 0x%08X\n", lum->lmm_magic);
printf("lmm_object_id: "LPX64"\n", lum->lmm_object_id);
- printf("lmm_object_seq: "LPX64"\n", lum->lmm_object_seq);
+ printf("lmm_object_gr: "LPX64"\n", lum->lmm_object_gr);
printf("lmm_stripe_count: %u\n", (int)lum->lmm_stripe_count);
printf("lmm_stripe_size: %u\n", lum->lmm_stripe_size);
printf("lmm_stripe_pattern: %x\n", lum->lmm_pattern);
for (index = 0; index < lum->lmm_stripe_count; index++) {
lo = lum->lmm_objects + index;
printf("object %d:\n", index);
- printf("\tobject_seq: "LPX64"\n", lo->l_object_seq);
+ printf("\tobject_gr: "LPX64"\n", lo->l_object_gr);
printf("\tobject_id: "LPX64"\n", lo->l_object_id);
printf("\tost_gen: %#x\n", lo->l_ost_gen);
printf("\tost_idx: %u\n", lo->l_ost_idx);
oinfo.oi_md = lsm;
oinfo.oi_oa = obdo;
oinfo.oi_oa->o_id = lsm->lsm_object_id;
- oinfo.oi_oa->o_seq = lsm->lsm_object_seq;
+ oinfo.oi_oa->o_gr = lsm->lsm_object_gr;
oinfo.oi_oa->o_mode = S_IFREG;
oinfo.oi_oa->o_ioepoch = ioepoch;
oinfo.oi_oa->o_valid = OBD_MD_FLID | OBD_MD_FLTYPE |
GOTO(out, rc = -ENOMEM);
oa->o_id = ucreatp.lrc_id;
- oa->o_seq = ucreatp.lrc_seq;
+ oa->o_gr = ucreatp.lrc_group;
oa->o_nlink = ucreatp.lrc_ost_idx;
oa->o_flags |= OBD_FL_RECREATE_OBJS;
oa->o_valid = OBD_MD_FLID | OBD_MD_FLFLAGS | OBD_MD_FLGROUP;
- obdo_from_inode(oa, inode, &ll_i2info(inode)->lli_fid, OBD_MD_FLTYPE |
- OBD_MD_FLATIME | OBD_MD_FLMTIME | OBD_MD_FLCTIME);
+ obdo_from_inode(oa, inode, OBD_MD_FLTYPE | OBD_MD_FLATIME |
+ OBD_MD_FLMTIME | OBD_MD_FLCTIME);
+
memcpy(lsm2, lsm, lsm_size);
rc = obd_create(exp, oa, &lsm2, &oti);
return -EOPNOTSUPP;
fm_key.oa.o_id = lsm->lsm_object_id;
- fm_key.oa.o_seq = lsm->lsm_object_seq;
+ fm_key.oa.o_gr = lsm->lsm_object_gr;
fm_key.oa.o_valid = OBD_MD_FLID | OBD_MD_FLGROUP;
- obdo_from_inode(&fm_key.oa, inode, &ll_i2info(inode)->lli_fid,
+ obdo_from_inode(&fm_key.oa, inode, OBD_MD_FLFID | OBD_MD_FLGROUP |
OBD_MD_FLSIZE);
+
/* If filesize is 0, then there would be no objects for mapping */
if (fm_key.oa.o_size == 0) {
fiemap->fm_mapped_extents = 0;
RETURN(rc ? rc : -ENOMEM);
oa->o_id = lsm->lsm_object_id;
- oa->o_seq = lsm->lsm_object_seq;
+ oa->o_gr = lsm->lsm_object_gr;
oa->o_valid = OBD_MD_FLID | OBD_MD_FLGROUP;
- obdo_from_inode(oa, inode, &ll_i2info(inode)->lli_fid,
- OBD_MD_FLTYPE | OBD_MD_FLATIME |
- OBD_MD_FLMTIME | OBD_MD_FLCTIME |
- OBD_MD_FLGROUP);
+ obdo_from_inode(oa, inode, OBD_MD_FLTYPE | OBD_MD_FLATIME |
+ OBD_MD_FLMTIME | OBD_MD_FLCTIME |
+ OBD_MD_FLGROUP);
oc = ll_osscapa_get(inode, CAPA_OPC_OSS_WRITE);
err = obd_sync(ll_i2sbi(inode)->ll_dt_exp, oa, lsm,
}
oinfo.oi_oa->o_id = lsm->lsm_object_id;
- oinfo.oi_oa->o_seq = lsm->lsm_object_seq;
+ oinfo.oi_oa->o_gr = lsm->lsm_object_gr;
oinfo.oi_oa->o_flags = flags;
oinfo.oi_oa->o_valid = OBD_MD_FLID | OBD_MD_FLFLAGS |
OBD_MD_FLGROUP;
oinfo.oi_capa = ll_mdscapa_get(inode);
+
obdo_from_inode(oinfo.oi_oa, inode,
- &ll_i2info(inode)->lli_fid, 0);
+ OBD_MD_FLFID | OBD_MD_FLGENER);
rc = obd_setattr_rqset(sbi->ll_dt_exp, &oinfo, NULL);
capa_put(oinfo.oi_capa);
OBDO_FREE(oinfo.oi_oa);
GOTO(out_free_memmd, rc = -ENOMEM);
oa->o_id = lsm->lsm_object_id;
- oa->o_seq = lsm->lsm_object_seq;
+ oa->o_gr = lsm->lsm_object_gr;
oa->o_mode = body->mode & S_IFMT;
oa->o_valid = OBD_MD_FLID | OBD_MD_FLTYPE | OBD_MD_FLGROUP;
cl_2queue_init_page(queue, page);
cl_page_clip(env, page, 0, to);
-
+
result = cl_io_submit_sync(env, io, crt, queue, CRP_NORMAL, 0);
LASSERT(cl_page_is_owned(page, io));
cl_page_clip(env, page, 0, CFS_PAGE_SIZE);
* are the same
*/
lsm->lsm_object_id = le64_to_cpu(lmm->lmm_object_id);
- lsm->lsm_object_seq = le64_to_cpu(lmm->lmm_object_seq);
+ lsm->lsm_object_gr = le64_to_cpu(lmm->lmm_object_gr);
lsm->lsm_stripe_size = le32_to_cpu(lmm->lmm_stripe_size);
lsm->lsm_pattern = le32_to_cpu(lmm->lmm_pattern);
lsm->lsm_pool_name[0] = '\0';
/* XXX LOV STACKING call down to osc_unpackmd() */
loi = lsm->lsm_oinfo[i];
loi->loi_id = le64_to_cpu(lmm->lmm_objects[i].l_object_id);
- loi->loi_seq = le64_to_cpu(lmm->lmm_objects[i].l_object_seq);
+ loi->loi_gr = le64_to_cpu(lmm->lmm_objects[i].l_object_gr);
loi->loi_ost_idx = le32_to_cpu(lmm->lmm_objects[i].l_ost_idx);
loi->loi_ost_gen = le32_to_cpu(lmm->lmm_objects[i].l_ost_gen);
if (loi->loi_ost_idx >= lov->desc.ld_tgt_count) {
/* XXX LOV STACKING call down to osc_unpackmd() */
loi = lsm->lsm_oinfo[i];
loi->loi_id = le64_to_cpu(lmm->lmm_objects[i].l_object_id);
- loi->loi_seq = le64_to_cpu(lmm->lmm_objects[i].l_object_seq);
+ loi->loi_gr = le64_to_cpu(lmm->lmm_objects[i].l_object_gr);
loi->loi_ost_idx = le32_to_cpu(lmm->lmm_objects[i].l_ost_idx);
loi->loi_ost_gen = le32_to_cpu(lmm->lmm_objects[i].l_ost_gen);
if (loi->loi_ost_idx >= lov->desc.ld_tgt_count) {
case MDS_UNLINK_REC: {
struct llog_unlink_rec *lur = (struct llog_unlink_rec *)rec;
lur->lur_oid = loi->loi_id;
- lur->lur_oseq = loi->loi_seq;
+ lur->lur_ogr = loi->loi_gr;
break;
}
case MDS_SETATTR_REC: {
struct llog_setattr_rec *lsr = (struct llog_setattr_rec *)rec;
lsr->lsr_oid = loi->loi_id;
- lsr->lsr_oseq = loi->loi_seq;
+ lsr->lsr_ogr = loi->loi_gr;
break;
}
case MDS_SETATTR64_REC: {
struct llog_setattr64_rec *lsr = (struct llog_setattr64_rec *)rec;
lsr->lsr_oid = loi->loi_id;
- lsr->lsr_oseq = loi->loi_seq;
+ lsr->lsr_ogr = loi->loi_gr;
break;
}
default:
break;
}
+ LASSERT(lsm->lsm_object_gr == loi->loi_gr);
/* inject error in llog_add() below */
if (OBD_FAIL_CHECK(OBD_FAIL_MDS_FAIL_LOV_LOG_ADD)) {
llog_ctxt_put(cctxt);
if (!exp || !exp->exp_obd)
RETURN(-ENODEV);
+ LASSERT_MDS_GROUP(lsm->lsm_object_gr);
+
lov = &exp->exp_obd->u.lov;
for (i = 0; i < lsm->lsm_stripe_count; i++) {
struct lov_stripe_md submd;
continue;
}
- LASSERT_SEQ_IS_MDT(loi->loi_seq);
submd.lsm_object_id = loi->loi_id;
- submd.lsm_object_seq = loi->loi_seq;
+ submd.lsm_object_gr = lsm->lsm_object_gr;
submd.lsm_stripe_count = 0;
rc = obd_change_cbdata(lov->lov_tgts[loi->loi_ost_idx]->ltd_exp,
&submd, it, data);
if (!exp || !exp->exp_obd)
RETURN(-ENODEV);
+ LASSERT_MDS_GROUP(lsm->lsm_object_gr);
+
lov = &exp->exp_obd->u.lov;
for (i = 0; i < lsm->lsm_stripe_count; i++) {
struct lov_stripe_md submd;
continue;
}
- LASSERT_SEQ_IS_MDT(loi->loi_seq);
submd.lsm_object_id = loi->loi_id;
- submd.lsm_object_seq = loi->loi_seq;
+ submd.lsm_object_gr = loi->loi_gr;
submd.lsm_stripe_count = 0;
rc = obd_find_cbdata(lov->lov_tgts[loi->loi_ost_idx]->ltd_exp,
&submd, it, data);
if (!exp || !exp->exp_obd)
RETURN(-ENODEV);
- LASSERT_SEQ_IS_MDT(lsm->lsm_object_seq);
+ LASSERT_MDS_GROUP(lsm->lsm_object_gr);
LASSERT(lockh);
lov = &exp->exp_obd->u.lov;
rc = lov_prep_cancel_set(exp, &oinfo, lsm, mode, lockh, &set);
ASSERT_LSM_MAGIC(lsm);
- LASSERT_SEQ_IS_MDT(lsm->lsm_object_seq);
+ LASSERT_MDS_GROUP(lsm->lsm_object_gr);
for (i = 0; i < lsm->lsm_stripe_count; i++) {
struct lov_stripe_md submd;
struct lov_oinfo *loi = lsm->lsm_oinfo[i];
CDEBUG(D_HA, "lov idx %d inactive\n", loi->loi_ost_idx);
submd.lsm_object_id = loi->loi_id;
- submd.lsm_object_seq = loi->loi_seq;
+ submd.lsm_object_gr = lsm->lsm_object_gr;
submd.lsm_stripe_count = 0;
err = obd_cancel_unused(lov->lov_tgts[loi->loi_ost_idx]->ltd_exp,
&submd, flags, opaque);
fm_local->fm_flags = fiemap->fm_flags;
fm_key->oa.o_id = lsm->lsm_oinfo[cur_stripe]->loi_id;
- fm_key->oa.o_seq = lsm->lsm_oinfo[cur_stripe]->loi_seq;
ost_index = lsm->lsm_oinfo[cur_stripe]->loi_ost_idx;
if (ost_index < 0 || ost_index >=lov->desc.ld_tgt_count)
continue;
if (lov->lov_tgts[loi->loi_ost_idx]->ltd_exp ==
data->lock->l_conn_export &&
- osc_res_name_eq(loi->loi_id, loi->loi_seq, res_id)) {
+ osc_res_name_eq(loi->loi_id, loi->loi_gr, res_id)) {
*stripe = i;
GOTO(out, rc = 0);
}
lov->u = *state;
}
+static void oinfo_get_fid(const struct lov_oinfo *oinfo, struct lu_fid *fid)
+{
+ __u64 idx = oinfo->loi_id;
+
+ /* See idif definition in wiki:CMD3_interoperability_architecture */
+
+ LASSERT(oinfo->loi_gr < 1ULL << 16);
+ LASSERT(oinfo->loi_id < 1ULL << 49);
+ ENTRY;
+
+ /*
+ * Now that the fid of stripe is not unique now, ost_idx have to
+ * be used to make it unique. This is ok because the stripe fids
+ * are just used in client side(to locate the objects). -jay
+ */
+ fid->f_seq = ((__u64)oinfo->loi_ost_idx) << 32 |
+ oinfo->loi_gr << 16 | idx >> 32;
+ fid->f_oid = idx; /* truncated to 32 bits by assignment */
+ fid->f_ver = 0;
+ EXIT;
+}
+
static struct cl_object *lov_sub_find(const struct lu_env *env,
struct cl_device *dev,
const struct lu_fid *fid,
parent = subhdr->coh_parent;
oinfo = r0->lo_lsm->lsm_oinfo[idx];
- CDEBUG(D_INODE, DFID"@%p[%d] -> "DFID"@%p: id: "LPU64" seq: "LPU64
+ CDEBUG(D_INODE, DFID"@%p[%d] -> "DFID"@%p: id: "LPU64" gr: "LPU64
" idx: %d gen: %d\n",
PFID(&subhdr->coh_lu.loh_fid), subhdr, idx,
PFID(&hdr->coh_lu.loh_fid), hdr,
- oinfo->loi_id, oinfo->loi_seq,
+ oinfo->loi_id, oinfo->loi_gr,
oinfo->loi_ost_idx, oinfo->loi_ost_gen);
if (parent == NULL) {
struct lov_oinfo *oinfo = lsm->lsm_oinfo[i];
int ost_idx = oinfo->loi_ost_idx;
- fid_ostid_unpack(ofid, &oinfo->loi_oi,
- oinfo->loi_ost_idx);
+ oinfo_get_fid(oinfo, ofid);
subdev = lovsub2cl_dev(dev->ld_target[ost_idx]);
subconf->u.coc_oinfo = oinfo;
LASSERTF(subdev != NULL, "not init ost %d\n", ost_idx);
for (i = 0; i < stripe_count; ++i, ++lod) {
CDEBUG(level, "stripe %u idx %u subobj "LPX64"/"LPX64"\n", i,
le32_to_cpu(lod->l_ost_idx),
- (__u64)le64_to_cpu(lod->l_object_seq),
+ (__u64)le64_to_cpu(lod->l_object_gr),
(__u64)le64_to_cpu(lod->l_object_id));
}
}
* same first fields
*/
lmmv1->lmm_object_id = cpu_to_le64(lsm->lsm_object_id);
- lmmv1->lmm_object_seq = cpu_to_le64(lsm->lsm_object_seq);
+ lmmv1->lmm_object_gr = cpu_to_le64(lsm->lsm_object_gr);
lmmv1->lmm_stripe_size = cpu_to_le32(lsm->lsm_stripe_size);
lmmv1->lmm_stripe_count = cpu_to_le32(stripe_count);
lmmv1->lmm_pattern = cpu_to_le32(lsm->lsm_pattern);
for (i = 0; i < stripe_count; i++) {
struct lov_oinfo *loi = lsm->lsm_oinfo[i];
+
/* XXX LOV STACKING call down to osc_packmd() to do packing */
LASSERTF(loi->loi_id, "lmm_oid "LPU64" stripe %u/%u idx %u\n",
lmmv1->lmm_object_id, i, stripe_count, loi->loi_ost_idx);
lmm_objects[i].l_object_id = cpu_to_le64(loi->loi_id);
- lmm_objects[i].l_object_seq = cpu_to_le64(loi->loi_seq);
+ lmm_objects[i].l_object_gr = cpu_to_le64(loi->loi_gr);
lmm_objects[i].l_ost_gen = cpu_to_le32(loi->loi_ost_gen);
lmm_objects[i].l_ost_idx = cpu_to_le32(loi->loi_ost_idx);
}
(*lsmp)->lsm_oinfo[i]->loi_ost_idx =
lmm_objects[i].l_ost_idx;
(*lsmp)->lsm_oinfo[i]->loi_id = lmm_objects[i].l_object_id;
- (*lsmp)->lsm_oinfo[i]->loi_seq = lmm_objects[i].l_object_seq;
+ (*lsmp)->lsm_oinfo[i]->loi_gr = lmm_objects[i].l_object_gr;
}
RETURN(0);
}
lsm = set->set_oi->oi_md;
lsm->lsm_object_id = src_oa->o_id;
- lsm->lsm_object_seq = src_oa->o_seq;
+ lsm->lsm_object_gr = src_oa->o_gr;
if (!lsm->lsm_stripe_size)
lsm->lsm_stripe_size = lov->desc.ld_default_stripe_size;
/* XXX LOV STACKING: submd should be from the subobj */
req->rq_oi.oi_md->lsm_object_id = loi->loi_id;
- req->rq_oi.oi_md->lsm_object_seq = loi->loi_seq;
+ req->rq_oi.oi_md->lsm_object_gr = oinfo->oi_md->lsm_object_gr;
req->rq_oi.oi_md->lsm_stripe_count = 0;
req->rq_oi.oi_md->lsm_oinfo[0]->loi_kms_valid =
loi->loi_kms_valid;
/* XXX LOV STACKING: submd should be from the subobj */
req->rq_oi.oi_md->lsm_object_id = loi->loi_id;
- req->rq_oi.oi_md->lsm_object_seq = loi->loi_seq;
+ req->rq_oi.oi_md->lsm_object_gr = lsm->lsm_object_gr;
req->rq_oi.oi_md->lsm_stripe_count = 0;
lov_set_add_req(req, set);
/* XXX LOV STACKING: submd should be from the subobj */
req->rq_oi.oi_md->lsm_object_id = loi->loi_id;
- req->rq_oi.oi_md->lsm_object_seq = loi->loi_seq;
+ req->rq_oi.oi_md->lsm_object_gr = lsm->lsm_object_gr;
req->rq_oi.oi_md->lsm_stripe_count = 0;
lov_set_add_req(req, set);
LBUG();
}
ret_oa->o_id = src_oa->o_id;
- ret_oa->o_seq = src_oa->o_seq;
+ ret_oa->o_gr = src_oa->o_gr;
ret_oa->o_valid |= OBD_MD_FLID | OBD_MD_FLGROUP;
memcpy(src_oa, ret_oa, sizeof(*src_oa));
OBDO_FREE(ret_oa);
}
loi->loi_id = req->rq_oi.oi_oa->o_id;
- loi->loi_seq = req->rq_oi.oi_oa->o_seq;
+ loi->loi_gr = req->rq_oi.oi_oa->o_gr;
loi->loi_ost_idx = req->rq_idx;
loi_init(loi);
sizeof(*req->rq_oi.oi_oa));
}
req->rq_oi.oi_oa->o_id = loi->loi_id;
- req->rq_oi.oi_oa->o_seq = loi->loi_seq;
req->rq_oi.oi_oa->o_stripe_idx = i;
req->rq_buflen = sizeof(*req->rq_oi.oi_md);
/* XXX LOV STACKING */
req->rq_oi.oi_md->lsm_object_id = loi->loi_id;
- req->rq_oi.oi_md->lsm_object_seq = loi->loi_seq;
+ req->rq_oi.oi_md->lsm_object_gr = oinfo->oi_md->lsm_object_gr;
req->rq_oabufs = info[i].count;
req->rq_pgaidx = shift;
shift += req->rq_oabufs;
memcpy(req->rq_oi.oi_oa, oinfo->oi_oa,
sizeof(*req->rq_oi.oi_oa));
req->rq_oi.oi_oa->o_id = loi->loi_id;
- req->rq_oi.oi_oa->o_seq = loi->loi_seq;
req->rq_oi.oi_cb_up = cb_getattr_update;
req->rq_oi.oi_capa = oinfo->oi_capa;
}
memcpy(req->rq_oi.oi_oa, src_oa, sizeof(*req->rq_oi.oi_oa));
req->rq_oi.oi_oa->o_id = loi->loi_id;
- req->rq_oi.oi_oa->o_seq = loi->loi_seq;
lov_set_add_req(req, set);
}
if (!set->set_count)
memcpy(req->rq_oi.oi_oa, oinfo->oi_oa,
sizeof(*req->rq_oi.oi_oa));
req->rq_oi.oi_oa->o_id = loi->loi_id;
- req->rq_oi.oi_oa->o_seq= loi->loi_seq;
req->rq_oi.oi_oa->o_stripe_idx = i;
req->rq_oi.oi_cb_up = cb_setattr_update;
req->rq_oi.oi_capa = oinfo->oi_capa;
memcpy(req->rq_oi.oi_oa, oinfo->oi_oa,
sizeof(*req->rq_oi.oi_oa));
req->rq_oi.oi_oa->o_id = loi->loi_id;
- req->rq_oi.oi_oa->o_seq = loi->loi_seq;
+ req->rq_oi.oi_oa->o_gr = loi->loi_gr;
req->rq_oi.oi_oa->o_valid |= OBD_MD_FLGROUP;
req->rq_oi.oi_oa->o_stripe_idx = i;
}
memcpy(req->rq_oi.oi_oa, src_oa, sizeof(*req->rq_oi.oi_oa));
req->rq_oi.oi_oa->o_id = loi->loi_id;
- req->rq_oi.oi_oa->o_seq = loi->loi_seq;
req->rq_oi.oi_oa->o_stripe_idx = i;
req->rq_oi.oi_policy.l_extent.start = rs;
RETURN(rc);
}
+/*
+ * XXX: this is for create lsm object id, which should identify the lsm object
+ * unique in the whole mds, as I see. But it seems, we still not need it
+ * now. Right? So just borrow the cl_fid_build_ino().
+ */
+static obd_id mdd_lov_create_id(const struct lu_fid *fid)
+{
+ return fid_flatten(fid);
+}
+
int mdd_lov_objid_prepare(struct mdd_device *mdd, struct lov_mds_md *lmm)
{
/* copy mds_lov code is using wrong layer */
oa->o_uid = 0; /* must have 0 uid / gid on OST */
oa->o_gid = 0;
- oa->o_seq = mdt_to_obd_objseq(lu_site2md(site)->ms_node_id);
+ oa->o_gr = mdt_to_obd_objgrp(lu_site2md(site)->ms_node_id);
oa->o_mode = S_IFREG | 0600;
- oa->o_id = fid_ver_oid(mdd_object_fid(child));
+ oa->o_id = mdd_lov_create_id(mdd_object_fid(child));
oa->o_valid = OBD_MD_FLID | OBD_MD_FLTYPE | OBD_MD_FLFLAGS |
OBD_MD_FLMODE | OBD_MD_FLUID | OBD_MD_FLGID | OBD_MD_FLGROUP;
oa->o_size = 0;
0, &lsm, (void*)eadata);
if (rc)
GOTO(out_oti, rc);
+ lsm->lsm_object_id = oa->o_id;
+ lsm->lsm_object_gr = oa->o_gr;
} else if (parent != NULL) {
/* get lov ea from parent and set to lov */
struct lov_mds_md *_lmm;
}
GOTO(out_oti, rc);
}
- LASSERT_SEQ_IS_MDT(lsm->lsm_object_seq);
+ LASSERT_MDS_GROUP(lsm->lsm_object_gr);
} else {
LASSERT(eadata != NULL);
rc = obd_iocontrol(OBD_IOC_LOV_SETEA, lov_exp, 0, &lsm,
(void*)eadata);
if (rc)
GOTO(out_oti, rc);
-
+ lsm->lsm_object_id = oa->o_id;
+ lsm->lsm_object_gr = oa->o_gr;
}
- lsm->lsm_object_id = fid_ver_oid(mdd_object_fid(child));
- lsm->lsm_object_seq = fid_seq(mdd_object_fid(child));
/*
* Sometimes, we may truncate some object(without lsm) then open it
* (with write flags), so creating lsm above. The Nonzero(truncated)
* filter_fid, but can not see what is the usages. So just pack
* o_seq o_ver here, maybe fix it after this cycle.
*/
- obdo_from_inode(oa, NULL,
- (struct lu_fid *)mdd_object_fid(child), 0);
+ oa->o_fid = fid_seq(mdd_object_fid(child));
+ oa->o_generation = fid_oid(mdd_object_fid(child));
+ oa->o_valid |= OBD_MD_FLFID | OBD_MD_FLGENER;
oinfo->oi_oa = oa;
oinfo->oi_md = lsm;
oinfo->oi_capa = NULL;
GOTO(out_oti, rc);
}
}
+
/* blksize should be changed after create data object */
la->la_valid |= LA_BLKSIZE;
la->la_blksize = oa->o_blksize;
}
oa->o_id = lsm->lsm_object_id;
- oa->o_seq = mdt_to_obd_objseq(lu_site2md(site)->ms_node_id);
+ oa->o_gr = mdt_to_obd_objgrp(lu_site2md(site)->ms_node_id);
oa->o_mode = la->la_mode & S_IFMT;
oa->o_valid = OBD_MD_FLID | OBD_MD_FLTYPE | OBD_MD_FLGROUP;
oti->oti_logcookies = logcookies;
}
- CDEBUG(D_INFO, "destroying OSS object "LPU64":"LPU64"\n", oa->o_seq,
- oa->o_id);
+ CDEBUG(D_INFO, "destroying OSS object %d/%d\n",
+ (int)oa->o_id, (int)oa->o_gr);
rc = obd_destroy(lov_exp, oa, lsm, oti, NULL, NULL);
static int mdd_osc_setattr_async(struct obd_device *obd, __u32 uid, __u32 gid,
struct lov_mds_md *lmm, int lmm_size,
- struct llog_cookie *logcookies, const struct lu_fid *parent,
+ struct llog_cookie *logcookies, __u64 id, __u32 gen,
struct obd_capa *oc)
{
struct mds_obd *mds = &obd->u.mds;
rc = obd_unpackmd(mds->mds_osc_exp, &oinfo.oi_md, lmm, lmm_size);
if (rc < 0) {
- CERROR("Error unpack md %p for obj "DFID"\n", lmm,
- PFID(parent));
+ CERROR("Error unpack md %p for inode "LPU64"\n", lmm, id);
GOTO(out, rc);
}
oinfo.oi_oa->o_uid = uid;
oinfo.oi_oa->o_gid = gid;
oinfo.oi_oa->o_id = oinfo.oi_md->lsm_object_id;
- oinfo.oi_oa->o_seq = oinfo.oi_md->lsm_object_seq;
+ oinfo.oi_oa->o_gr = oinfo.oi_md->lsm_object_gr;
oinfo.oi_oa->o_valid |= OBD_MD_FLID | OBD_MD_FLGROUP |
OBD_MD_FLUID | OBD_MD_FLGID;
if (logcookies) {
oti.oti_logcookies = logcookies;
}
- obdo_from_inode(oinfo.oi_oa, NULL, (struct lu_fid *)parent, 0);
+ oinfo.oi_oa->o_fid = id;
+ oinfo.oi_oa->o_generation = gen;
+ oinfo.oi_oa->o_valid |= OBD_MD_FLFID | OBD_MD_FLGENER;
oinfo.oi_capa = oc;
/* do async setattr from mds to ost not waiting for responses. */
RETURN(rc);
rc = mdd_osc_setattr_async(obd, tmp_la->la_uid, tmp_la->la_gid, lmm,
- lmm_size, logcookies, fid, NULL);
+ lmm_size, logcookies, fid_seq(fid),
+ fid_oid(fid), NULL);
RETURN(rc);
}
}
lmm->lmm_magic = LOV_MAGIC_V1;
- lmm->lmm_object_seq = LOV_OBJECT_GROUP_DEFAULT;
+ lmm->lmm_object_gr = LOV_OBJECT_GROUP_DEFAULT;
lmm->lmm_pattern = ldesc->ld_pattern;
lmm->lmm_stripe_size = ldesc->ld_default_stripe_size;
lmm->lmm_stripe_count = ldesc->ld_default_stripe_count;
LASSERT(mds->mds_objects_dir == filp->f_dentry->d_parent);
- /* FIXME: need to see how this should change to properly store FID
- * into obdo (o_id == OID, o_seq = SEQ) (maybe as IGIF?). */
-#define o_generation o_parent_oid
oa->o_id = filp->f_dentry->d_inode->i_ino;
oa->o_generation = filp->f_dentry->d_inode->i_generation;
namelen = ll_fid2str(fidname, oa->o_id, oa->o_generation);
err = fsfilt_commit(exp->exp_obd, mds->mds_objects_dir->d_inode,
handle, 0);
if (!err) {
- oa->o_seq = mdt_to_obd_objseq(mds->mds_id);
+ oa->o_gr = mdt_to_obd_objgrp(mds->mds_id);
oa->o_valid |= OBD_MD_FLID | OBD_MD_FLGENER | OBD_MD_FLGROUP;
} else if (!rc)
rc = err;
if (rc)
CERROR("error destroying object "LPU64":%u: rc %d\n",
oa->o_id, oa->o_generation, rc);
-#undef o_generation
err = fsfilt_commit(obd, mds->mds_objects_dir->d_inode, handle, 0);
if (err && !rc)
}
lsm->lsm_oinfo[0]->loi_id = id;
- lsm->lsm_oinfo[0]->loi_seq = mdt_to_obd_objseq(obd->u.mds.mds_id);
+ lsm->lsm_oinfo[0]->loi_gr = mdt_to_obd_objgrp(obd->u.mds.mds_id);
lsm->lsm_oinfo[0]->loi_ost_idx = idx;
rc = mds_log_op_orphan(obd, lsm, count);
* objects above this ID, they will be removed. */
memset(&oa, 0, sizeof(oa));
oa.o_flags = OBD_FL_DELORPHAN;
- oa.o_seq = mdt_to_obd_objseq(mds->mds_id);
+ oa.o_gr = mdt_to_obd_objgrp(mds->mds_id);
oa.o_valid = OBD_MD_FLFLAGS | OBD_MD_FLGROUP;
if (ost_uuid != NULL)
oti.oti_ost_uuid = ost_uuid;
data->ocd_connect_flags |= OBD_CONNECT_LRU_RESIZE;
#endif
data->ocd_version = LUSTRE_VERSION_CODE;
- data->ocd_group = mdt_to_obd_objseq(mds->mds_id);
+ data->ocd_group = mdt_to_obd_objgrp(mds->mds_id);
/* send max bytes per rpc */
data->ocd_brw_size = PTLRPC_MAX_BRW_PAGES << CFS_PAGE_SHIFT;
/* send the list of supported checksum types */
CERROR("%s failed at update_mds: %d\n", obd_uuid2str(uuid), rc);
GOTO(out, rc);
}
- mgi.group = mdt_to_obd_objseq(mds->mds_id);
+ mgi.group = mdt_to_obd_objgrp(mds->mds_id);
mgi.uuid = uuid;
rc = obd_set_info_async(mds->mds_osc_exp, sizeof(KEY_MDS_CONN),
static void make_capa_key(struct lustre_capa_key *key,
mdsno_t mdsnum, int keyid)
{
- key->lk_seq = mdsnum;
+ key->lk_mdsid = mdsnum;
key->lk_keyid = keyid + 1;
ll_get_random_bytes(key->lk_key, sizeof(key->lk_key));
}
static inline void lck_cpu_to_le(struct lustre_capa_key *tgt,
struct lustre_capa_key *src)
{
- tgt->lk_seq = cpu_to_le64(src->lk_seq);
+ tgt->lk_mdsid = cpu_to_le64(src->lk_mdsid);
tgt->lk_keyid = cpu_to_le32(src->lk_keyid);
tgt->lk_padding = cpu_to_le32(src->lk_padding);
memcpy(tgt->lk_key, src->lk_key, sizeof(src->lk_key));
static inline void lck_le_to_cpu(struct lustre_capa_key *tgt,
struct lustre_capa_key *src)
{
- tgt->lk_seq = le64_to_cpu(src->lk_seq);
+ tgt->lk_mdsid = le64_to_cpu(src->lk_mdsid);
tgt->lk_keyid = le32_to_cpu(src->lk_keyid);
tgt->lk_padding = le32_to_cpu(src->lk_padding);
memcpy(tgt->lk_key, src->lk_key, sizeof(src->lk_key));
for (i = 0, lod = lmm->lmm_objects; i < stripe_count; i++, lod++) {
CDEBUG(level, "stripe %u idx %u subobj "LPX64"/"LPX64"\n",
i, le32_to_cpu(lod->l_ost_idx),
- le64_to_cpu(lod->l_object_seq),
+ le64_to_cpu(lod->l_object_gr),
le64_to_cpu(lod->l_object_id));
}
}
cfs_semaphore_t fsdb_sem;
void *fsdb_ost_index_map; /* bitmap of used indicies */
void *fsdb_mdt_index_map; /* bitmap of used indicies */
- int fsdb_mdt_count;
/* COMPAT_146 these items must be recorded out of the old client log */
char *fsdb_clilov; /* COMPAT_146 client lov name */
char *fsdb_clilmv;
rc = 0;
CDEBUG(D_MGS, "MDT index is %u\n", index);
cfs_set_bit(index, fsdb->fsdb_mdt_index_map);
- fsdb->fsdb_mdt_count ++;
}
/* COMPAT_146 */
0 newly marked as in use
<0 err
+EALREADY for update of an old index */
-static int mgs_set_index(struct obd_device *obd, struct mgs_target_info *mti)
+int mgs_set_index(struct obd_device *obd, struct mgs_target_info *mti)
{
struct fs_db *fsdb;
void *imap;
RETURN(rc);
}
- if (mti->mti_flags & LDD_F_SV_TYPE_OST) {
+ if (mti->mti_flags & LDD_F_SV_TYPE_OST)
imap = fsdb->fsdb_ost_index_map;
- } else if (mti->mti_flags & LDD_F_SV_TYPE_MDT) {
+ else if (mti->mti_flags & LDD_F_SV_TYPE_MDT)
imap = fsdb->fsdb_mdt_index_map;
- if (fsdb->fsdb_mdt_count >= MAX_MDT_COUNT) {
- LCONSOLE_ERROR_MSG(0x13f, "The max mdt count"
- "is %d\n", (int)MAX_MDT_COUNT);
- RETURN(-ERANGE);
- }
- } else {
+ else
RETURN(-EINVAL);
- }
if (mti->mti_flags & LDD_F_NEED_INDEX) {
rc = next_index(imap, INDEX_MAP_SIZE);
if (rc == -1)
RETURN(-ERANGE);
mti->mti_stripe_index = rc;
- if (mti->mti_flags & LDD_F_SV_TYPE_MDT)
- fsdb->fsdb_mdt_count ++;
}
if (mti->mti_stripe_index >= INDEX_MAP_SIZE * 8) {
DIST_SUBDIRS := linux darwin
if LIBLUSTRE
-INCLUDES = -I$(SYSIO)/include
+
noinst_LIBRARIES = liblustreclass.a
liblustreclass_a_SOURCES = class_obd.c debug.c genops.c statfs_pack.c mea.c uuid.c
liblustreclass_a_SOURCES += lustre_handles.c lustre_peer.c lprocfs_status.c
#include <linux/fs.h>
#include <linux/pagemap.h> /* for PAGE_CACHE_SIZE */
+/* WARNING: the file systems must take care not to tinker with
+ attributes they don't manage (such as blocks). */
+void obdo_from_inode(struct obdo *dst, struct inode *src, obd_flag valid)
+{
+ obd_flag newvalid = 0;
+
+ if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME))
+ CDEBUG(D_INODE, "valid %x, new time %lu/%lu\n",
+ valid, LTIME_S(src->i_mtime),
+ LTIME_S(src->i_ctime));
+
+ if (valid & OBD_MD_FLATIME) {
+ dst->o_atime = LTIME_S(src->i_atime);
+ newvalid |= OBD_MD_FLATIME;
+ }
+ if (valid & OBD_MD_FLMTIME) {
+ dst->o_mtime = LTIME_S(src->i_mtime);
+ newvalid |= OBD_MD_FLMTIME;
+ }
+ if (valid & OBD_MD_FLCTIME) {
+ dst->o_ctime = LTIME_S(src->i_ctime);
+ newvalid |= OBD_MD_FLCTIME;
+ }
+ if (valid & OBD_MD_FLSIZE) {
+ dst->o_size = i_size_read(src);
+ newvalid |= OBD_MD_FLSIZE;
+ }
+ if (valid & OBD_MD_FLBLOCKS) { /* allocation of space (x512 bytes) */
+ dst->o_blocks = src->i_blocks;
+ newvalid |= OBD_MD_FLBLOCKS;
+ }
+ if (valid & OBD_MD_FLBLKSZ) { /* optimal block size */
+ dst->o_blksize = 1 << src->i_blkbits;
+ newvalid |= OBD_MD_FLBLKSZ;
+ }
+ if (valid & OBD_MD_FLTYPE) {
+ dst->o_mode = (dst->o_mode & S_IALLUGO)|(src->i_mode & S_IFMT);
+ newvalid |= OBD_MD_FLTYPE;
+ }
+ if (valid & OBD_MD_FLMODE) {
+ dst->o_mode = (dst->o_mode & S_IFMT)|(src->i_mode & S_IALLUGO);
+ newvalid |= OBD_MD_FLMODE;
+ }
+ if (valid & OBD_MD_FLUID) {
+ dst->o_uid = src->i_uid;
+ newvalid |= OBD_MD_FLUID;
+ }
+ if (valid & OBD_MD_FLGID) {
+ dst->o_gid = src->i_gid;
+ newvalid |= OBD_MD_FLGID;
+ }
+ if (valid & OBD_MD_FLFLAGS) {
+ dst->o_flags = src->i_flags;
+ newvalid |= OBD_MD_FLFLAGS;
+ }
+ if (valid & OBD_MD_FLGENER) {
+ dst->o_generation = src->i_generation;
+ newvalid |= OBD_MD_FLGENER;
+ }
+ if (valid & OBD_MD_FLFID) {
+ dst->o_fid = src->i_ino;
+ newvalid |= OBD_MD_FLFID;
+ }
+
+ dst->o_valid |= newvalid;
+}
+EXPORT_SYMBOL(obdo_from_inode);
+
/*FIXME: Just copy from obdo_from_inode*/
void obdo_from_la(struct obdo *dst, struct lu_attr *la, obd_flag valid)
{
{
valid &= src->o_valid;
- LASSERTF(!(valid & (OBD_MD_FLTYPE | OBD_MD_FLGENER | OBD_MD_FLFID |
- OBD_MD_FLID | OBD_MD_FLGROUP)),
- "object "LPU64"/"LPU64", valid %x\n",
- src->o_id, src->o_seq, valid);
-
if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME))
CDEBUG(D_INODE,
"valid "LPX64", cur time %lu/%lu, new "LPU64"/"LPU64"\n",
dst->i_blksize = src->o_blksize;
#endif
}
+ if (valid & OBD_MD_FLTYPE)
+ dst->i_mode = (dst->i_mode & ~S_IFMT) | (src->o_mode & S_IFMT);
if (valid & OBD_MD_FLMODE)
dst->i_mode = (dst->i_mode & S_IFMT) | (src->o_mode & ~S_IFMT);
if (valid & OBD_MD_FLUID)
dst->i_gid = src->o_gid;
if (valid & OBD_MD_FLFLAGS)
dst->i_flags = src->o_flags;
+ if (valid & OBD_MD_FLGENER)
+ dst->i_generation = src->o_generation;
}
EXPORT_SYMBOL(obdo_to_inode);
#endif
RETURN(-EINVAL);
*end = '\0';
- logid->lgl_oseq = simple_strtoull(start, &endp, 0);
+ logid->lgl_ogr = simple_strtoull(start, &endp, 0);
if (endp != end)
RETURN(-EINVAL);
if (rc) {
CDEBUG(D_IOCTL,
"cannot find log #"LPX64"#"LPX64"#%08x\n",
- lir->lid_id.lgl_oid, lir->lid_id.lgl_oseq,
+ lir->lid_id.lgl_oid, lir->lid_id.lgl_ogr,
lir->lid_id.lgl_ogen);
RETURN(rc);
}
l = snprintf(out, remains,
"[index]: %05d [logid]: #"LPX64"#"LPX64"#%08x\n",
cur_index, lir->lid_id.lgl_oid,
- lir->lid_id.lgl_oseq, lir->lid_id.lgl_ogen);
+ lir->lid_id.lgl_ogr, lir->lid_id.lgl_ogen);
} else {
l = snprintf(out, remains,
"[index]: %05d [type]: %02x [len]: %04d\n",
rc = llog_cat_id2handle(cat, &log, logid);
if (rc) {
CDEBUG(D_IOCTL, "cannot find log #"LPX64"#"LPX64"#%08x\n",
- logid->lgl_oid, logid->lgl_oseq, logid->lgl_ogen);
+ logid->lgl_oid, logid->lgl_ogr, logid->lgl_ogen);
GOTO(out, rc = -ENOENT);
}
"flags: %x (%s)\n"
"records count: %d\n"
"last index: %d\n",
- handle->lgh_id.lgl_oid, handle->lgh_id.lgl_oseq,
+ handle->lgh_id.lgl_oid, handle->lgh_id.lgl_ogr,
handle->lgh_id.lgl_ogen,
handle->lgh_hdr->llh_flags,
handle->lgh_hdr->llh_flags &
id = &idarray[i].lci_logid;
l = snprintf(out, remains,
"catalog log: #"LPX64"#"LPX64"#%08x\n",
- id->lgl_oid, id->lgl_oseq, id->lgl_ogen);
+ id->lgl_oid, id->lgl_ogr, id->lgl_ogen);
out += l;
remains -= l;
if (remains <= 0) {
if (logid != NULL) {
dchild = obd_lvfs_fid2dentry(ctxt->loc_exp, logid->lgl_oid,
- logid->lgl_ogen, logid->lgl_oseq);
+ logid->lgl_ogen, logid->lgl_ogr);
if (IS_ERR(dchild)) {
rc = PTR_ERR(dchild);
l_dput(dchild);
rc = -ENOENT;
CERROR("nonexistent log file "LPX64":"LPX64": rc %d\n",
- logid->lgl_oid, logid->lgl_oseq, rc);
+ logid->lgl_oid, logid->lgl_ogr, rc);
GOTO(out, rc);
}
if (IS_ERR(handle->lgh_file))
GOTO(out, rc = PTR_ERR(handle->lgh_file));
- handle->lgh_id.lgl_oseq = 1;
+ handle->lgh_id.lgl_ogr = 1;
handle->lgh_id.lgl_oid =
handle->lgh_file->f_dentry->d_inode->i_ino;
handle->lgh_id.lgl_ogen =
if (oa == NULL)
GOTO(out, rc = -ENOMEM);
- oa->o_seq = FID_SEQ_LLOG;
+ oa->o_gr = FILTER_GROUP_LLOG;
oa->o_valid = OBD_MD_FLGENER | OBD_MD_FLGROUP;
rc = obd_create(ctxt->loc_exp, oa, NULL, NULL);
if (rc)
GOTO(out, rc);
- /* FIXME: rationalize the misuse of o_generation in
- * this API along with mds_obd_{create,destroy}.
- * Hopefully it is only an internal API issue. */
-#define o_generation o_parent_oid
dchild = obd_lvfs_fid2dentry(ctxt->loc_exp, oa->o_id,
- oa->o_generation, oa->o_seq);
+ oa->o_generation, oa->o_gr);
if (IS_ERR(dchild))
GOTO(out, rc = PTR_ERR(dchild));
if (IS_ERR(handle->lgh_file))
GOTO(out, rc = PTR_ERR(handle->lgh_file));
- handle->lgh_id.lgl_oseq = oa->o_seq;
+ handle->lgh_id.lgl_ogr = oa->o_gr;
handle->lgh_id.lgl_oid = oa->o_id;
handle->lgh_id.lgl_ogen = oa->o_generation;
}
RETURN(-ENOMEM);
oa->o_id = handle->lgh_id.lgl_oid;
- oa->o_seq = handle->lgh_id.lgl_oseq;
+ oa->o_gr = handle->lgh_id.lgl_ogr;
oa->o_generation = handle->lgh_id.lgl_ogen;
-#undef o_generation
oa->o_valid = OBD_MD_FLID | OBD_MD_FLGROUP | OBD_MD_FLGENER;
rc = llog_lvfs_close(handle);
{
CDEBUG(D_OTHER, "llogd body: %p\n", d);
CDEBUG(D_OTHER, "\tlgd_logid.lgl_oid: "LPX64"\n", d->lgd_logid.lgl_oid);
- CDEBUG(D_OTHER, "\tlgd_logid.lgl_oseq: "LPX64"\n", d->lgd_logid.lgl_oseq);
+ CDEBUG(D_OTHER, "\tlgd_logid.lgl_ogr: "LPX64"\n", d->lgd_logid.lgl_ogr);
CDEBUG(D_OTHER, "\tlgd_logid.lgl_ogen: %#x\n", d->lgd_logid.lgl_ogen);
CDEBUG(D_OTHER, "\tlgd_ctxt_idx: %#x\n", d->lgd_ctxt_idx);
CDEBUG(D_OTHER, "\tlgd_llh_flags: %#x\n", d->lgd_llh_flags);
ENTRY;
print_llogd_body(d);
__swab64s (&d->lgd_logid.lgl_oid);
- __swab64s (&d->lgd_logid.lgl_oseq);
+ __swab64s (&d->lgd_logid.lgl_ogr);
__swab32s (&d->lgd_logid.lgl_ogen);
__swab32s (&d->lgd_ctxt_idx);
__swab32s (&d->lgd_llh_flags);
__swab64s (&d->lgdc_gen.mnt_cnt);
__swab64s (&d->lgdc_gen.conn_cnt);
__swab64s (&d->lgdc_logid.lgl_oid);
- __swab64s (&d->lgdc_logid.lgl_oseq);
+ __swab64s (&d->lgdc_logid.lgl_ogr);
__swab32s (&d->lgdc_logid.lgl_ogen);
__swab32s (&d->lgdc_ctxt_idx);
}
struct llog_unlink_rec *lur = (struct llog_unlink_rec *)rec;
__swab64s(&lur->lur_oid);
- __swab32s(&lur->lur_oseq);
+ __swab32s(&lur->lur_ogr);
__swab32s(&lur->lur_count);
break;
}
struct llog_setattr_rec *lsr = (struct llog_setattr_rec *)rec;
__swab64s(&lsr->lsr_oid);
- __swab32s(&lsr->lsr_oseq);
+ __swab32s(&lsr->lsr_ogr);
__swab32s(&lsr->lsr_uid);
__swab32s(&lsr->lsr_gid);
break;
struct llog_setattr64_rec *lsr = (struct llog_setattr64_rec *)rec;
__swab64s(&lsr->lsr_oid);
- __swab32s(&lsr->lsr_oseq);
+ __swab32s(&lsr->lsr_ogr);
__swab32s(&lsr->lsr_uid);
__swab32s(&lsr->lsr_gid);
struct llog_logid_rec *lid = (struct llog_logid_rec *)rec;
__swab64s(&lid->lid_id.lgl_oid);
- __swab64s(&lid->lid_id.lgl_oseq);
+ __swab64s(&lid->lid_id.lgl_ogr);
__swab32s(&lid->lid_id.lgl_ogen);
break;
}
CFS_INIT_LIST_HEAD(&obd->obd_final_req_queue);
CFS_INIT_LIST_HEAD(&obd->obd_evict_list);
- llog_group_init(&obd->obd_olg, FID_SEQ_LLOG);
+ llog_group_init(&obd->obd_olg, FILTER_GROUP_LLOG);
len = strlen(uuid);
if (len >= sizeof(obd->obd_uuid)) {
#endif
#ifndef __KERNEL__
-#include "../liblustre/llite_lib.h"
+#include <liblustre.h>
+#include <obd.h>
#else
#include <obd_class.h>
#include <lustre/lustre_idl.h>
#endif
-static void obdo_set_parent_fid(struct obdo *dst, struct lu_fid *parent)
-{
- dst->o_parent_oid = fid_oid(parent);
- dst->o_parent_seq = fid_seq(parent);
- dst->o_parent_ver = fid_ver(parent);
- dst->o_valid |= OBD_MD_FLGENER | OBD_MD_FLFID;
-}
-
-/* WARNING: the file systems must take care not to tinker with
- attributes they don't manage (such as blocks). */
-void obdo_from_inode(struct obdo *dst, struct inode *src, struct lu_fid *parent,
- obd_flag valid)
-{
- obd_flag newvalid = 0;
-
- if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME))
- CDEBUG(D_INODE, "valid %x, new time %lu/%lu\n",
- valid, LTIME_S(src->i_mtime),
- LTIME_S(src->i_ctime));
-
- if (valid & OBD_MD_FLATIME) {
- dst->o_atime = LTIME_S(src->i_atime);
- newvalid |= OBD_MD_FLATIME;
- }
- if (valid & OBD_MD_FLMTIME) {
- dst->o_mtime = LTIME_S(src->i_mtime);
- newvalid |= OBD_MD_FLMTIME;
- }
- if (valid & OBD_MD_FLCTIME) {
- dst->o_ctime = LTIME_S(src->i_ctime);
- newvalid |= OBD_MD_FLCTIME;
- }
- if (valid & OBD_MD_FLSIZE) {
- dst->o_size = src->i_size;
- newvalid |= OBD_MD_FLSIZE;
- }
- if (valid & OBD_MD_FLBLOCKS) { /* allocation of space (x512 bytes) */
- dst->o_blocks = src->i_blocks;
- newvalid |= OBD_MD_FLBLOCKS;
- }
- if (valid & OBD_MD_FLBLKSZ) { /* optimal block size */
- dst->o_blksize = ll_inode_blksize(src);
- newvalid |= OBD_MD_FLBLKSZ;
- }
- if (valid & OBD_MD_FLTYPE) {
- dst->o_mode = (dst->o_mode & S_IALLUGO) |
- (src->i_mode & S_IFMT);
- newvalid |= OBD_MD_FLTYPE;
- }
- if (valid & OBD_MD_FLMODE) {
- dst->o_mode = (dst->o_mode & S_IFMT) |
- (src->i_mode & S_IALLUGO);
- newvalid |= OBD_MD_FLMODE;
- }
- if (valid & OBD_MD_FLUID) {
- dst->o_uid = src->i_uid;
- newvalid |= OBD_MD_FLUID;
- }
- if (valid & OBD_MD_FLGID) {
- dst->o_gid = src->i_gid;
- newvalid |= OBD_MD_FLGID;
- }
- if (valid & OBD_MD_FLFLAGS) {
- dst->o_flags = ll_inode_flags(src);
- newvalid |= OBD_MD_FLFLAGS;
- }
- if (parent)
- obdo_set_parent_fid(dst, parent);
- dst->o_valid |= newvalid;
-}
-EXPORT_SYMBOL(obdo_from_inode);
-
void obdo_cpy_md(struct obdo *dst, struct obdo *src, obd_flag valid)
{
#ifdef __KERNEL__
dst->o_gid = src->o_gid;
if (valid & OBD_MD_FLFLAGS)
dst->o_flags = src->o_flags;
- if (valid & OBD_MD_FLFID) {
- dst->o_parent_seq = src->o_parent_seq;
- dst->o_parent_ver = src->o_parent_ver;
- }
if (valid & OBD_MD_FLGENER)
- dst->o_parent_oid = src->o_parent_oid;
+ dst->o_generation = src->o_generation;
if (valid & OBD_MD_FLHANDLE)
dst->o_handle = src->o_handle;
if (valid & OBD_MD_FLCOOKIE)
res = (res || (dst->o_flags != src->o_flags));
if ( compare & OBD_MD_FLNLINK )
res = (res || (dst->o_nlink != src->o_nlink));
- if ( compare & OBD_MD_FLFID ) {
- res = (res || (dst->o_parent_seq != src->o_parent_seq));
- res = (res || (dst->o_parent_ver != src->o_parent_ver));
- }
if ( compare & OBD_MD_FLGENER )
- res = (res || (dst->o_parent_oid != src->o_parent_oid));
+ res = (res || (dst->o_generation != src->o_generation));
/* XXX Don't know if thses should be included here - wasn't previously
if ( compare & OBD_MD_FLINLINE )
res = (res || memcmp(dst->o_inline, src->o_inline));
{
ioobj->ioo_id = oa->o_id;
if (oa->o_valid & OBD_MD_FLGROUP)
- ioobj->ioo_seq = oa->o_seq;
- else
- ioobj->ioo_seq = 0;
+ ioobj->ioo_gr = oa->o_gr;
+ else
+ ioobj->ioo_gr = 0;
ioobj->ioo_type = oa->o_mode;
}
EXPORT_SYMBOL(obdo_to_ioobj);
static inline void lsm2fid(struct lov_stripe_md *lsm, struct lu_fid *fid)
{
fid_zero(fid);
- fid->f_seq = FID_SEQ_ECHO;
- /* truncated to 32 bits by assignment */
+ fid->f_seq = lsm->lsm_object_gr << 16 | lsm->lsm_object_id >> 32;
fid->f_oid = lsm->lsm_object_id;
- fid->f_ver = lsm->lsm_object_id >> 32;
}
/** @} echo_helpers */
struct lov_oinfo *oinfo = lsm->lsm_oinfo[0];
LASSERT(oinfo != NULL);
oinfo->loi_id = lsm->lsm_object_id;
- oinfo->loi_seq = lsm->lsm_object_seq;
+ oinfo->loi_gr = lsm->lsm_object_gr;
conf->eoc_cl.u.coc_oinfo = oinfo;
} else {
struct lustre_md *md;
if (on_target) {
/* Only echo objects are allowed to be created */
LASSERT((oa->o_valid & OBD_MD_FLGROUP) &&
- (oa->o_seq == FID_SEQ_ECHO));
+ (oa->o_gr == FILTER_GROUP_ECHO));
rc = obd_create(ec->ec_exp, oa, &lsm, oti);
if (rc != 0) {
CERROR("Cannot create objects, rc = %d\n", rc);
lsm->lsm_object_id = oa->o_id;
if (oa->o_valid & OBD_MD_FLGROUP)
- lsm->lsm_object_seq = oa->o_seq;
+ lsm->lsm_object_gr = oa->o_gr;
else
- lsm->lsm_object_seq = FID_SEQ_ECHO;
+ lsm->lsm_object_gr = FILTER_GROUP_ECHO;
rc = 0;
eco = cl_echo_object_find(ed, &lsm);
oa = &data->ioc_obdo1;
if (!(oa->o_valid & OBD_MD_FLGROUP)) {
oa->o_valid |= OBD_MD_FLGROUP;
- oa->o_seq = FID_SEQ_ECHO;
+ oa->o_gr = FILTER_GROUP_ECHO;
}
/* assume we can touch filter native objects with echo device. */
- /* LASSERT(oa->o_seq == FID_SEQ_ECHO); */
+ /* LASSERT(oa->o_gr == FILTER_GROUP_ECHO); */
switch (cmd) {
case OBD_IOC_CREATE: /* may create echo object */
ocd->ocd_connect_flags = OBD_CONNECT_VERSION | OBD_CONNECT_REQPORTAL |
OBD_CONNECT_GRANT;
ocd->ocd_version = LUSTRE_VERSION_CODE;
- ocd->ocd_group = FID_SEQ_ECHO;
+ ocd->ocd_group = FILTER_GROUP_ECHO;
rc = obd_connect(NULL, &ec->ec_exp, tgt, &echo_uuid, ocd, NULL);
if (rc == 0) {
* caller must hold fed_lock and take fmd reference itself */
static struct filter_mod_data *filter_fmd_find_nolock(struct filter_obd *filter,
struct filter_export_data *fed,
- obd_id objid, obd_seq group)
+ obd_id objid, obd_gr group)
{
struct filter_mod_data *found = NULL, *fmd;
/* Find fmd based on objid and group, or return NULL if not found. */
struct filter_mod_data *filter_fmd_find(struct obd_export *exp,
- obd_id objid, obd_seq group)
+ obd_id objid, obd_gr group)
{
struct filter_mod_data *fmd;
* Currently this is not fatal because any fmd state is transient and
* may also be freed when it gets sufficiently old. */
struct filter_mod_data *filter_fmd_get(struct obd_export *exp,
- obd_id objid, obd_seq group)
+ obd_id objid, obd_gr group)
{
struct filter_export_data *fed = &exp->exp_filter_data;
struct filter_mod_data *found = NULL, *fmd_new = NULL;
* This isn't so critical because it would in fact only affect the one client
* that is doing the unlink and at worst we have an stale entry referencing
* an object that should never be used again. */
-static void filter_fmd_drop(struct obd_export *exp, obd_id objid, obd_seq group)
+static void filter_fmd_drop(struct obd_export *exp, obd_id objid, obd_gr group)
{
struct filter_mod_data *found = NULL;
RETURN(rc);
}
-int filter_update_last_objid(struct obd_device *obd, obd_seq group,
+int filter_update_last_objid(struct obd_device *obd, obd_gr group,
int force_sync)
{
struct filter_obd *filter = &obd->u.filter;
ENTRY;
if (filter->fo_last_objid_files[group] == NULL) {
- CERROR("Object seq "LPU64" not fully setup; not updating "
+ CERROR("Object group "LPU64" not fully setup; not updating "
"last_objid\n", group);
RETURN(-EINVAL);
}
- CDEBUG(D_INODE, "%s: server last_objid for "POSTID"\n",
+ CDEBUG(D_INODE, "%s: server last_objid for group "LPU64": "LPU64"\n",
obd->obd_name, group, filter->fo_last_objids[group]);
tmp = cpu_to_le64(filter->fo_last_objids[group]);
rc = fsfilt_write_record(obd, filter->fo_last_objid_files[group],
&tmp, sizeof(tmp), &off, force_sync);
if (rc)
- CERROR("error writing seq "LPU64" last objid: rc = %d\n",
+ CERROR("error writing group "LPU64" last objid: rc = %d\n",
group, rc);
RETURN(rc);
}
GOTO(cleanup, rc);
}
- if (filter->fo_subdir_count && fid_seq_is_mdt(group)) {
+ if (filter->fo_subdir_count && filter_group_is_mds(group)) {
OBD_ALLOC(tmp_subdirs, sizeof(*tmp_subdirs));
if (tmp_subdirs == NULL)
GOTO(cleanup, rc = -ENOMEM);
filter->fo_dentry_O_groups[group] = dentry;
filter->fo_last_objid_files[group] = filp;
- if (filter->fo_subdir_count && fid_seq_is_mdt(group)) {
+ if (filter->fo_subdir_count && filter_group_is_mds(group)) {
filter->fo_dentry_O_sub[group] = *tmp_subdirs;
OBD_FREE(tmp_subdirs, sizeof(*tmp_subdirs));
}
if (new_files != NULL)
OBD_FREE(new_files, len * sizeof(*new_files));
case 3:
- if (filter->fo_subdir_count && fid_seq_is_mdt(group)) {
+ if (filter->fo_subdir_count && filter_group_is_mds(group)) {
for (i = 0; i < filter->fo_subdir_count; i++) {
if (tmp_subdirs->dentry[i] != NULL)
dput(tmp_subdirs->dentry[i]);
}
if (off == 0)
- last_group = FID_SEQ_OST_MDT0;
+ last_group = FILTER_GROUP_MDS0;
CWARN("%s: initialize groups [%d,%d]\n", obd->obd_name,
- FID_SEQ_OST_MDT0, last_group);
+ FILTER_GROUP_MDS0, last_group);
filter->fo_committed_group = last_group;
rc = filter_read_groups(obd, last_group, 1);
if (rc)
}
static void filter_set_last_id(struct filter_obd *filter,
- obd_id id, obd_seq group)
+ obd_id id, obd_gr group)
{
LASSERT(group <= filter->fo_group_count);
cfs_spin_unlock(&filter->fo_objidlock);
}
-obd_id filter_last_id(struct filter_obd *filter, obd_seq group)
+obd_id filter_last_id(struct filter_obd *filter, obd_gr group)
{
obd_id id;
LASSERT(group <= filter->fo_group_count);
}
/* We never dget the object parent, so DON'T dput it either */
-struct dentry *filter_parent(struct obd_device *obd, obd_seq group, obd_id objid)
+struct dentry *filter_parent(struct obd_device *obd, obd_gr group, obd_id objid)
{
struct filter_obd *filter = &obd->u.filter;
struct filter_subdirs *subdirs;
LASSERT(group < filter->fo_group_count); /* FIXME: object groups */
- if (!fid_seq_is_mdt(group) || filter->fo_subdir_count == 0)
+ if (!filter_group_is_mds(group) || filter->fo_subdir_count == 0)
return filter->fo_dentry_O_groups[group];
subdirs = &filter->fo_dentry_O_sub[group];
}
/* We never dget the object parent, so DON'T dput it either */
-struct dentry *filter_parent_lock(struct obd_device *obd, obd_seq group,
+struct dentry *filter_parent_lock(struct obd_device *obd, obd_gr group,
obd_id objid)
{
unsigned long now = jiffies;
* internal to the filesystem code. */
struct dentry *filter_fid2dentry(struct obd_device *obd,
struct dentry *dir_dentry,
- obd_seq group, obd_id id)
+ obd_gr group, obd_id id)
{
struct dentry *dparent = dir_dentry;
struct dentry *dchild;
if (dir_dentry == NULL) {
dparent = filter_parent_lock(obd, group, id);
if (IS_ERR(dparent)) {
- CERROR("%s: error getting object "POSTID
+ CERROR("%s: error getting object "LPU64":"LPU64
" parent: rc %ld\n", obd->obd_name,
id, group, PTR_ERR(dparent));
RETURN(dparent);
* Caller must hold child i_mutex, we drop it always.
* Caller is also required to ensure that dchild->d_inode exists. */
static int filter_destroy_internal(struct obd_device *obd, obd_id objid,
- obd_seq group, struct dentry *dparent,
+ obd_gr group, struct dentry *dparent,
struct dentry *dchild)
{
struct inode *inode = dchild->d_inode;
LASSERT_SPIN_LOCKED(&filter->fo_llog_list_lock);
cfs_list_for_each_entry(olg, &filter->fo_llog_list, olg_list) {
- if (olg->olg_seq == group)
+ if (olg->olg_group == group)
RETURN(olg);
}
RETURN(NULL);
filter = &obd->u.filter;
- if (group == FID_SEQ_LLOG)
+ if (group == FILTER_GROUP_LLOG)
RETURN(&obd->obd_olg);
cfs_spin_lock(&filter->fo_llog_list_lock);
filter = &obd->u.filter;
- if (group == FID_SEQ_LLOG)
+ if (group == FILTER_GROUP_LLOG)
RETURN(&obd->obd_olg);
cfs_spin_lock(&filter->fo_llog_list_lock);
CDEBUG(D_OTHER, "%s: LLog connect for: "LPX64"/"LPX64":%x\n",
obd->obd_name, body->lgdc_logid.lgl_oid,
- body->lgdc_logid.lgl_oseq, body->lgdc_logid.lgl_ogen);
+ body->lgdc_logid.lgl_ogr, body->lgdc_logid.lgl_ogen);
- olg = filter_find_olg(obd, body->lgdc_logid.lgl_oseq);
+ olg = filter_find_olg(obd, body->lgdc_logid.lgl_ogr);
if (!olg) {
CERROR(" %s: can not find olg of group %d\n",
- obd->obd_name, (int)body->lgdc_logid.lgl_oseq);
+ obd->obd_name, (int)body->lgdc_logid.lgl_ogr);
RETURN(-ENOENT);
}
llog_group_set_export(olg, exp);
CWARN("%s: Recovery from log "LPX64"/"LPX64":%x\n",
obd->obd_name, body->lgdc_logid.lgl_oid,
- body->lgdc_logid.lgl_oseq, body->lgdc_logid.lgl_ogen);
+ body->lgdc_logid.lgl_ogr, body->lgdc_logid.lgl_ogen);
cfs_spin_lock_bh(&obd->obd_processing_task_lock);
obd->u.filter.fo_mds_ost_sync = 1;
rc = filter_olg_fini(olg);
if (rc)
CERROR("failed to cleanup llogging subsystem for %u\n",
- olg->olg_seq);
+ olg->olg_group);
OBD_FREE_PTR(olg);
}
}
if (!(exp->exp_flags & OBD_OPT_FORCE))
- filter_grant_sanity_check(exp->exp_obd, __func__);
+ filter_grant_sanity_check(exp->exp_obd, __FUNCTION__);
RETURN(0);
}
group = 1 << 30;
cfs_spin_lock(&filter->fo_llog_list_lock);
cfs_list_for_each_entry(olg, &filter->fo_llog_list, olg_list) {
- if (olg->olg_seq <= worked) {
+ if (olg->olg_group <= worked) {
/* this group is already synced */
continue;
}
- if (group < olg->olg_seq) {
+ if (group < olg->olg_group) {
/* we have group with smaller number to sync */
continue;
}
/* store current minimal group */
olg_min = olg;
- group = olg->olg_seq;
+ group = olg->olg_group;
}
cfs_spin_unlock(&filter->fo_llog_list_lock);
if (olg_min == NULL)
break;
- worked = olg_min->olg_seq;
+ worked = olg_min->olg_group;
if (olg_min->olg_exp &&
(dexp == olg_min->olg_exp || dexp == NULL)) {
int err;
class_export_get(exp);
if (!(exp->exp_flags & OBD_OPT_FORCE))
- filter_grant_sanity_check(obd, __func__);
+ filter_grant_sanity_check(obd, __FUNCTION__);
filter_grant_discard(exp);
/* Flush any remaining cancel messages out to the target */
return 0;
}
-struct dentry *__filter_oa2dentry(struct obd_device *obd, struct ost_id *ostid,
+struct dentry *__filter_oa2dentry(struct obd_device *obd, struct obdo *oa,
const char *what, int quiet)
{
struct dentry *dchild = NULL;
+ obd_gr group = 0;
- dchild = filter_fid2dentry(obd, NULL, ostid->oi_seq, ostid->oi_id);
+ if (oa->o_valid & OBD_MD_FLGROUP)
+ group = oa->o_gr;
+
+ dchild = filter_fid2dentry(obd, NULL, group, oa->o_id);
if (IS_ERR(dchild)) {
- CERROR("%s error looking up object: "POSTID"\n",
- what, ostid->oi_id, ostid->oi_seq);
+ CERROR("%s error looking up object: "LPU64":"LPU64"\n",
+ what, group, oa->o_id);
RETURN(dchild);
}
if (dchild->d_inode == NULL) {
if (!quiet)
- CERROR("%s: %s on non-existent object: "POSTID" \n",
- obd->obd_name, what, ostid->oi_seq,ostid->oi_id);
+ CERROR("%s: %s on non-existent object: "LPU64"\n",
+ obd->obd_name, what, oa->o_id);
f_dput(dchild);
RETURN(ERR_PTR(-ENOENT));
}
int rc = 0;
ENTRY;
- rc = filter_validate_obdo(oinfo->oi_oa, exp);
- if (rc)
- RETURN(rc);
-
- rc = filter_auth_capa(exp, NULL, oinfo->oi_oa->o_seq,
+ LASSERT(oinfo->oi_oa->o_valid & OBD_MD_FLGROUP);
+ rc = filter_auth_capa(exp, NULL, oinfo->oi_oa->o_gr,
oinfo_capa(oinfo), CAPA_OPC_META_READ);
if (rc)
RETURN(rc);
RETURN(-EINVAL);
}
- dentry = filter_oa2dentry(obd, &oinfo->oi_oa->o_oi);
+ dentry = filter_oa2dentry(obd, oinfo->oi_oa);
if (IS_ERR(dentry))
RETURN(PTR_ERR(dentry));
/* Limit the valid bits in the return data to what we actually use */
oinfo->oi_oa->o_valid = OBD_MD_FLID;
- obdo_from_inode(oinfo->oi_oa, dentry->d_inode, NULL, FILTER_VALID_FLAGS);
+ obdo_from_inode(oinfo->oi_oa, dentry->d_inode, FILTER_VALID_FLAGS);
f_dput(dentry);
RETURN(rc);
struct filter_fid ff;
if (!(oa->o_valid & OBD_MD_FLGROUP))
- oa->o_seq = 0;
+ oa->o_gr = 0;
/* packing fid and converting it to LE for storing into EA.
* Here ->o_stripe_idx should be filled by LOV and rest of
* fields - by client. */
- ff.ff_parent.f_seq = cpu_to_le64(oa->o_parent_seq);
- ff.ff_parent.f_oid = cpu_to_le32(oa->o_parent_oid);
- /* XXX: we are ignoring o_parent_ver here, since this should
- * be the same for all objects in this fileset. */
- ff.ff_parent.f_ver = cpu_to_le32(oa->o_stripe_idx);
+ ff.ff_fid.id = cpu_to_le64(oa->o_fid);
+ ff.ff_fid.f_type = cpu_to_le32(oa->o_stripe_idx);
+ ff.ff_fid.generation = cpu_to_le32(oa->o_generation);
ff.ff_objid = cpu_to_le64(oa->o_id);
- ff.ff_seq = cpu_to_le64(oa->o_seq);
+ ff.ff_group = cpu_to_le64(oa->o_gr);
- CDEBUG(D_INODE, "storing filter fid EA (parent "DFID" "
- LPU64"/"LPU64")\n", PFID(&ff.ff_parent), oa->o_id,
- oa->o_seq);
+ CDEBUG(D_INODE, "storing filter fid EA ("LPU64"/%u/%u"
+ LPU64"/"LPU64")\n", oa->o_fid, oa->o_stripe_idx,
+ oa->o_generation, oa->o_id, oa->o_gr);
rc = fsfilt_set_md(obd, inode, handle, &ff, sizeof(ff), "fid");
if (rc)
int rc;
ENTRY;
- rc = filter_validate_obdo(oinfo->oi_oa, exp);
- if (rc)
- RETURN(rc);
-
if (oa->o_valid & OBD_FL_TRUNC)
opc |= CAPA_OPC_OSS_TRUNC;
- rc = filter_auth_capa(exp, NULL, oa->o_seq, capa, opc);
+ LASSERT(oa->o_valid & OBD_MD_FLGROUP);
+ rc = filter_auth_capa(exp, NULL, oa->o_gr, capa, opc);
if (rc)
RETURN(rc);
if (oa->o_valid & (OBD_MD_FLUID | OBD_MD_FLGID)) {
- rc = filter_capa_fixoa(exp, oa, oa->o_seq, capa);
+ rc = filter_capa_fixoa(exp, oa, oa->o_gr, capa);
if (rc)
RETURN(rc);
}
- osc_build_res_name(oa->o_id, oa->o_seq, &res_id);
+ osc_build_res_name(oa->o_id, oa->o_gr, &res_id);
/* This would be very bad - accidentally truncating a file when
* changing the time or similar - bug 12203. */
if (oa->o_valid & OBD_MD_FLSIZE &&
static char mdsinum[48];
if (oa->o_valid & OBD_MD_FLFID)
- snprintf(mdsinum, sizeof(mdsinum) - 1, " of inode "DFID,
- oa->o_parent_seq, oa->o_parent_oid,
- oa->o_parent_ver);
+ snprintf(mdsinum, sizeof(mdsinum) - 1,
+ " of inode "LPU64"/%u", oa->o_fid,
+ oa->o_generation);
else
mdsinum[0] = '\0';
- CERROR("%s: setattr from %s trying to truncate objid "POSTID
- "%s\n", exp->exp_obd->obd_name, obd_export_nid2str(exp),
- oa->o_seq, oa->o_id, mdsinum);
+ CERROR("%s: setattr from %s trying to truncate objid "LPU64
+ " %s\n",
+ exp->exp_obd->obd_name, obd_export_nid2str(exp),
+ oa->o_id, mdsinum);
RETURN(-EPERM);
}
- dentry = __filter_oa2dentry(exp->exp_obd, &oinfo->oi_oa->o_oi, __func__, 1);
+ dentry = __filter_oa2dentry(exp->exp_obd, oa, __FUNCTION__, 1);
if (IS_ERR(dentry))
RETURN(PTR_ERR(dentry));
if (oa->o_valid &
(OBD_MD_FLMTIME | OBD_MD_FLATIME | OBD_MD_FLCTIME)) {
down_write(&dentry->d_inode->i_alloc_sem);
- fmd = filter_fmd_get(exp, oa->o_id, oa->o_seq);
+ fmd = filter_fmd_get(exp, oa->o_id, oa->o_gr);
if (fmd && fmd->fmd_mactime_xid < oti->oti_xid)
fmd->fmd_mactime_xid = oti->oti_xid;
filter_fmd_put(exp, fmd);
oa->o_valid = OBD_MD_FLID;
/* Quota release need uid/gid info */
- obdo_from_inode(oa, dentry->d_inode, NULL,
+ obdo_from_inode(oa, dentry->d_inode,
FILTER_VALID_FLAGS | OBD_MD_FLUID | OBD_MD_FLGID);
EXIT;
RETURN(lsm_size);
}
-/* caller must hold fo_create_locks[oa->o_seq] */
+/* caller must hold fo_create_locks[oa->o_gr] */
static int filter_destroy_precreated(struct obd_export *exp, struct obdo *oa,
struct filter_obd *filter)
{
int skip_orphan;
ENTRY;
- rc = filter_validate_obdo(oa, exp);
- if (rc)
- RETURN(rc);
-
- LASSERT(down_trylock(&filter->fo_create_locks[oa->o_seq]) != 0);
+ LASSERT(oa);
+ LASSERT_MDS_GROUP(oa->o_gr);
+ LASSERT(oa->o_valid & OBD_MD_FLGROUP);
+ LASSERT(down_trylock(&filter->fo_create_locks[oa->o_gr]) != 0);
memset(&doa, 0, sizeof(doa));
doa.o_valid |= OBD_MD_FLGROUP;
- doa.o_seq = oa->o_seq;
+ doa.o_gr = oa->o_gr;
doa.o_mode = S_IFREG;
- if (!cfs_test_bit(doa.o_seq, &filter->fo_destroys_in_progress)) {
+ if (!cfs_test_bit(doa.o_gr, &filter->fo_destroys_in_progress)) {
CERROR("%s:["LPU64"] destroys_in_progress already cleared\n",
- exp->exp_obd->obd_name, doa.o_seq);
+ exp->exp_obd->obd_name, doa.o_gr);
RETURN(0);
}
- last = filter_last_id(filter, doa.o_seq);
+ last = filter_last_id(filter, doa.o_gr);
skip_orphan = !!(exp->exp_connect_flags & OBD_CONNECT_SKIP_ORPHAN);
/* update last_id on disk periodically so that if we restart
* we don't need to re-scan all of the just-deleted objects. */
if ((id & 511) == 0 && !skip_orphan) {
- filter_set_last_id(filter, id - 1, doa.o_seq);
- filter_update_last_objid(exp->exp_obd, doa.o_seq, 0);
+ filter_set_last_id(filter, id - 1, doa.o_gr);
+ filter_update_last_objid(exp->exp_obd, doa.o_gr, 0);
}
}
CDEBUG(D_HA, "%s: after destroy: set last_objids["LPU64"] = "LPU64"\n",
- exp->exp_obd->obd_name, doa.o_seq, oa->o_id);
+ exp->exp_obd->obd_name, doa.o_gr, oa->o_id);
if (!skip_orphan) {
- filter_set_last_id(filter, id, doa.o_seq);
- rc = filter_update_last_objid(exp->exp_obd, doa.o_seq, 1);
+ filter_set_last_id(filter, id, doa.o_gr);
+ rc = filter_update_last_objid(exp->exp_obd, doa.o_gr, 1);
} else {
/* don't reuse orphan object, return last used objid */
oa->o_id = last;
rc = 0;
}
- cfs_clear_bit(doa.o_seq, &filter->fo_destroys_in_progress);
+ cfs_clear_bit(doa.o_gr, &filter->fo_destroys_in_progress);
RETURN(rc);
}
static int filter_precreate(struct obd_device *obd, struct obdo *oa,
- obd_seq group, int *num);
+ obd_gr group, int *num);
/* returns a negative error or a nonnegative number of files to create */
static int filter_handle_precreate(struct obd_export *exp, struct obdo *oa,
- obd_seq group, struct obd_trans_info *oti)
+ obd_gr group, struct obd_trans_info *oti)
{
struct obd_device *obd = exp->exp_obd;
struct filter_obd *filter = &obd->u.filter;
GOTO(out, rc = 0);
}
/* only precreate if group == 0 and o_id is specfied */
- if (!fid_seq_is_mdt(group) || oa->o_id == 0)
+ if (!filter_group_is_mds(group) || oa->o_id == 0)
diff = 1;
else
diff = oa->o_id - filter_last_id(filter, group);
oa->o_id = filter_last_id(&obd->u.filter, group);
rc = filter_precreate(obd, oa, group, &diff);
oa->o_id = filter_last_id(&obd->u.filter, group);
- oa->o_seq = group;
+ oa->o_gr = group;
oa->o_valid = OBD_MD_FLID | OBD_MD_FLGROUP;
GOTO(out, rc);
}
filter->fo_tot_pending,
osfs->os_bfree << blockbits, osfs->os_bavail << blockbits);
- filter_grant_sanity_check(obd, __func__);
+ filter_grant_sanity_check(obd, __FUNCTION__);
osfs->os_bavail -= min(osfs->os_bavail, GRANT_FOR_LLOG(obd) +
((filter->fo_tot_dirty + filter->fo_tot_pending +
* Caller must hold fo_create_locks[group]
*/
static int filter_precreate(struct obd_device *obd, struct obdo *oa,
- obd_seq group, int *num)
+ obd_gr group, int *num)
{
struct dentry *dchild = NULL, *dparent = NULL;
struct filter_obd *filter;
} else
next_id = filter_last_id(filter, group) + 1;
- /* Temporary solution for oid in CMD before fid-on-OST */
- if ((fid_seq_is_mdt0(oa->o_seq) && next_id >= IDIF_MAX_OID) &&
- (fid_seq_is_cmd(oa->o_seq) && next_id >= OBIF_MAX_OID)) {
- CERROR("%s:"POSTID" hit the max IDIF_MAX_OID(1 << 48) !\n",
- obd->obd_name, group, next_id);
- GOTO(cleanup, rc = -ENOSPC);
- }
-
dparent = filter_parent_lock(obd, group, next_id);
if (IS_ERR(dparent))
GOTO(cleanup, rc = PTR_ERR(dparent));
GOTO(cleanup, rc = PTR_ERR(handle));
cleanup_phase = 3;
- CDEBUG(D_INODE, "%s: filter_precreate(od->o_seq="LPU64
+ CDEBUG(D_INODE, "%s: filter_precreate(od->o_gr="LPU64
",od->o_id="LPU64")\n", obd->obd_name, group,
next_id);
*num = i;
CDEBUG(D_RPCTRACE,
- "%s: created %d objects for group "POSTID" rc %d\n",
+ "%s: created %d objects for group "LPU64": "LPU64" rc %d\n",
obd->obd_name, i, group, filter->fo_last_objids[group], rc);
RETURN(rc);
struct filter_obd *filter;
struct lvfs_run_ctxt saved;
struct lov_stripe_md *lsm = NULL;
- int rc = 0, diff;
+ int rc = 0, diff, group = oa->o_gr;
ENTRY;
- rc = filter_validate_obdo(oa, exp);
- if (rc)
- RETURN(rc);
+ CDEBUG(D_INODE, "%s: filter_create(od->o_gr="LPU64",od->o_id="
+ LPU64")\n", obd->obd_name, oa->o_gr, oa->o_id);
- CDEBUG(D_INODE, "%s: filter_create(group="LPU64",id="
- LPU64")\n", obd->obd_name, oa->o_seq, oa->o_id);
+ if (!(oa->o_valid & OBD_MD_FLGROUP)) {
+ CERROR("!!! nid %s sent invalid object group %d\n",
+ obd_export_nid2str(exp), group);
+ RETURN(-EINVAL);
+ }
fed = &exp->exp_filter_data;
filter = &obd->u.filter;
- if (fed->fed_group != oa->o_seq) {
- CERROR("%s: this export (nid %s) used object group %d "
- "earlier; now it's trying to use group "LPU64"!"
- " This could be a bug in the MDS. Please report to "
- "http://bugzilla.lustre.org/\n", obd->obd_name,
- obd_export_nid2str(exp), fed->fed_group, oa->o_seq);
+ if (fed->fed_group != group) {
+ CERROR("!!! this export (nid %s) used object group %d "
+ "earlier; now it's trying to use group %d! This could "
+ "be a bug in the MDS. Please report to "
+ "http://bugzilla.lustre.org/\n",
+ obd_export_nid2str(exp), fed->fed_group, group);
RETURN(-ENOTUNIQ);
}
if ((oa->o_valid & OBD_MD_FLFLAGS) &&
(oa->o_flags & OBD_FL_RECREATE_OBJS)) {
- if (oa->o_id > filter_last_id(filter, oa->o_seq)) {
+ if (oa->o_id > filter_last_id(filter, oa->o_gr)) {
CERROR("recreate objid "LPU64" > last id "LPU64"\n",
- oa->o_id, filter_last_id(filter, oa->o_seq));
+ oa->o_id, filter_last_id(filter,
+ oa->o_gr));
rc = -EINVAL;
} else {
diff = 1;
- cfs_down(&filter->fo_create_locks[oa->o_seq]);
- rc = filter_precreate(obd, oa, oa->o_seq, &diff);
- cfs_up(&filter->fo_create_locks[oa->o_seq]);
+ cfs_down(&filter->fo_create_locks[oa->o_gr]);
+ rc = filter_precreate(obd, oa, oa->o_gr, &diff);
+ cfs_up(&filter->fo_create_locks[oa->o_gr]);
}
} else {
- rc = filter_handle_precreate(exp, oa, oa->o_seq, oti);
+ rc = filter_handle_precreate(exp, oa, oa->o_gr, oti);
}
pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
struct iattr iattr;
ENTRY;
- rc = filter_validate_obdo(oa, exp);
- if (rc)
- RETURN(rc);
- rc = filter_auth_capa(exp, NULL, oa->o_seq,
+ LASSERT(oa->o_valid & OBD_MD_FLGROUP);
+ rc = filter_auth_capa(exp, NULL, oa->o_gr,
(struct lustre_capa *)capa, CAPA_OPC_OSS_DESTROY);
if (rc)
RETURN(rc);
push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
cleanup_phase = 1;
- CDEBUG(D_INODE, "%s: filter_destroy(group="LPU64",oid="
- LPU64")\n", obd->obd_name, oa->o_seq, oa->o_id);
+ CDEBUG(D_INODE, "%s: filter_destroy(od->o_gr="LPU64",od->o_id="
+ LPU64")\n", obd->obd_name, oa->o_gr, oa->o_id);
- dchild = filter_fid2dentry(obd, NULL, oa->o_seq, oa->o_id);
+ dchild = filter_fid2dentry(obd, NULL, oa->o_gr, oa->o_id);
if (IS_ERR(dchild))
GOTO(cleanup, rc = PTR_ERR(dchild));
cleanup_phase = 2;
if (dchild->d_inode == NULL) {
- CDEBUG(D_INODE, "destroying non-existent object "POSTID"\n",
- oa->o_seq, oa->o_id);
+ CDEBUG(D_INODE, "destroying non-existent object "LPU64"\n",
+ oa->o_id);
/* If object already gone, cancel cookie right now */
if (oa->o_valid & OBD_MD_FLCOOKIE) {
struct llog_ctxt *ctxt;
struct obd_llog_group *olg;
- olg = filter_find_olg(obd, oa->o_seq);
+ olg = filter_find_olg(obd, oa->o_gr);
if (!olg) {
CERROR(" %s: can not find olg of group %d\n",
- obd->obd_name, (int)oa->o_seq);
+ obd->obd_name, (int)oa->o_gr);
GOTO(cleanup, rc = PTR_ERR(olg));
}
fcc = &oa->o_lcookie;
GOTO(cleanup, rc = -ENOENT);
}
- rc = filter_prepare_destroy(obd, oa->o_id, oa->o_seq, &lockh);
+ rc = filter_prepare_destroy(obd, oa->o_id, oa->o_gr, &lockh);
if (rc)
GOTO(cleanup, rc);
* here, and not while truncating above. That avoids holding the
* parent lock for a long time during truncate, which can block other
* threads from doing anything to objects in that directory. bug 7171 */
- dparent = filter_parent_lock(obd, oa->o_seq, oa->o_id);
+ dparent = filter_parent_lock(obd, oa->o_gr, oa->o_id);
if (IS_ERR(dparent))
GOTO(cleanup, rc = PTR_ERR(dparent));
cleanup_phase = 3; /* filter_parent_unlock */
cleanup_phase = 4; /* fsfilt_commit */
/* Quota release need uid/gid of inode */
- obdo_from_inode(oa, dchild->d_inode, NULL, OBD_MD_FLUID|OBD_MD_FLGID);
+ obdo_from_inode(oa, dchild->d_inode, OBD_MD_FLUID|OBD_MD_FLGID);
- filter_fmd_drop(exp, oa->o_id, oa->o_seq);
+ filter_fmd_drop(exp, oa->o_id, oa->o_gr);
/* this drops dchild->d_inode->i_mutex unconditionally */
- rc = filter_destroy_internal(obd, oa->o_id, oa->o_seq, dparent, dchild);
+ rc = filter_destroy_internal(obd, oa->o_id, oa->o_gr, dparent, dchild);
EXIT;
cleanup:
}
CDEBUG(D_INODE, "calling truncate for object "LPU64", valid = "LPX64
- ", o_size = "LPD64"\n", oinfo->oi_oa->o_id,oinfo->oi_oa->o_valid,
- oinfo->oi_policy.l_extent.start);
+ ", o_size = "LPD64"\n", oinfo->oi_oa->o_id,
+ oinfo->oi_oa->o_valid, oinfo->oi_policy.l_extent.start);
oinfo->oi_oa->o_size = oinfo->oi_policy.l_extent.start;
oinfo->oi_oa->o_valid |= OBD_FL_TRUNC;
int rc, rc2;
ENTRY;
- rc = filter_validate_obdo(oa, exp);
- if (rc)
- RETURN(rc);
-
- rc = filter_auth_capa(exp, NULL, oa->o_seq,
+ LASSERT(oa->o_valid & OBD_MD_FLGROUP);
+ rc = filter_auth_capa(exp, NULL, oa->o_gr,
(struct lustre_capa *)capa, CAPA_OPC_OSS_WRITE);
if (rc)
RETURN(rc);
RETURN(rc);
}
- dentry = filter_oa2dentry(exp->exp_obd, &oa->o_oi);
+ dentry = filter_oa2dentry(exp->exp_obd, oa);
if (IS_ERR(dentry))
RETURN(PTR_ERR(dentry));
UNLOCK_INODE_MUTEX(dentry->d_inode);
oa->o_valid = OBD_MD_FLID;
- obdo_from_inode(oa, dentry->d_inode, NULL, FILTER_VALID_FLAGS);
+ obdo_from_inode(oa, dentry->d_inode, FILTER_VALID_FLAGS);
pop_ctxt(&saved, &exp->exp_obd->obd_lvfs_ctxt, NULL);
struct lvfs_run_ctxt saved;
int rc;
- rc = filter_validate_obdo(&fm_key->oa, exp);
- if (rc)
- RETURN(rc);
if (fiemap == NULL) {
*vallen = fiemap_count_to_size(
fm_key->fiemap.fm_extent_count);
RETURN(0);
}
- dentry = __filter_oa2dentry(exp->exp_obd, &fm_key->oa.o_oi,
- __func__, 1);
+ dentry = __filter_oa2dentry(exp->exp_obd, &fm_key->oa,
+ __FUNCTION__, 1);
if (IS_ERR(dentry))
RETURN(PTR_ERR(dentry));
else
group = 0; /* default value */
- LASSERT_SEQ_IS_MDT(group);
+ LASSERT_MDS_GROUP(group);
rc = filter_setup_llog_group(exp, obd, group);
if (rc)
goto out;
- if (group == FID_SEQ_OST_MDT0) {
+ if (group == FILTER_GROUP_MDS0) {
/* setup llog group 1 for interop */
- filter_setup_llog_group(exp, obd, FID_SEQ_LLOG);
+ filter_setup_llog_group(exp, obd, FILTER_GROUP_LLOG);
}
lquota_setinfo(filter_quota_interface_ref, obd, exp);
int rc, i;
/** sanity check for group<->mdsno conversion */
- for (i = 0; i < MAX_MDT_COUNT; i++)
- LASSERT(objseq_to_mdsno(mdt_to_obd_objseq(i)) == i);
+ for (i = 0; i < 32; i++)
+ LASSERT(objgrp_to_mdsno(mdt_to_obd_objgrp(i)) == i);
lprocfs_filter_init_vars(&lvars);
cfs_spin_lock(&capa_lock);
cfs_list_for_each_entry(k, &filter->fo_capa_keys, k_list) {
- if (k->k_key.lk_seq != new->lk_seq)
+ if (k->k_key.lk_mdsid != new->lk_mdsid)
continue;
if (keys[0]) {
RETURN(0);
}
-int filter_auth_capa(struct obd_export *exp, struct lu_fid *fid, obd_seq seq,
+int filter_auth_capa(struct obd_export *exp, struct lu_fid *fid, obd_gr group,
struct lustre_capa *capa, __u64 opc)
{
struct obd_device *obd = exp->exp_obd;
struct filter_capa_key *k;
struct lustre_capa_key key;
struct obd_capa *oc;
+ __u64 mdsid;
__u8 *hmac;
int keys_ready = 0, key_found = 0, rc = 0;
ENTRY;
/* skip capa check for llog and obdecho */
- if (!fid_seq_is_mdt(seq))
+ if (!filter_group_is_mds(group))
RETURN(0);
/* capability is disabled */
if (!(exp->exp_connect_flags & OBD_CONNECT_OSS_CAPA))
RETURN(0);
+ mdsid = objgrp_to_mdsno(group);
if (capa == NULL) {
if (fid)
- CERROR("seq/fid/opc "LPU64"/"DFID"/"LPX64
+ CERROR("mdsno/fid/opc "LPU64"/"DFID"/"LPX64
": no capability has been passed\n",
- seq, PFID(fid), opc);
+ mdsid, PFID(fid), opc);
else
- CERROR("seq/opc "LPU64"/"LPX64
+ CERROR("mdsno/opc "LPU64"/"LPX64
": no capability has been passed\n",
- seq, opc);
+ mdsid, opc);
RETURN(-EACCES);
}
cfs_spin_lock(&capa_lock);
cfs_list_for_each_entry(k, &filter->fo_capa_keys, k_list) {
- if (k->k_key.lk_seq == seq) {
+ if (k->k_key.lk_mdsid == mdsid) {
keys_ready = 1;
if (k->k_key.lk_keyid == capa_keyid(capa)) {
key = k->k_key;
RETURN(0);
}
-int filter_capa_fixoa(struct obd_export *exp, struct obdo *oa, obd_seq seq,
+int filter_capa_fixoa(struct obd_export *exp, struct obdo *oa, obd_gr group,
struct lustre_capa *capa)
{
+ __u64 mdsid;
int rc = 0;
ENTRY;
/* skip capa check for llog and obdecho */
- if (!fid_seq_is_mdt(seq))
+ if (!filter_group_is_mds(group))
RETURN(0);
if (!(exp->exp_connect_flags & OBD_CONNECT_OSS_CAPA))
if (unlikely(!capa))
RETURN(-EACCES);
+ mdsid = objgrp_to_mdsno(group);
if (capa_flags(capa) == LC_ID_CONVERT) {
struct obd_device *obd = exp->exp_obd;
struct filter_obd *filter = &obd->u.filter;
cfs_spin_lock(&capa_lock);
cfs_list_for_each_entry(k, &filter->fo_capa_keys, k_list) {
- if (k->k_key.lk_seq == seq &&
+ if (k->k_key.lk_mdsid == mdsid &&
k->k_key.lk_keyid == capa_keyid(capa)) {
found = 1;
break;
#include <lustre_handles.h>
#include <lustre_debug.h>
#include <obd.h>
-#include <obd_class.h>
#include <lprocfs_status.h>
#define FILTER_LAYOUT_VERSION "2"
#define ClearPageConstant(page) do {} while (0)
#endif
-#define POSTID LPU64":"LPU64
-/**
- * Validate ost_id in obdo
- */
-static inline int
-filter_validate_obdo(struct obdo *oa, struct obd_export *exp)
-{
- if (oa != NULL && !(oa->o_valid & OBD_MD_FLGROUP)) {
- oa->o_seq = FID_SEQ_OST_MDT0;
- /* remove fid_seq_is_rsvd() after FID-on-OST allows SEQ > 9 */
- } else if (oa == NULL || !fid_seq_is_rsvd(oa->o_seq)) {
- CERROR("%s: client %s sent invalid object "POSTID"\n",
- exp->exp_obd->obd_name, obd_export_nid2str(exp),
- oa ? oa->o_id : -1, oa ? oa->o_seq : -1);
- return -EPROTO;
- }
- oa->o_seq = ostid_seq(&oa->o_oi);
- oa->o_id = ostid_id(&oa->o_oi);
- return 0;
-}
-
struct filter_mod_data *filter_fmd_find(struct obd_export *exp,
- obd_id objid, obd_seq seq);
+ obd_id objid, obd_gr group);
struct filter_mod_data *filter_fmd_get(struct obd_export *exp,
- obd_id objid, obd_seq seq);
+ obd_id objid, obd_gr group);
void filter_fmd_put(struct obd_export *exp, struct filter_mod_data *fmd);
void filter_fmd_expire(struct obd_export *exp);
/* filter.c */
void f_dput(struct dentry *);
struct dentry *filter_fid2dentry(struct obd_device *, struct dentry *dir,
- obd_seq seq, obd_id id);
-struct dentry *__filter_oa2dentry(struct obd_device *obd, struct ost_id *ostid,
+ obd_gr group, obd_id id);
+struct dentry *__filter_oa2dentry(struct obd_device *obd, struct obdo *oa,
const char *what, int quiet);
-#define filter_oa2dentry(obd, ostid) __filter_oa2dentry(obd, ostid, \
- __func__, 0)
+#define filter_oa2dentry(obd, oa) __filter_oa2dentry(obd, oa, __FUNCTION__, 0)
int filter_finish_transno(struct obd_export *, struct inode *,
struct obd_trans_info *, int rc, int force_sync);
__u64 filter_next_id(struct filter_obd *, struct obdo *);
-__u64 filter_last_id(struct filter_obd *, obd_seq seq);
+__u64 filter_last_id(struct filter_obd *, obd_gr group);
int filter_update_fidea(struct obd_export *exp, struct inode *inode,
void *handle, struct obdo *oa);
int filter_update_server_data(struct obd_device *);
-int filter_update_last_objid(struct obd_device *, obd_seq, int force_sync);
+int filter_update_last_objid(struct obd_device *, obd_gr, int force_sync);
int filter_common_setup(struct obd_device *, struct lustre_cfg *lcfg,
void *option);
int filter_destroy(struct obd_export *exp, struct obdo *oa,
struct dentry *filter_create_object(struct obd_device *obd, struct obdo *oa);
-struct obd_llog_group *filter_find_olg(struct obd_device *obd, int seq);
+struct obd_llog_group *filter_find_olg(struct obd_device *obd, int group);
/* filter_lvb.c */
extern struct ldlm_valblock_ops filter_lvbo;
extern quota_interface_t *filter_quota_interface_ref;
int filter_update_capa_key(struct obd_device *obd, struct lustre_capa_key *key);
-int filter_auth_capa(struct obd_export *exp, struct lu_fid *fid, obd_seq seq,
+int filter_auth_capa(struct obd_export *exp, struct lu_fid *fid, obd_gr group,
struct lustre_capa *capa, __u64 opc);
-int filter_capa_fixoa(struct obd_export *exp, struct obdo *oa, obd_seq seq,
+int filter_capa_fixoa(struct obd_export *exp, struct obdo *oa, obd_gr group,
struct lustre_capa *capa);
void filter_free_capa_keys(struct filter_obd *filter);
LASSERTF(objcount == 1, "%d\n", objcount);
LASSERTF(obj->ioo_bufcnt > 0, "%d\n", obj->ioo_bufcnt);
- rc = filter_validate_obdo(oa, exp);
- if (rc)
- RETURN(rc);
-
- rc = filter_auth_capa(exp, NULL, oa->o_seq, capa,
+ LASSERT(oa->o_valid & OBD_MD_FLGROUP);
+ rc = filter_auth_capa(exp, NULL, oa->o_gr, capa,
CAPA_OPC_OSS_READ);
if (rc)
RETURN(rc);
RETURN(PTR_ERR(iobuf));
push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
- dentry = filter_oa2dentry(obd, &oa->o_oi);
+ dentry = filter_oa2dentry(obd, oa);
if (IS_ERR(dentry)) {
rc = PTR_ERR(dentry);
dentry = NULL;
LASSERT(objcount == 1);
LASSERT(obj->ioo_bufcnt > 0);
- rc = filter_validate_obdo(oa, exp);
- if (rc)
- RETURN(rc);
-
- rc = filter_auth_capa(exp, NULL, oa->o_seq, capa,
+ LASSERT(oa->o_valid & OBD_MD_FLGROUP);
+ rc = filter_auth_capa(exp, NULL, oa->o_gr, capa,
CAPA_OPC_OSS_WRITE);
if (rc)
RETURN(rc);
GOTO(cleanup, rc = PTR_ERR(iobuf));
cleanup_phase = 1;
- dentry = filter_fid2dentry(obd, NULL, obj->ioo_seq,
+ dentry = filter_fid2dentry(obd, NULL, obj->ioo_gr,
obj->ioo_id);
if (IS_ERR(dentry))
GOTO(cleanup, rc = PTR_ERR(dentry));
if (oa->o_valid & (OBD_MD_FLUID | OBD_MD_FLGID) &&
dentry->d_inode->i_mode & (S_ISUID | S_ISGID)) {
- rc = filter_capa_fixoa(exp, oa, oa->o_seq, capa);
+ rc = filter_capa_fixoa(exp, oa, oa->o_gr, capa);
if (rc)
GOTO(cleanup, rc);
}
/* XXX when we start having persistent reservations this needs to
* be changed to filter_fmd_get() to create the fmd if it doesn't
* already exist so we can store the reservation handle there. */
- fmd = filter_fmd_find(exp, obj->ioo_id, obj->ioo_seq);
+ fmd = filter_fmd_find(exp, obj->ioo_id, obj->ioo_gr);
LASSERT(oa != NULL);
cfs_spin_lock(&obd->obd_osfs_lock);
int i;
ENTRY;
- osc_build_res_name(obj->ioo_id, obj->ioo_seq, &res_id);
+ osc_build_res_name(obj->ioo_id, obj->ioo_gr, &res_id);
/* If oa != NULL then filter_preprw_read updated the inode atime
* and we should update the lvb so that other glimpses will also
* get the updated value. bug 5972 */
/* filter_direct_io drops i_mutex */
rc = filter_direct_io(OBD_BRW_WRITE, res->dentry, iobuf, exp, &iattr,
oti, &wait_handle);
-
- obdo_from_inode(oa, inode, NULL, rc == 0 ? FILTER_VALID_FLAGS : 0 |
- OBD_MD_FLUID |OBD_MD_FLGID);
+ if (rc == 0)
+ obdo_from_inode(oa, inode,
+ FILTER_VALID_FLAGS |OBD_MD_FLUID |OBD_MD_FLGID);
+ else
+ obdo_from_inode(oa, inode, OBD_MD_FLUID | OBD_MD_FLGID);
lquota_getflag(filter_quota_interface_ref, obd, oa);
GOTO (out, rc = 0);
}
- olg = filter_find_olg(obd, cookie->lgc_lgl.lgl_oseq);
+ olg = filter_find_olg(obd, cookie->lgc_lgl.lgl_ogr);
if (!olg) {
- CDEBUG(D_HA, "unknown group "LPU64"!\n", cookie->lgc_lgl.lgl_oseq);
+ CDEBUG(D_HA, "unknown group "LPU64"!\n", cookie->lgc_lgl.lgl_ogr);
GOTO(out, rc = 0);
}
ctxt = llog_group_get_ctxt(olg, cookie->lgc_subsys + 1);
if (!ctxt) {
CERROR("no valid context for group "LPU64"\n",
- cookie->lgc_lgl.lgl_oseq);
+ cookie->lgc_lgl.lgl_ogr);
GOTO(out, rc = 0);
}
OBD_FREE(cookie, sizeof(*cookie));
}
-/* Callback for processing the unlink log record received from MDS by
+/* Callback for processing the unlink log record received from MDS by
* llog_client_api. */
static int filter_recov_log_unlink_cb(struct llog_ctxt *ctxt,
struct llog_rec_hdr *rec,
RETURN(-ENOMEM);
oa->o_valid |= OBD_MD_FLCOOKIE;
oa->o_id = lur->lur_oid;
- oa->o_seq = lur->lur_oseq;
+ oa->o_gr = lur->lur_ogr;
oa->o_valid = OBD_MD_FLID | OBD_MD_FLGROUP;
oa->o_lcookie = *cookie;
oid = oa->o_id;
/* objid gap may require to destroy several objects in row */
count = lur->lur_count + 1;
- /* This check is only valid before FID-on-OST and it should
- * be removed after FID-on-OST is implemented */
- if (oa->o_seq > FID_SEQ_OST_MAX) {
- CERROR("%s: invalid group number "LPU64" > MAX_CMD_GROUP %d\n",
- exp->exp_obd->obd_name, oa->o_seq, FID_SEQ_OST_MAX);
- RETURN(-EINVAL);
- }
-
while (count > 0) {
rc = filter_destroy(exp, oa, NULL, NULL, NULL, NULL);
if (rc == 0)
struct llog_setattr_rec *lsr = (struct llog_setattr_rec *)rec;
oinfo.oi_oa->o_id = lsr->lsr_oid;
- oinfo.oi_oa->o_seq = lsr->lsr_oseq;
+ oinfo.oi_oa->o_gr = lsr->lsr_ogr;
oinfo.oi_oa->o_uid = lsr->lsr_uid;
oinfo.oi_oa->o_gid = lsr->lsr_gid;
} else {
struct llog_setattr64_rec *lsr = (struct llog_setattr64_rec *)rec;
oinfo.oi_oa->o_id = lsr->lsr_oid;
- oinfo.oi_oa->o_seq = lsr->lsr_oseq;
+ oinfo.oi_oa->o_gr = lsr->lsr_ogr;
oinfo.oi_oa->o_uid = lsr->lsr_uid;
oinfo.oi_oa->o_gid = lsr->lsr_gid;
}
obd = res->lr_namespace->ns_lvbp;
LASSERT(obd != NULL);
- CDEBUG(D_INODE, "%s: filter_lvbo_init(o_seq="LPU64", o_id="
+ CDEBUG(D_INODE, "%s: filter_lvbo_init(o_gr="LPU64", o_id="
LPU64")\n", obd->obd_name, res->lr_name.name[1],
res->lr_name.name[0]);
count -= rc;
retval += rc;
- for (i = FID_SEQ_OST_MDT1; i < filter->fo_group_count; i++) {
+ for (i = FILTER_GROUP_MDS1_N_BASE; i < filter->fo_group_count; i++) {
rc = snprintf(page, count, LPU64"\n",filter_last_id(filter, i));
if (rc < 0) {
retval = rc;
switch (rc) {
case 0: {
if (body) {
- int diff =ostid_id(&body->oa.o_oi)- oscc->oscc_last_id;
+ int diff = body->oa.o_id - oscc->oscc_last_id;
/* oscc_internal_create() stores the original value of
* grow_count in rq_async_args.space[0].
* next time if needed */
oscc->oscc_flags &= ~OSCC_FLAG_LOW;
}
- oscc->oscc_last_id = ostid_id(&body->oa.o_oi);
+ oscc->oscc_last_id = body->oa.o_id;
}
cfs_spin_unlock(&oscc->oscc_lock);
break;
body = req_capsule_client_get(&request->rq_pill, &RMF_OST_BODY);
cfs_spin_lock(&oscc->oscc_lock);
-
- if (likely(fid_seq_is_mdt(oscc->oscc_oa.o_seq))) {
- body->oa.o_oi.oi_seq = oscc->oscc_oa.o_seq;
- body->oa.o_oi.oi_id = oscc->oscc_last_id +
- oscc->oscc_grow_count;
- } else {
- /*Just warning here currently, since not sure how fid-on-ost
- *will be implemented here */
- CWARN("o_seq: "LPU64" is not indicate any MDTs.\n",
- oscc->oscc_oa.o_seq);
- }
-
+ body->oa.o_id = oscc->oscc_last_id + oscc->oscc_grow_count;
+ body->oa.o_gr = oscc->oscc_oa.o_gr;
+ LASSERT_MDS_GROUP(body->oa.o_gr);
body->oa.o_valid |= OBD_MD_FLID | OBD_MD_FLGROUP;
request->rq_async_args.space[0] = oscc->oscc_grow_count;
cfs_spin_unlock(&oscc->oscc_lock);
struct obdo *oa = oinfo->oi_oa;
ENTRY;
- if ((oa->o_valid & OBD_MD_FLGROUP) && !fid_seq_is_mdt(oa->o_seq)) {
+ if ((oa->o_valid & OBD_MD_FLGROUP) && !filter_group_is_mds(oa->o_gr)) {
rc = osc_real_create(exp, oinfo->oi_oa, ea, oti);
rc = oinfo->oi_cb_up(oinfo, rc);
RETURN(rc);
RETURN(osc_real_create(exp, oa, ea, oti));
}
- if (!fid_seq_is_mdt(oa->o_seq))
+ if (!filter_group_is_mds(oa->o_gr))
RETURN(osc_real_create(exp, oa, ea, oti));
/* this is the special case where create removes orphans */
memset(oa, 0, sizeof(*oa));
if (result == 0) {
oa->o_id = loi->loi_id;
- oa->o_seq = loi->loi_seq;
+ oa->o_gr = loi->loi_gr;
oa->o_mtime = attr->cat_mtime;
oa->o_atime = attr->cat_atime;
oa->o_ctime = attr->cat_ctime;
/**
* Implementation of struct cl_req_operations::cro_attr_set() for osc
- * layer. osc is responsible for struct obdo::o_id and struct obdo::o_seq
+ * layer. osc is responsible for struct obdo::o_id and struct obdo::o_gr
* fields.
*/
static void osc_req_attr_set(const struct lu_env *env,
oa->o_valid |= OBD_MD_FLID;
}
if (flags & OBD_MD_FLGROUP) {
- oa->o_seq = oinfo->loi_seq;
+ oa->o_gr = oinfo->loi_gr;
oa->o_valid |= OBD_MD_FLGROUP;
}
if (flags & OBD_MD_FLHANDLE) {
} else {
/*
* In reality, where ost server expects ->lsm_object_id and
- * ->lsm_object_seq in rename.
+ * ->lsm_object_gr in rename.
*/
- osc_build_res_name(obj->oo_oinfo->loi_id, obj->oo_oinfo->loi_seq,
+ osc_build_res_name(obj->oo_oinfo->loi_id, obj->oo_oinfo->loi_gr,
resname);
}
}
(*p)(env, cookie, "id: "LPU64" gr: "LPU64" "
"idx: %d gen: %d kms_valid: %u kms "LPU64" "
"rc: %d force_sync: %d min_xid: "LPU64" ",
- oinfo->loi_id, oinfo->loi_seq, oinfo->loi_ost_idx,
+ oinfo->loi_id, oinfo->loi_gr, oinfo->loi_ost_idx,
oinfo->loi_ost_gen, oinfo->loi_kms_valid, oinfo->loi_kms,
ar->ar_rc, ar->ar_force_sync, ar->ar_min_xid);
osc_lvb_print(env, cookie, p, &oinfo->loi_lvb);
if (lsm) {
LASSERT(lsm->lsm_object_id);
- LASSERT_SEQ_IS_MDT(lsm->lsm_object_seq);
+ LASSERT_MDS_GROUP(lsm->lsm_object_gr);
(*lmmp)->lmm_object_id = cpu_to_le64(lsm->lsm_object_id);
- (*lmmp)->lmm_object_seq = cpu_to_le64(lsm->lsm_object_seq);
+ (*lmmp)->lmm_object_gr = cpu_to_le64(lsm->lsm_object_gr);
}
RETURN(lmm_size);
if (lmm != NULL) {
/* XXX zero *lsmp? */
(*lsmp)->lsm_object_id = le64_to_cpu (lmm->lmm_object_id);
- (*lsmp)->lsm_object_seq = le64_to_cpu (lmm->lmm_object_seq);
+ (*lsmp)->lsm_object_gr = le64_to_cpu (lmm->lmm_object_gr);
LASSERT((*lsmp)->lsm_object_id);
- LASSERT_SEQ_IS_MDT((*lsmp)->lsm_object_seq);
+ LASSERT_MDS_GROUP((*lsmp)->lsm_object_gr);
}
(*lsmp)->lsm_maxbytes = LUSTRE_STRIPE_MAXBYTES;
* This needs to be fixed in a big way.
*/
lsm->lsm_object_id = oa->o_id;
- lsm->lsm_object_seq = oa->o_seq;
+ lsm->lsm_object_gr = oa->o_gr;
*ea = lsm;
if (oti != NULL) {
int count;
ENTRY;
- osc_build_res_name(oa->o_id, oa->o_seq, &res_id);
+ osc_build_res_name(oa->o_id, oa->o_gr, &res_id);
res = ldlm_resource_get(ns, NULL, &res_id, 0, 0);
if (res == NULL)
RETURN(0);
msg = "changed in transit AND doesn't match the original - "
"likely false positive due to mmap IO (bug 11742)";
- LCONSOLE_ERROR_MSG(0x132, "BAD WRITE CHECKSUM: %s: from %s inode "DFID
- " object "LPU64"/"LPU64" extent ["LPU64"-"LPU64"]\n",
+ LCONSOLE_ERROR_MSG(0x132, "BAD WRITE CHECKSUM: %s: from %s inum "
+ LPU64"/"LPU64" object "LPU64"/"LPU64" extent "
+ "["LPU64"-"LPU64"]\n",
msg, libcfs_nid2str(peer->nid),
- oa->o_valid & OBD_MD_FLFID ? oa->o_parent_seq : (__u64)0,
- oa->o_valid & OBD_MD_FLFID ? oa->o_parent_oid : 0,
- oa->o_valid & OBD_MD_FLFID ? oa->o_parent_ver : 0,
+ oa->o_valid & OBD_MD_FLFID ? oa->o_fid : (__u64)0,
+ oa->o_valid & OBD_MD_FLFID ? oa->o_generation :
+ (__u64)0,
oa->o_id,
- oa->o_valid & OBD_MD_FLGROUP ? oa->o_seq : (__u64)0,
+ oa->o_valid & OBD_MD_FLGROUP ? oa->o_gr : (__u64)0,
pga[0]->off,
pga[page_count-1]->off + pga[page_count-1]->count - 1);
CERROR("original client csum %x (type %x), server csum %x (type %x), "
libcfs_nid2str(peer->nid));
} else if (server_cksum != client_cksum) {
LCONSOLE_ERROR_MSG(0x133, "%s: BAD READ CHECKSUM: from "
- "%s%s%s inode "DFID" object "
+ "%s%s%s inum "LPU64"/"LPU64" object "
LPU64"/"LPU64" extent "
"["LPU64"-"LPU64"]\n",
req->rq_import->imp_obd->obd_name,
libcfs_nid2str(peer->nid),
via, router,
body->oa.o_valid & OBD_MD_FLFID ?
- body->oa.o_parent_seq : (__u64)0,
+ body->oa.o_fid : (__u64)0,
body->oa.o_valid & OBD_MD_FLFID ?
- body->oa.o_parent_oid : 0,
- body->oa.o_valid & OBD_MD_FLFID ?
- body->oa.o_parent_ver : 0,
+ body->oa.o_generation :(__u64)0,
body->oa.o_id,
body->oa.o_valid & OBD_MD_FLGROUP ?
- body->oa.o_seq : (__u64)0,
+ body->oa.o_gr : (__u64)0,
aa->aa_ppga[0]->off,
aa->aa_ppga[aa->aa_page_count-1]->off +
aa->aa_ppga[aa->aa_page_count-1]->count -
struct ldlm_res_id res_id;
struct obd_device *obd = class_exp2obd(exp);
- osc_build_res_name(lsm->lsm_object_id, lsm->lsm_object_seq, &res_id);
+ osc_build_res_name(lsm->lsm_object_id, lsm->lsm_object_gr, &res_id);
ldlm_resource_iterate(obd->obd_namespace, &res_id, replace, data);
return 0;
}
struct obd_device *obd = class_exp2obd(exp);
int rc = 0;
- osc_build_res_name(lsm->lsm_object_id, lsm->lsm_object_seq, &res_id);
+ osc_build_res_name(lsm->lsm_object_id, lsm->lsm_object_gr, &res_id);
rc = ldlm_resource_iterate(obd->obd_namespace, &res_id, replace, data);
if (rc == LDLM_ITER_STOP)
return(1);
ENTRY;
osc_build_res_name(oinfo->oi_md->lsm_object_id,
- oinfo->oi_md->lsm_object_seq, &res_id);
+ oinfo->oi_md->lsm_object_gr, &res_id);
rc = osc_enqueue_base(exp, &res_id, &oinfo->oi_flags, &oinfo->oi_policy,
&oinfo->oi_md->lsm_oinfo[0]->loi_lvb,
if (lsm != NULL) {
resp = osc_build_res_name(lsm->lsm_object_id,
- lsm->lsm_object_seq, &res_id);
+ lsm->lsm_object_gr, &res_id);
}
return ldlm_cli_cancel_unused(obd->obd_namespace, resp, flags, opaque);
}
lumk->lmm_object_id = lsm->lsm_object_id;
- lumk->lmm_object_seq = lsm->lsm_object_seq;
+ lumk->lmm_object_gr = lsm->lsm_object_gr;
lumk->lmm_stripe_count = 1;
if (cfs_copy_to_user(lump, lumk, lum_size))
if (KEY_IS(KEY_MDS_CONN)) {
struct osc_creator *oscc = &obd->u.cli.cl_oscc;
- oscc->oscc_oa.o_seq = (*(__u32 *)val);
+ oscc->oscc_oa.o_gr = (*(__u32 *)val);
oscc->oscc_oa.o_valid |= OBD_MD_FLGROUP;
- LASSERT_SEQ_IS_MDT(oscc->oscc_oa.o_seq);
+ LASSERT_MDS_GROUP(oscc->oscc_oa.o_gr);
req->rq_no_delay = req->rq_no_resend = 1;
req->rq_interpret_reply = osc_setinfo_mds_conn_interpret;
} else if (KEY_IS(KEY_GRANT_SHRINK)) {
CDEBUG(D_INFO, "%s: Init llog for %d - catid "LPX64"/"LPX64":%x\n",
obd->obd_name, *index, catid.lci_logid.lgl_oid,
- catid.lci_logid.lgl_oseq, catid.lci_logid.lgl_ogen);
+ catid.lci_logid.lgl_ogr, catid.lci_logid.lgl_ogen);
rc = __osc_llog_init(obd, olg, disk_obd, &catid);
if (rc) {
struct inode *inode;
inode = osd_sb(osd_dt_dev(dev))->s_root->d_inode;
- LU_IGIF_BUILD(f, inode->i_ino, inode->i_generation);
+ lu_igif_build(f, inode->i_ino, inode->i_generation);
return 0;
}
LINVRNT(osd_invariant(obj));
LASSERT(obj->oo_inode == NULL);
- LASSERT(fid_is_sane(fid) || osd_fid_is_root(fid));
+ LASSERT(fid_is_sane(fid));
/*
* This assertion checks that osd layer sees only local
* fids. Unfortunately it is somewhat expensive (does a
static inline void osd_igif_get(const struct lu_env *env, struct inode *inode,
struct lu_fid *fid)
{
- LU_IGIF_BUILD(fid, inode->i_ino, inode->i_generation);
+ lu_igif_build(fid, inode->i_ino, inode->i_generation);
}
/**
/* struct osd_inode_id */
#include "osd_oi.h"
#include "osd_igif.h"
-#include "osd_internal.h"
void lu_igif_to_id(const struct lu_fid *fid, struct osd_inode_id *id)
{
- LASSERT(osd_fid_is_igif(fid));
+ LASSERT(fid_is_igif(fid));
id->oii_ino = lu_igif_ino(fid);
id->oii_gen = lu_igif_gen(fid);
}
+void lu_igif_build(struct lu_fid *fid, __u32 ino, __u32 gen)
+{
+ fid->f_seq = ino;
+ fid->f_oid = gen;
+ fid->f_ver = 0;
+ LASSERT(fid_is_igif(fid));
+}
#define osd_invariant(obj) (1)
#endif
-/* The on-disk extN format reserves inodes 0-11 for internal filesystem
- * use, and these inodes will be invisible on client side, so the valid
- * sequence for IGIF fid is 12-0xffffffff. But root inode (2#) will be seen
- * on server side (osd), and it should be valid too here.
- */
-#define OSD_ROOT_SEQ 2
-static inline int osd_fid_is_root(const struct lu_fid *fid)
-{
- return fid_seq(fid) == OSD_ROOT_SEQ;
-}
-
-static inline int osd_fid_is_igif(const struct lu_fid *fid)
-{
- return fid_is_igif(fid) || osd_fid_is_root(fid);
-}
-
#endif /* __KERNEL__ */
#endif /* _OSD_INTERNAL_H */
struct lu_fid *oi_fid = &info->oti_fid;
int rc;
- if (osd_fid_is_igif(fid)) {
+ if (fid_is_igif(fid)) {
lu_igif_to_id(fid, id);
rc = 0;
} else {
struct osd_inode_id *id;
const struct dt_key *key;
- if (osd_fid_is_igif(fid))
+ if (fid_is_igif(fid))
return 0;
if (fid_is_oi_fid(fid))
struct dt_object *idx;
const struct dt_key *key;
- if (osd_fid_is_igif(fid))
+ if (fid_is_igif(fid))
return 0;
idx = oi->oi_dir;
__u64 start, __u64 count, struct lustre_handle *lh,
int mode, int flags)
{
- struct ldlm_res_id res_id;
+ struct ldlm_res_id res_id = { .name = { oa->o_id, 0, oa->o_gr, 0} };
ldlm_policy_data_t policy;
__u64 end = start + count;
!(oa->o_flags & OBD_FL_SRVLOCK))
RETURN(0);
- osc_build_res_name(oa->o_id, oa->o_seq, &res_id);
CDEBUG(D_INODE, "OST-side extent lock.\n");
policy.l_extent.start = start & CFS_PAGE_MASK;
int i;
ENTRY;
- osc_build_res_name(obj->ioo_id, obj->ioo_seq, &res_id);
+ osc_build_res_name(obj->ioo_id, obj->ioo_gr, &res_id);
LASSERT(mode == LCK_PR || mode == LCK_PW);
LASSERT(!lustre_handle_is_used(lh));
struct ost_prolong_data opd = { 0 };
ENTRY;
- osc_build_res_name(obj->ioo_id, obj->ioo_seq, &res_id);
+ osc_build_res_name(obj->ioo_id, obj->ioo_gr, &res_id);
opd.opd_mode = mode;
opd.opd_exp = req->rq_export;
}
LCONSOLE_ERROR_MSG(0x168, "%s: BAD WRITE CHECKSUM: %s from "
- "%s%s%s inode "DFID" object "
+ "%s%s%s inum "LPU64"/"LPU64" object "
LPU64"/"LPU64" extent ["LPU64"-"LPU64"]\n",
exp->exp_obd->obd_name, msg,
libcfs_id2str(req->rq_peer),
via, router,
body->oa.o_valid & OBD_MD_FLFID ?
- body->oa.o_parent_seq : (__u64)0,
- body->oa.o_valid & OBD_MD_FLFID ?
- body->oa.o_parent_oid : 0,
+ body->oa.o_fid : (__u64)0,
body->oa.o_valid & OBD_MD_FLFID ?
- body->oa.o_parent_ver : 0,
+ body->oa.o_generation :(__u64)0,
body->oa.o_id,
body->oa.o_valid & OBD_MD_FLGROUP ?
- body->oa.o_seq : (__u64)0,
+ body->oa.o_gr : (__u64)0,
local_nb[0].offset,
local_nb[npages-1].offset +
local_nb[npages-1].len - 1 );
nb[ioo->ioo_bufcnt - 1].len - 1) | ~CFS_PAGE_MASK;
LASSERT(lock->l_resource != NULL);
- if (!osc_res_name_eq(ioo->ioo_id, ioo->ioo_seq,
+ if (!osc_res_name_eq(ioo->ioo_id, ioo->ioo_gr,
&lock->l_resource->lr_name))
RETURN(0);
l = snprintf(out, remains, "\t[Log ID]: #"LPX64"#"LPX64"#%08x\n"
"\tLog Size: %llu\n\tLast Index: %d\n"
"\tUncanceled Records: %d\n",
- logid->lgl_oid, logid->lgl_oseq, logid->lgl_ogen,
+ logid->lgl_oid, logid->lgl_ogr, logid->lgl_ogen,
i_size_read(handle->lgh_file->f_dentry->d_inode),
handle->lgh_last_idx, count);
out += l;
"\n[Catlog ID]: #"LPX64"#"LPX64"#%08x "
"[Log Count]: %d\n",
idarray[i].lci_logid.lgl_oid,
- idarray[i].lci_logid.lgl_oseq,
+ idarray[i].lci_logid.lgl_ogr,
idarray[i].lci_logid.lgl_ogen, uncanceled);
data.out += l;
{
__swab64s (&o->o_valid);
__swab64s (&o->o_id);
- __swab64s (&o->o_seq);
- __swab64s (&o->o_parent_seq);
+ __swab64s (&o->o_gr);
+ __swab64s (&o->o_fid);
__swab64s (&o->o_size);
__swab64s (&o->o_mtime);
__swab64s (&o->o_atime);
__swab32s (&o->o_gid);
__swab32s (&o->o_flags);
__swab32s (&o->o_nlink);
- __swab32s (&o->o_parent_oid);
+ __swab32s (&o->o_generation);
__swab32s (&o->o_misc);
__swab64s (&o->o_ioepoch);
__swab32s (&o->o_stripe_idx);
- __swab32s (&o->o_parent_ver);
- /* o_handle is opaque */
- /* o_lcookie is swabbed elsewhere */
- CLASSERT(offsetof(typeof(*o), o_padding_2) != 0);
- CLASSERT(offsetof(typeof(*o), o_padding_3) != 0);
- CLASSERT(offsetof(typeof(*o), o_padding_4) != 0);
- CLASSERT(offsetof(typeof(*o), o_padding_5) != 0);
- CLASSERT(offsetof(typeof(*o), o_padding_6) != 0);
-
+ __swab32s (&o->o_padding_1);
+ /* o_inline is opaque */
}
void lustre_swab_obd_statfs (struct obd_statfs *os)
__swab32s (&os->os_namelen);
__swab64s (&os->os_maxbytes);
__swab32s (&os->os_state);
- CLASSERT(offsetof(typeof(*os), os_spare1) != 0);
- CLASSERT(offsetof(typeof(*os), os_spare2) != 0);
- CLASSERT(offsetof(typeof(*os), os_spare3) != 0);
- CLASSERT(offsetof(typeof(*os), os_spare4) != 0);
- CLASSERT(offsetof(typeof(*os), os_spare5) != 0);
- CLASSERT(offsetof(typeof(*os), os_spare6) != 0);
- CLASSERT(offsetof(typeof(*os), os_spare7) != 0);
- CLASSERT(offsetof(typeof(*os), os_spare8) != 0);
- CLASSERT(offsetof(typeof(*os), os_spare9) != 0);
+ /* no need to swap os_spare */
}
void lustre_swab_obd_ioobj (struct obd_ioobj *ioo)
{
__swab64s (&ioo->ioo_id);
- __swab64s (&ioo->ioo_seq);
+ __swab64s (&ioo->ioo_gr);
__swab32s (&ioo->ioo_type);
__swab32s (&ioo->ioo_bufcnt);
}
__swab32s (&b->aclsize);
__swab32s (&b->max_mdsize);
__swab32s (&b->max_cookiesize);
- CLASSERT(offsetof(typeof(*b), padding_4) != 0);
+ __swab32s (&b->padding_4);
}
void lustre_swab_mdt_body (struct mdt_body *b)
__swab32s (&b->aclsize);
__swab32s (&b->max_mdsize);
__swab32s (&b->max_cookiesize);
- CLASSERT(offsetof(typeof(*b), padding_4) != 0);
+ __swab32s (&b->padding_4);
}
void lustre_swab_mdt_ioepoch (struct mdt_ioepoch *b)
__swab64s (&rr->rr_blocks);
__swab32s (&rr->rr_bias);
__swab32s (&rr->rr_mode);
+ __swab32s (&rr->rr_padding_1);
+ __swab32s (&rr->rr_padding_2);
+ __swab32s (&rr->rr_padding_3);
+ __swab32s (&rr->rr_padding_4);
CLASSERT(offsetof(typeof(*rr), rr_padding_1) != 0);
CLASSERT(offsetof(typeof(*rr), rr_padding_2) != 0);
CDEBUG(D_OTHER, "\tlmm_magic: %#x\n", lum->lmm_magic);
CDEBUG(D_OTHER, "\tlmm_pattern: %#x\n", lum->lmm_pattern);
CDEBUG(D_OTHER, "\tlmm_object_id: "LPU64"\n", lum->lmm_object_id);
- CDEBUG(D_OTHER, "\tlmm_object_gr: "LPU64"\n", lum->lmm_object_seq);
+ CDEBUG(D_OTHER, "\tlmm_object_gr: "LPU64"\n", lum->lmm_object_gr);
CDEBUG(D_OTHER, "\tlmm_stripe_size: %#x\n", lum->lmm_stripe_size);
CDEBUG(D_OTHER, "\tlmm_stripe_count: %#x\n", lum->lmm_stripe_count);
CDEBUG(D_OTHER, "\tlmm_stripe_offset: %#x\n", lum->lmm_stripe_offset);
__swab32s(&lum->lmm_magic);
__swab32s(&lum->lmm_pattern);
__swab64s(&lum->lmm_object_id);
- __swab64s(&lum->lmm_object_seq);
+ __swab64s(&lum->lmm_object_gr);
__swab32s(&lum->lmm_stripe_size);
__swab16s(&lum->lmm_stripe_count);
__swab16s(&lum->lmm_stripe_offset);
__swab32s(&lmm->lmm_magic);
__swab32s(&lmm->lmm_pattern);
__swab64s(&lmm->lmm_object_id);
- __swab64s(&lmm->lmm_object_seq);
+ __swab64s(&lmm->lmm_object_gr);
__swab32s(&lmm->lmm_stripe_size);
__swab32s(&lmm->lmm_stripe_count);
EXIT;
ENTRY;
for (i = 0; i < stripe_count; i++) {
__swab64s(&(lod[i].l_object_id));
- __swab64s(&(lod[i].l_object_seq));
+ __swab64s(&(lod[i].l_object_gr));
__swab32s(&(lod[i].l_ost_gen));
__swab32s(&(lod[i].l_ost_idx));
}
__swab32s (&d->qd_flags);
__swab64s (&d->qd_count);
__swab64s (&d->qd_qunit);
- CLASSERT(offsetof(typeof(*d), padding) != 0);
+ __swab64s (&d->padding);
}
/* Dump functions */
void dump_ioo(struct obd_ioobj *ioo)
{
CDEBUG(D_RPCTRACE,
- "obd_ioobj: ioo_id="LPD64", ioo_seq="LPD64", ioo_type=%d, "
- "ioo_bufct=%d\n", ioo->ioo_id, ioo->ioo_seq, ioo->ioo_type,
+ "obd_ioobj: ioo_id="LPD64", ioo_gr="LPD64", ioo_type=%d, "
+ "ioo_bufct=%d\n", ioo->ioo_id, ioo->ioo_gr, ioo->ioo_type,
ioo->ioo_bufcnt);
}
if (valid & OBD_MD_FLID)
CDEBUG(D_RPCTRACE, "obdo: o_id = "LPD64"\n", oa->o_id);
if (valid & OBD_MD_FLGROUP)
- CDEBUG(D_RPCTRACE, "obdo: o_seq = "LPD64"\n", oa->o_seq);
+ CDEBUG(D_RPCTRACE, "obdo: o_gr = "LPD64"\n", oa->o_gr);
if (valid & OBD_MD_FLFID)
- CDEBUG(D_RPCTRACE, "obdo: o_parent_seq = "LPX64"\n",
- oa->o_parent_seq);
+ CDEBUG(D_RPCTRACE, "obdo: o_fid = "LPD64"\n", oa->o_fid);
if (valid & OBD_MD_FLSIZE)
CDEBUG(D_RPCTRACE, "obdo: o_size = "LPD64"\n", oa->o_size);
if (valid & OBD_MD_FLMTIME)
if (valid & OBD_MD_FLNLINK)
CDEBUG(D_RPCTRACE, "obdo: o_nlink = %u\n", oa->o_nlink);
else if (valid & OBD_MD_FLCKSUM)
- CDEBUG(D_RPCTRACE, "obdo: o_checksum (o_nlink) = %u\n",
- oa->o_nlink);
+ CDEBUG(D_RPCTRACE, "obdo: o_checksum (o_nlink) = %u\n", oa->o_nlink);
if (valid & OBD_MD_FLGENER)
- CDEBUG(D_RPCTRACE, "obdo: o_parent_oid = %x\n",
- oa->o_parent_oid);
- if (valid & OBD_MD_FLEPOCH)
- CDEBUG(D_RPCTRACE, "obdo: o_ioepoch = "LPD64"\n",
- oa->o_ioepoch);
- if (valid & OBD_MD_FLFID) {
- CDEBUG(D_RPCTRACE, "obdo: o_stripe_idx = %u\n",
- oa->o_stripe_idx);
- CDEBUG(D_RPCTRACE, "obdo: o_parent_ver = %x\n",
- oa->o_parent_ver);
- }
+ CDEBUG(D_RPCTRACE, "obdo: o_generation = %u\n",
+ oa->o_generation);
+ else if (valid & OBD_MD_FLEPOCH)
+ CDEBUG(D_RPCTRACE, "obdo: o_ioepoch = "LPD64"\n", oa->o_ioepoch);
+ if (valid & OBD_MD_FLID)
+ CDEBUG(D_RPCTRACE, "obdo: o_stripe_idx = %u\n", oa->o_stripe_idx);
if (valid & OBD_MD_FLHANDLE)
- CDEBUG(D_RPCTRACE, "obdo: o_handle = "LPD64"\n",
- oa->o_handle.cookie);
+ CDEBUG(D_RPCTRACE, "obdo: o_handle = "LPD64"\n", oa->o_handle.cookie);
if (valid & OBD_MD_FLCOOKIE)
CDEBUG(D_RPCTRACE, "obdo: o_lcookie = "
"(llog_cookie dumping not yet implemented)\n");
void lustre_swab_lustre_capa_key(struct lustre_capa_key *k)
{
- __swab64s (&k->lk_seq);
+ __swab64s (&k->lk_mdsid);
__swab32s (&k->lk_keyid);
- CLASSERT(offsetof(typeof(*k), lk_padding) != 0);
+ __swab32s (&k->lk_padding);
}
void lustre_swab_kuch(struct kuc_hdr *l)
(long long)(int)offsetof(struct obdo, o_id));
LASSERTF((int)sizeof(((struct obdo *)0)->o_id) == 8, " found %lld\n",
(long long)(int)sizeof(((struct obdo *)0)->o_id));
- LASSERTF((int)offsetof(struct obdo, o_seq) == 16, " found %lld\n",
- (long long)(int)offsetof(struct obdo, o_seq));
- LASSERTF((int)sizeof(((struct obdo *)0)->o_seq) == 8, " found %lld\n",
- (long long)(int)sizeof(((struct obdo *)0)->o_seq));
- LASSERTF((int)offsetof(struct obdo, o_parent_seq) == 24, " found %lld\n",
- (long long)(int)offsetof(struct obdo, o_parent_seq));
- LASSERTF((int)sizeof(((struct obdo *)0)->o_parent_seq) == 8, " found %lld\n",
- (long long)(int)sizeof(((struct obdo *)0)->o_parent_seq));
+ LASSERTF((int)offsetof(struct obdo, o_gr) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct obdo, o_gr));
+ LASSERTF((int)sizeof(((struct obdo *)0)->o_gr) == 8, " found %lld\n",
+ (long long)(int)sizeof(((struct obdo *)0)->o_gr));
+ LASSERTF((int)offsetof(struct obdo, o_fid) == 24, " found %lld\n",
+ (long long)(int)offsetof(struct obdo, o_fid));
+ LASSERTF((int)sizeof(((struct obdo *)0)->o_fid) == 8, " found %lld\n",
+ (long long)(int)sizeof(((struct obdo *)0)->o_fid));
LASSERTF((int)offsetof(struct obdo, o_size) == 32, " found %lld\n",
(long long)(int)offsetof(struct obdo, o_size));
LASSERTF((int)sizeof(((struct obdo *)0)->o_size) == 8, " found %lld\n",
(long long)(int)offsetof(struct obdo, o_nlink));
LASSERTF((int)sizeof(((struct obdo *)0)->o_nlink) == 4, " found %lld\n",
(long long)(int)sizeof(((struct obdo *)0)->o_nlink));
- LASSERTF((int)offsetof(struct obdo, o_parent_oid) == 104, " found %lld\n",
- (long long)(int)offsetof(struct obdo, o_parent_oid));
- LASSERTF((int)sizeof(((struct obdo *)0)->o_parent_oid) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct obdo *)0)->o_parent_oid));
+ LASSERTF((int)offsetof(struct obdo, o_generation) == 104, " found %lld\n",
+ (long long)(int)offsetof(struct obdo, o_generation));
+ LASSERTF((int)sizeof(((struct obdo *)0)->o_generation) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct obdo *)0)->o_generation));
LASSERTF((int)offsetof(struct obdo, o_misc) == 108, " found %lld\n",
(long long)(int)offsetof(struct obdo, o_misc));
LASSERTF((int)sizeof(((struct obdo *)0)->o_misc) == 4, " found %lld\n",
(long long)(int)offsetof(struct obdo, o_stripe_idx));
LASSERTF((int)sizeof(((struct obdo *)0)->o_stripe_idx) == 4, " found %lld\n",
(long long)(int)sizeof(((struct obdo *)0)->o_stripe_idx));
- LASSERTF((int)offsetof(struct obdo, o_parent_ver) == 124, " found %lld\n",
- (long long)(int)offsetof(struct obdo, o_parent_ver));
- LASSERTF((int)sizeof(((struct obdo *)0)->o_parent_ver) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct obdo *)0)->o_parent_ver));
+ LASSERTF((int)offsetof(struct obdo, o_padding_1) == 124, " found %lld\n",
+ (long long)(int)offsetof(struct obdo, o_padding_1));
+ LASSERTF((int)sizeof(((struct obdo *)0)->o_padding_1) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct obdo *)0)->o_padding_1));
LASSERTF((int)offsetof(struct obdo, o_handle) == 128, " found %lld\n",
(long long)(int)offsetof(struct obdo, o_handle));
LASSERTF((int)sizeof(((struct obdo *)0)->o_handle) == 8, " found %lld\n",
(long long)(int)offsetof(struct lov_mds_md_v1, lmm_object_id));
LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_object_id) == 8, " found %lld\n",
(long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_object_id));
- LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_object_seq) == 16, " found %lld\n",
- (long long)(int)offsetof(struct lov_mds_md_v1, lmm_object_seq));
- LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_object_seq) == 8, " found %lld\n",
- (long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_object_seq));
+ LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_object_gr) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct lov_mds_md_v1, lmm_object_gr));
+ LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_object_gr) == 8, " found %lld\n",
+ (long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_object_gr));
LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_stripe_size) == 24, " found %lld\n",
(long long)(int)offsetof(struct lov_mds_md_v1, lmm_stripe_size));
LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_stripe_size) == 4, " found %lld\n",
(long long)(int)offsetof(struct lov_ost_data_v1, l_object_id));
LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_id) == 8, " found %lld\n",
(long long)(int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_id));
- LASSERTF((int)offsetof(struct lov_ost_data_v1, l_object_seq) == 8, " found %lld\n",
- (long long)(int)offsetof(struct lov_ost_data_v1, l_object_seq));
- LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_seq) == 8, " found %lld\n",
- (long long)(int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_seq));
+ LASSERTF((int)offsetof(struct lov_ost_data_v1, l_object_gr) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct lov_ost_data_v1, l_object_gr));
+ LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_gr) == 8, " found %lld\n",
+ (long long)(int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_gr));
LASSERTF((int)offsetof(struct lov_ost_data_v1, l_ost_gen) == 16, " found %lld\n",
(long long)(int)offsetof(struct lov_ost_data_v1, l_ost_gen));
LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_gen) == 4, " found %lld\n",
(long long)(int)offsetof(struct lov_mds_md_v3, lmm_object_id));
LASSERTF((int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_object_id) == 8, " found %lld\n",
(long long)(int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_object_id));
- LASSERTF((int)offsetof(struct lov_mds_md_v3, lmm_object_seq) == 16, " found %lld\n",
- (long long)(int)offsetof(struct lov_mds_md_v3, lmm_object_seq));
- LASSERTF((int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_object_seq) == 8, " found %lld\n",
- (long long)(int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_object_seq));
+ LASSERTF((int)offsetof(struct lov_mds_md_v3, lmm_object_gr) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct lov_mds_md_v3, lmm_object_gr));
+ LASSERTF((int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_object_gr) == 8, " found %lld\n",
+ (long long)(int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_object_gr));
LASSERTF((int)offsetof(struct lov_mds_md_v3, lmm_stripe_size) == 24, " found %lld\n",
(long long)(int)offsetof(struct lov_mds_md_v3, lmm_stripe_size));
LASSERTF((int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_stripe_size) == 4, " found %lld\n",
(long long)(int)offsetof(struct lov_ost_data_v1, l_object_id));
LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_id) == 8, " found %lld\n",
(long long)(int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_id));
- LASSERTF((int)offsetof(struct lov_ost_data_v1, l_object_seq) == 8, " found %lld\n",
- (long long)(int)offsetof(struct lov_ost_data_v1, l_object_seq));
- LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_seq) == 8, " found %lld\n",
- (long long)(int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_seq));
+ LASSERTF((int)offsetof(struct lov_ost_data_v1, l_object_gr) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct lov_ost_data_v1, l_object_gr));
+ LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_gr) == 8, " found %lld\n",
+ (long long)(int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_gr));
LASSERTF((int)offsetof(struct lov_ost_data_v1, l_ost_gen) == 16, " found %lld\n",
(long long)(int)offsetof(struct lov_ost_data_v1, l_ost_gen));
LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_gen) == 4, " found %lld\n",
(long long)(int)offsetof(struct obd_ioobj, ioo_id));
LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_id) == 8, " found %lld\n",
(long long)(int)sizeof(((struct obd_ioobj *)0)->ioo_id));
- LASSERTF((int)offsetof(struct obd_ioobj, ioo_seq) == 8, " found %lld\n",
- (long long)(int)offsetof(struct obd_ioobj, ioo_seq));
- LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_seq) == 8, " found %lld\n",
- (long long)(int)sizeof(((struct obd_ioobj *)0)->ioo_seq));
+ LASSERTF((int)offsetof(struct obd_ioobj, ioo_gr) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct obd_ioobj, ioo_gr));
+ LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_gr) == 8, " found %lld\n",
+ (long long)(int)sizeof(((struct obd_ioobj *)0)->ioo_gr));
LASSERTF((int)offsetof(struct obd_ioobj, ioo_type) == 16, " found %lld\n",
(long long)(int)offsetof(struct obd_ioobj, ioo_type));
LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_type) == 4, " found %lld\n",
(long long)(int)offsetof(struct llog_logid, lgl_oid));
LASSERTF((int)sizeof(((struct llog_logid *)0)->lgl_oid) == 8, " found %lld\n",
(long long)(int)sizeof(((struct llog_logid *)0)->lgl_oid));
- LASSERTF((int)offsetof(struct llog_logid, lgl_oseq) == 8, " found %lld\n",
- (long long)(int)offsetof(struct llog_logid, lgl_oseq));
- LASSERTF((int)sizeof(((struct llog_logid *)0)->lgl_oseq) == 8, " found %lld\n",
- (long long)(int)sizeof(((struct llog_logid *)0)->lgl_oseq));
+ LASSERTF((int)offsetof(struct llog_logid, lgl_ogr) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct llog_logid, lgl_ogr));
+ LASSERTF((int)sizeof(((struct llog_logid *)0)->lgl_ogr) == 8, " found %lld\n",
+ (long long)(int)sizeof(((struct llog_logid *)0)->lgl_ogr));
LASSERTF((int)offsetof(struct llog_logid, lgl_ogen) == 16, " found %lld\n",
(long long)(int)offsetof(struct llog_logid, lgl_ogen));
LASSERTF((int)sizeof(((struct llog_logid *)0)->lgl_ogen) == 4, " found %lld\n",
(long long)(int)offsetof(struct llog_create_rec, lcr_oid));
LASSERTF((int)sizeof(((struct llog_create_rec *)0)->lcr_oid) == 8, " found %lld\n",
(long long)(int)sizeof(((struct llog_create_rec *)0)->lcr_oid));
- LASSERTF((int)offsetof(struct llog_create_rec, lcr_oseq) == 40, " found %lld\n",
- (long long)(int)offsetof(struct llog_create_rec, lcr_oseq));
- LASSERTF((int)sizeof(((struct llog_create_rec *)0)->lcr_oseq) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct llog_create_rec *)0)->lcr_oseq));
+ LASSERTF((int)offsetof(struct llog_create_rec, lcr_ogr) == 40, " found %lld\n",
+ (long long)(int)offsetof(struct llog_create_rec, lcr_ogr));
+ LASSERTF((int)sizeof(((struct llog_create_rec *)0)->lcr_ogr) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct llog_create_rec *)0)->lcr_ogr));
LASSERTF((int)offsetof(struct llog_create_rec, padding) == 44, " found %lld\n",
(long long)(int)offsetof(struct llog_create_rec, padding));
LASSERTF((int)sizeof(((struct llog_create_rec *)0)->padding) == 4, " found %lld\n",
(long long)(int)offsetof(struct llog_unlink_rec, lur_oid));
LASSERTF((int)sizeof(((struct llog_unlink_rec *)0)->lur_oid) == 8, " found %lld\n",
(long long)(int)sizeof(((struct llog_unlink_rec *)0)->lur_oid));
- LASSERTF((int)offsetof(struct llog_unlink_rec, lur_oseq) == 24, " found %lld\n",
- (long long)(int)offsetof(struct llog_unlink_rec, lur_oseq));
- LASSERTF((int)sizeof(((struct llog_unlink_rec *)0)->lur_oseq) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct llog_unlink_rec *)0)->lur_oseq));
+ LASSERTF((int)offsetof(struct llog_unlink_rec, lur_ogr) == 24, " found %lld\n",
+ (long long)(int)offsetof(struct llog_unlink_rec, lur_ogr));
+ LASSERTF((int)sizeof(((struct llog_unlink_rec *)0)->lur_ogr) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct llog_unlink_rec *)0)->lur_ogr));
LASSERTF((int)offsetof(struct llog_unlink_rec, lur_count) == 28, " found %lld\n",
(long long)(int)offsetof(struct llog_unlink_rec, lur_count));
LASSERTF((int)sizeof(((struct llog_unlink_rec *)0)->lur_count) == 4, " found %lld\n",
(long long)(int)offsetof(struct llog_setattr_rec, lsr_oid));
LASSERTF((int)sizeof(((struct llog_setattr_rec *)0)->lsr_oid) == 8, " found %lld\n",
(long long)(int)sizeof(((struct llog_setattr_rec *)0)->lsr_oid));
- LASSERTF((int)offsetof(struct llog_setattr_rec, lsr_oseq) == 24, " found %lld\n",
- (long long)(int)offsetof(struct llog_setattr_rec, lsr_oseq));
- LASSERTF((int)sizeof(((struct llog_setattr_rec *)0)->lsr_oseq) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct llog_setattr_rec *)0)->lsr_oseq));
+ LASSERTF((int)offsetof(struct llog_setattr_rec, lsr_ogr) == 24, " found %lld\n",
+ (long long)(int)offsetof(struct llog_setattr_rec, lsr_ogr));
+ LASSERTF((int)sizeof(((struct llog_setattr_rec *)0)->lsr_ogr) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct llog_setattr_rec *)0)->lsr_ogr));
LASSERTF((int)offsetof(struct llog_setattr_rec, lsr_uid) == 28, " found %lld\n",
(long long)(int)offsetof(struct llog_setattr_rec, lsr_uid));
LASSERTF((int)sizeof(((struct llog_setattr_rec *)0)->lsr_uid) == 4, " found %lld\n",
(long long)(int)offsetof(struct llog_setattr64_rec, lsr_oid));
LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_oid) == 8, " found %lld\n",
(long long)(int)sizeof(((struct llog_setattr64_rec *)0)->lsr_oid));
- LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_oseq) == 24, " found %lld\n",
- (long long)(int)offsetof(struct llog_setattr64_rec, lsr_oseq));
- LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_oseq) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct llog_setattr64_rec *)0)->lsr_oseq));
+ LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_ogr) == 24, " found %lld\n",
+ (long long)(int)offsetof(struct llog_setattr64_rec, lsr_ogr));
+ LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_ogr) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct llog_setattr64_rec *)0)->lsr_ogr));
LASSERTF((int)offsetof(struct llog_setattr64_rec, padding) == 28, " found %lld\n",
(long long)(int)offsetof(struct llog_setattr64_rec, padding));
LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->padding) == 4, " found %lld\n",
R=0
else
N=$((N + 1))
- while [ $N -lt $M ]; do
+ while [ $N -le $M ]; do
R=$((R * N))
N=$((N + 1))
done
return 0
else
echo "found $res $flavor connections of $dir, not ready ($expect)"
- return 0
sleep 4
fi
done
char *prefix = is_dir ? "" : "lmm_";
char nl = is_dir ? ' ' : '\n';
- if (is_dir && lum->lmm_object_seq == LOV_OBJECT_GROUP_DEFAULT) {
- lum->lmm_object_seq = LOV_OBJECT_GROUP_CLEAR;
+ if (is_dir && lum->lmm_object_gr == LOV_OBJECT_GROUP_DEFAULT) {
+ lum->lmm_object_gr = LOV_OBJECT_GROUP_CLEAR;
if (verbose & VERBOSE_DETAIL)
llapi_printf(LLAPI_MSG_NORMAL, "(Default) ");
}
if ((verbose & VERBOSE_DETAIL) && !is_dir) {
llapi_printf(LLAPI_MSG_NORMAL, "lmm_magic: 0x%08X\n",
lum->lmm_magic);
- llapi_printf(LLAPI_MSG_NORMAL, "lmm_seq: "LPX64"\n",
- lum->lmm_object_seq);
+ llapi_printf(LLAPI_MSG_NORMAL, "lmm_object_gr: "LPX64"\n",
+ lum->lmm_object_gr);
llapi_printf(LLAPI_MSG_NORMAL, "lmm_object_id: "LPX64"\n",
lum->lmm_object_id);
}
for (i = 0; i < lum->lmm_stripe_count; i++) {
int idx = objects[i].l_ost_idx;
long long oid = objects[i].l_object_id;
- long long gr = objects[i].l_object_seq;
+ long long gr = objects[i].l_object_gr;
if ((obdindex == OBD_NOT_FOUND) || (obdindex == idx))
llapi_printf(LLAPI_MSG_NORMAL,
"\t%6u\t%14llu\t%#13llx\t%14llu%s\n",
static int traverse_lost_found(char *src_dir, const char *mount_path)
{
DIR *dir_ptr;
- struct filter_fid parent_fid;
+ struct filter_fid trusted_fid;
struct dirent64 *dirent;
__u64 ff_group, ff_objid;
char *file_path;
case DT_REG:
file_path = src_dir;
xattr_len = getxattr(file_path, "trusted.fid",
- (void *)&parent_fid,
- sizeof(parent_fid));
+ (void *)&trusted_fid,
+ sizeof(trusted_fid));
- if (xattr_len == -1 || xattr_len < sizeof(parent_fid))
+ if (xattr_len == -1 || xattr_len < sizeof(trusted_fid))
/*
* Its very much possible that we dont find fid
* on precreated files, LAST_ID
*/
continue;
- ff_group = le64_to_cpu(parent_fid.ff_seq);
- if (ff_group >= FID_SEQ_OST_MAX) {
+ ff_group = le64_to_cpu(trusted_fid.ff_group);
+ ff_objid = le64_to_cpu(trusted_fid.ff_objid);
+
+ if (ff_group >= MAX_GROUPS) {
fprintf(stderr, "error: invalid group "LPU64" likely"
"indicates a corrupt xattr for file %s.\n",
ff_group, file_path);
continue;
}
- ff_objid = le64_to_cpu(parent_fid.ff_objid);
/* might need to create the parent directories for
this object */
data.ioc_dev = kid->k_dev;
data.ioc_obdo1.o_mode = 0100644;
data.ioc_obdo1.o_id = 0;
- data.ioc_obdo1.o_seq = FID_SEQ_ECHO;
+ data.ioc_obdo1.o_gr = 2;
data.ioc_obdo1.o_uid = 0;
data.ioc_obdo1.o_gid = 0;
data.ioc_obdo1.o_valid = OBD_MD_FLTYPE | OBD_MD_FLMODE |
"\nctime: "LPU64"\nsize: "LPU64"\nblocks: "LPU64
"\nblksize: %u\nmode: %o\nuid: %d\ngid: %d\nflags: %x\n"
"misc: %x\nnlink: %d,\nvalid "LPX64"\n",
- obd->o_id, obd->o_seq, obd->o_atime, obd->o_mtime, obd->o_ctime,
+ obd->o_id, obd->o_gr, obd->o_atime, obd->o_mtime, obd->o_ctime,
obd->o_size, obd->o_blocks, obd->o_blksize, obd->o_mode,
obd->o_uid, obd->o_gid, obd->o_flags, obd->o_misc,
obd->o_nlink, obd->o_valid);
return CMD_HELP;
}
- if (argc < 5) {
+ if (argc < 5)
reset_lsmb (&lsm_buffer); /* will set default */
- } else {
+ else {
rc = parse_lsm (&lsm_buffer, argv[4]);
if (rc != 0) {
fprintf(stderr, "error: %s: invalid lsm '%s'\n",
CHECK_STRUCT(obdo);
CHECK_MEMBER(obdo, o_valid);
CHECK_MEMBER(obdo, o_id);
- CHECK_MEMBER(obdo, o_seq);
- CHECK_MEMBER(obdo, o_parent_seq);
+ CHECK_MEMBER(obdo, o_gr);
+ CHECK_MEMBER(obdo, o_fid);
CHECK_MEMBER(obdo, o_size);
CHECK_MEMBER(obdo, o_mtime);
CHECK_MEMBER(obdo, o_atime);
CHECK_MEMBER(obdo, o_gid);
CHECK_MEMBER(obdo, o_flags);
CHECK_MEMBER(obdo, o_nlink);
- CHECK_MEMBER(obdo, o_parent_oid);
+ CHECK_MEMBER(obdo, o_generation);
CHECK_MEMBER(obdo, o_misc);
CHECK_MEMBER(obdo, o_ioepoch);
CHECK_MEMBER(obdo, o_stripe_idx);
- CHECK_MEMBER(obdo, o_parent_ver);
+ CHECK_MEMBER(obdo, o_padding_1);
CHECK_MEMBER(obdo, o_handle);
CHECK_MEMBER(obdo, o_lcookie);
CHECK_MEMBER(obdo, o_padding_2);
CHECK_MEMBER(lov_mds_md_v1, lmm_magic);
CHECK_MEMBER(lov_mds_md_v1, lmm_pattern);
CHECK_MEMBER(lov_mds_md_v1, lmm_object_id);
- CHECK_MEMBER(lov_mds_md_v1, lmm_object_seq);
+ CHECK_MEMBER(lov_mds_md_v1, lmm_object_gr);
CHECK_MEMBER(lov_mds_md_v1, lmm_stripe_size);
CHECK_MEMBER(lov_mds_md_v1, lmm_stripe_count);
CHECK_MEMBER(lov_mds_md_v1, lmm_objects);
BLANK_LINE();
CHECK_STRUCT(lov_ost_data_v1);
CHECK_MEMBER(lov_ost_data_v1, l_object_id);
- CHECK_MEMBER(lov_ost_data_v1, l_object_seq);
+ CHECK_MEMBER(lov_ost_data_v1, l_object_gr);
CHECK_MEMBER(lov_ost_data_v1, l_ost_gen);
CHECK_MEMBER(lov_ost_data_v1, l_ost_idx);
CHECK_MEMBER(lov_mds_md_v3, lmm_magic);
CHECK_MEMBER(lov_mds_md_v3, lmm_pattern);
CHECK_MEMBER(lov_mds_md_v3, lmm_object_id);
- CHECK_MEMBER(lov_mds_md_v3, lmm_object_seq);
+ CHECK_MEMBER(lov_mds_md_v3, lmm_object_gr);
CHECK_MEMBER(lov_mds_md_v3, lmm_stripe_size);
CHECK_MEMBER(lov_mds_md_v3, lmm_stripe_count);
CHECK_MEMBER(lov_mds_md_v3, lmm_pool_name);
BLANK_LINE();
CHECK_STRUCT(lov_ost_data_v1);
CHECK_MEMBER(lov_ost_data_v1, l_object_id);
- CHECK_MEMBER(lov_ost_data_v1, l_object_seq);
+ CHECK_MEMBER(lov_ost_data_v1, l_object_gr);
CHECK_MEMBER(lov_ost_data_v1, l_ost_gen);
CHECK_MEMBER(lov_ost_data_v1, l_ost_idx);
BLANK_LINE();
CHECK_STRUCT(obd_ioobj);
CHECK_MEMBER(obd_ioobj, ioo_id);
- CHECK_MEMBER(obd_ioobj, ioo_seq);
+ CHECK_MEMBER(obd_ioobj, ioo_gr);
CHECK_MEMBER(obd_ioobj, ioo_type);
CHECK_MEMBER(obd_ioobj, ioo_bufcnt);
}
BLANK_LINE();
CHECK_STRUCT(llog_logid);
CHECK_MEMBER(llog_logid, lgl_oid);
- CHECK_MEMBER(llog_logid, lgl_oseq);
+ CHECK_MEMBER(llog_logid, lgl_ogr);
CHECK_MEMBER(llog_logid, lgl_ogen);
CHECK_CVALUE(OST_SZ_REC);
(long long)(int)offsetof(struct obdo, o_id));
LASSERTF((int)sizeof(((struct obdo *)0)->o_id) == 8, " found %lld\n",
(long long)(int)sizeof(((struct obdo *)0)->o_id));
- LASSERTF((int)offsetof(struct obdo, o_seq) == 16, " found %lld\n",
- (long long)(int)offsetof(struct obdo, o_seq));
- LASSERTF((int)sizeof(((struct obdo *)0)->o_seq) == 8, " found %lld\n",
- (long long)(int)sizeof(((struct obdo *)0)->o_seq));
- LASSERTF((int)offsetof(struct obdo, o_parent_seq) == 24, " found %lld\n",
- (long long)(int)offsetof(struct obdo, o_parent_seq));
- LASSERTF((int)sizeof(((struct obdo *)0)->o_parent_seq) == 8, " found %lld\n",
- (long long)(int)sizeof(((struct obdo *)0)->o_parent_seq));
+ LASSERTF((int)offsetof(struct obdo, o_gr) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct obdo, o_gr));
+ LASSERTF((int)sizeof(((struct obdo *)0)->o_gr) == 8, " found %lld\n",
+ (long long)(int)sizeof(((struct obdo *)0)->o_gr));
+ LASSERTF((int)offsetof(struct obdo, o_fid) == 24, " found %lld\n",
+ (long long)(int)offsetof(struct obdo, o_fid));
+ LASSERTF((int)sizeof(((struct obdo *)0)->o_fid) == 8, " found %lld\n",
+ (long long)(int)sizeof(((struct obdo *)0)->o_fid));
LASSERTF((int)offsetof(struct obdo, o_size) == 32, " found %lld\n",
(long long)(int)offsetof(struct obdo, o_size));
LASSERTF((int)sizeof(((struct obdo *)0)->o_size) == 8, " found %lld\n",
(long long)(int)offsetof(struct obdo, o_nlink));
LASSERTF((int)sizeof(((struct obdo *)0)->o_nlink) == 4, " found %lld\n",
(long long)(int)sizeof(((struct obdo *)0)->o_nlink));
- LASSERTF((int)offsetof(struct obdo, o_parent_oid) == 104, " found %lld\n",
- (long long)(int)offsetof(struct obdo, o_parent_oid));
- LASSERTF((int)sizeof(((struct obdo *)0)->o_parent_oid) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct obdo *)0)->o_parent_oid));
+ LASSERTF((int)offsetof(struct obdo, o_generation) == 104, " found %lld\n",
+ (long long)(int)offsetof(struct obdo, o_generation));
+ LASSERTF((int)sizeof(((struct obdo *)0)->o_generation) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct obdo *)0)->o_generation));
LASSERTF((int)offsetof(struct obdo, o_misc) == 108, " found %lld\n",
(long long)(int)offsetof(struct obdo, o_misc));
LASSERTF((int)sizeof(((struct obdo *)0)->o_misc) == 4, " found %lld\n",
(long long)(int)offsetof(struct obdo, o_stripe_idx));
LASSERTF((int)sizeof(((struct obdo *)0)->o_stripe_idx) == 4, " found %lld\n",
(long long)(int)sizeof(((struct obdo *)0)->o_stripe_idx));
- LASSERTF((int)offsetof(struct obdo, o_parent_ver) == 124, " found %lld\n",
- (long long)(int)offsetof(struct obdo, o_parent_ver));
- LASSERTF((int)sizeof(((struct obdo *)0)->o_parent_ver) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct obdo *)0)->o_parent_ver));
+ LASSERTF((int)offsetof(struct obdo, o_padding_1) == 124, " found %lld\n",
+ (long long)(int)offsetof(struct obdo, o_padding_1));
+ LASSERTF((int)sizeof(((struct obdo *)0)->o_padding_1) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct obdo *)0)->o_padding_1));
LASSERTF((int)offsetof(struct obdo, o_handle) == 128, " found %lld\n",
(long long)(int)offsetof(struct obdo, o_handle));
LASSERTF((int)sizeof(((struct obdo *)0)->o_handle) == 8, " found %lld\n",
(long long)(int)offsetof(struct lov_mds_md_v1, lmm_object_id));
LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_object_id) == 8, " found %lld\n",
(long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_object_id));
- LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_object_seq) == 16, " found %lld\n",
- (long long)(int)offsetof(struct lov_mds_md_v1, lmm_object_seq));
- LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_object_seq) == 8, " found %lld\n",
- (long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_object_seq));
+ LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_object_gr) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct lov_mds_md_v1, lmm_object_gr));
+ LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_object_gr) == 8, " found %lld\n",
+ (long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_object_gr));
LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_stripe_size) == 24, " found %lld\n",
(long long)(int)offsetof(struct lov_mds_md_v1, lmm_stripe_size));
LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_stripe_size) == 4, " found %lld\n",
(long long)(int)offsetof(struct lov_ost_data_v1, l_object_id));
LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_id) == 8, " found %lld\n",
(long long)(int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_id));
- LASSERTF((int)offsetof(struct lov_ost_data_v1, l_object_seq) == 8, " found %lld\n",
- (long long)(int)offsetof(struct lov_ost_data_v1, l_object_seq));
- LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_seq) == 8, " found %lld\n",
- (long long)(int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_seq));
+ LASSERTF((int)offsetof(struct lov_ost_data_v1, l_object_gr) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct lov_ost_data_v1, l_object_gr));
+ LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_gr) == 8, " found %lld\n",
+ (long long)(int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_gr));
LASSERTF((int)offsetof(struct lov_ost_data_v1, l_ost_gen) == 16, " found %lld\n",
(long long)(int)offsetof(struct lov_ost_data_v1, l_ost_gen));
LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_gen) == 4, " found %lld\n",
(long long)(int)offsetof(struct lov_mds_md_v3, lmm_object_id));
LASSERTF((int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_object_id) == 8, " found %lld\n",
(long long)(int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_object_id));
- LASSERTF((int)offsetof(struct lov_mds_md_v3, lmm_object_seq) == 16, " found %lld\n",
- (long long)(int)offsetof(struct lov_mds_md_v3, lmm_object_seq));
- LASSERTF((int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_object_seq) == 8, " found %lld\n",
- (long long)(int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_object_seq));
+ LASSERTF((int)offsetof(struct lov_mds_md_v3, lmm_object_gr) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct lov_mds_md_v3, lmm_object_gr));
+ LASSERTF((int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_object_gr) == 8, " found %lld\n",
+ (long long)(int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_object_gr));
LASSERTF((int)offsetof(struct lov_mds_md_v3, lmm_stripe_size) == 24, " found %lld\n",
(long long)(int)offsetof(struct lov_mds_md_v3, lmm_stripe_size));
LASSERTF((int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_stripe_size) == 4, " found %lld\n",
(long long)(int)offsetof(struct lov_ost_data_v1, l_object_id));
LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_id) == 8, " found %lld\n",
(long long)(int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_id));
- LASSERTF((int)offsetof(struct lov_ost_data_v1, l_object_seq) == 8, " found %lld\n",
- (long long)(int)offsetof(struct lov_ost_data_v1, l_object_seq));
- LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_seq) == 8, " found %lld\n",
- (long long)(int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_seq));
+ LASSERTF((int)offsetof(struct lov_ost_data_v1, l_object_gr) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct lov_ost_data_v1, l_object_gr));
+ LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_gr) == 8, " found %lld\n",
+ (long long)(int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_gr));
LASSERTF((int)offsetof(struct lov_ost_data_v1, l_ost_gen) == 16, " found %lld\n",
(long long)(int)offsetof(struct lov_ost_data_v1, l_ost_gen));
LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_gen) == 4, " found %lld\n",
(long long)(int)offsetof(struct obd_ioobj, ioo_id));
LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_id) == 8, " found %lld\n",
(long long)(int)sizeof(((struct obd_ioobj *)0)->ioo_id));
- LASSERTF((int)offsetof(struct obd_ioobj, ioo_seq) == 8, " found %lld\n",
- (long long)(int)offsetof(struct obd_ioobj, ioo_seq));
- LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_seq) == 8, " found %lld\n",
- (long long)(int)sizeof(((struct obd_ioobj *)0)->ioo_seq));
+ LASSERTF((int)offsetof(struct obd_ioobj, ioo_gr) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct obd_ioobj, ioo_gr));
+ LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_gr) == 8, " found %lld\n",
+ (long long)(int)sizeof(((struct obd_ioobj *)0)->ioo_gr));
LASSERTF((int)offsetof(struct obd_ioobj, ioo_type) == 16, " found %lld\n",
(long long)(int)offsetof(struct obd_ioobj, ioo_type));
LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_type) == 4, " found %lld\n",
(long long)(int)offsetof(struct llog_logid, lgl_oid));
LASSERTF((int)sizeof(((struct llog_logid *)0)->lgl_oid) == 8, " found %lld\n",
(long long)(int)sizeof(((struct llog_logid *)0)->lgl_oid));
- LASSERTF((int)offsetof(struct llog_logid, lgl_oseq) == 8, " found %lld\n",
- (long long)(int)offsetof(struct llog_logid, lgl_oseq));
- LASSERTF((int)sizeof(((struct llog_logid *)0)->lgl_oseq) == 8, " found %lld\n",
- (long long)(int)sizeof(((struct llog_logid *)0)->lgl_oseq));
+ LASSERTF((int)offsetof(struct llog_logid, lgl_ogr) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct llog_logid, lgl_ogr));
+ LASSERTF((int)sizeof(((struct llog_logid *)0)->lgl_ogr) == 8, " found %lld\n",
+ (long long)(int)sizeof(((struct llog_logid *)0)->lgl_ogr));
LASSERTF((int)offsetof(struct llog_logid, lgl_ogen) == 16, " found %lld\n",
(long long)(int)offsetof(struct llog_logid, lgl_ogen));
LASSERTF((int)sizeof(((struct llog_logid *)0)->lgl_ogen) == 4, " found %lld\n",
(long long)(int)offsetof(struct llog_create_rec, lcr_oid));
LASSERTF((int)sizeof(((struct llog_create_rec *)0)->lcr_oid) == 8, " found %lld\n",
(long long)(int)sizeof(((struct llog_create_rec *)0)->lcr_oid));
- LASSERTF((int)offsetof(struct llog_create_rec, lcr_oseq) == 40, " found %lld\n",
- (long long)(int)offsetof(struct llog_create_rec, lcr_oseq));
- LASSERTF((int)sizeof(((struct llog_create_rec *)0)->lcr_oseq) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct llog_create_rec *)0)->lcr_oseq));
+ LASSERTF((int)offsetof(struct llog_create_rec, lcr_ogr) == 40, " found %lld\n",
+ (long long)(int)offsetof(struct llog_create_rec, lcr_ogr));
+ LASSERTF((int)sizeof(((struct llog_create_rec *)0)->lcr_ogr) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct llog_create_rec *)0)->lcr_ogr));
LASSERTF((int)offsetof(struct llog_create_rec, padding) == 44, " found %lld\n",
(long long)(int)offsetof(struct llog_create_rec, padding));
LASSERTF((int)sizeof(((struct llog_create_rec *)0)->padding) == 4, " found %lld\n",
(long long)(int)offsetof(struct llog_unlink_rec, lur_oid));
LASSERTF((int)sizeof(((struct llog_unlink_rec *)0)->lur_oid) == 8, " found %lld\n",
(long long)(int)sizeof(((struct llog_unlink_rec *)0)->lur_oid));
- LASSERTF((int)offsetof(struct llog_unlink_rec, lur_oseq) == 24, " found %lld\n",
- (long long)(int)offsetof(struct llog_unlink_rec, lur_oseq));
- LASSERTF((int)sizeof(((struct llog_unlink_rec *)0)->lur_oseq) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct llog_unlink_rec *)0)->lur_oseq));
+ LASSERTF((int)offsetof(struct llog_unlink_rec, lur_ogr) == 24, " found %lld\n",
+ (long long)(int)offsetof(struct llog_unlink_rec, lur_ogr));
+ LASSERTF((int)sizeof(((struct llog_unlink_rec *)0)->lur_ogr) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct llog_unlink_rec *)0)->lur_ogr));
LASSERTF((int)offsetof(struct llog_unlink_rec, lur_count) == 28, " found %lld\n",
(long long)(int)offsetof(struct llog_unlink_rec, lur_count));
LASSERTF((int)sizeof(((struct llog_unlink_rec *)0)->lur_count) == 4, " found %lld\n",
(long long)(int)offsetof(struct llog_setattr_rec, lsr_oid));
LASSERTF((int)sizeof(((struct llog_setattr_rec *)0)->lsr_oid) == 8, " found %lld\n",
(long long)(int)sizeof(((struct llog_setattr_rec *)0)->lsr_oid));
- LASSERTF((int)offsetof(struct llog_setattr_rec, lsr_oseq) == 24, " found %lld\n",
- (long long)(int)offsetof(struct llog_setattr_rec, lsr_oseq));
- LASSERTF((int)sizeof(((struct llog_setattr_rec *)0)->lsr_oseq) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct llog_setattr_rec *)0)->lsr_oseq));
+ LASSERTF((int)offsetof(struct llog_setattr_rec, lsr_ogr) == 24, " found %lld\n",
+ (long long)(int)offsetof(struct llog_setattr_rec, lsr_ogr));
+ LASSERTF((int)sizeof(((struct llog_setattr_rec *)0)->lsr_ogr) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct llog_setattr_rec *)0)->lsr_ogr));
LASSERTF((int)offsetof(struct llog_setattr_rec, lsr_uid) == 28, " found %lld\n",
(long long)(int)offsetof(struct llog_setattr_rec, lsr_uid));
LASSERTF((int)sizeof(((struct llog_setattr_rec *)0)->lsr_uid) == 4, " found %lld\n",
(long long)(int)offsetof(struct llog_setattr64_rec, lsr_oid));
LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_oid) == 8, " found %lld\n",
(long long)(int)sizeof(((struct llog_setattr64_rec *)0)->lsr_oid));
- LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_oseq) == 24, " found %lld\n",
- (long long)(int)offsetof(struct llog_setattr64_rec, lsr_oseq));
- LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_oseq) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct llog_setattr64_rec *)0)->lsr_oseq));
+ LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_ogr) == 24, " found %lld\n",
+ (long long)(int)offsetof(struct llog_setattr64_rec, lsr_ogr));
+ LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_ogr) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct llog_setattr64_rec *)0)->lsr_ogr));
LASSERTF((int)offsetof(struct llog_setattr64_rec, padding) == 28, " found %lld\n",
(long long)(int)offsetof(struct llog_setattr64_rec, padding));
LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->padding) == 4, " found %lld\n",