Whamcloud - gitweb
Revert "b=19427 correct lmm_object_id and reserve fids for fid-on-OST." 1.10.0.41a v1_10_0_41a
authorRobert Read <robert.read@oracle.com>
Fri, 30 Apr 2010 16:23:28 +0000 (09:23 -0700)
committerRobert Read <robert.read@oracle.com>
Fri, 30 Apr 2010 16:23:28 +0000 (09:23 -0700)
This reverts commit 4c01e64e0a72c1682ebf0a8bd4cccf99fd04cd88.

This caused the interop issue seen in bug 22730.

78 files changed:
libcfs/include/libcfs/libcfs_private.h
lustre/contrib/packet-lustre.c
lustre/doc/llapi_file_get_stripe.3
lustre/fid/fid_handler.c
lustre/fld/fld_index.c
lustre/include/liblustre.h
lustre/include/linux/obd_class.h
lustre/include/lustre/lustre_idl.h
lustre/include/lustre/lustre_user.h
lustre/include/lustre_capa.h
lustre/include/lustre_log.h
lustre/include/obd.h
lustre/lclient/glimpse.c
lustre/lclient/lcommon_cl.c
lustre/liblustre/dir.c
lustre/liblustre/file.c
lustre/liblustre/llite_cl.c
lustre/liblustre/llite_lib.c
lustre/liblustre/llite_lib.h
lustre/liblustre/namei.c
lustre/liblustre/rw.c
lustre/liblustre/super.c
lustre/liblustre/tests/sanity.c
lustre/llite/file.c
lustre/llite/llite_lib.c
lustre/llite/namei.c
lustre/llite/vvp_io.c
lustre/lov/lov_ea.c
lustre/lov/lov_log.c
lustre/lov/lov_obd.c
lustre/lov/lov_object.c
lustre/lov/lov_pack.c
lustre/lov/lov_qos.c
lustre/lov/lov_request.c
lustre/mdd/mdd_lov.c
lustre/mdd/mdd_object.c
lustre/mds/mds_fs.c
lustre/mds/mds_lov.c
lustre/mdt/mdt_capa.c
lustre/mdt/mdt_lib.c
lustre/mgs/mgs_internal.h
lustre/mgs/mgs_llog.c
lustre/obdclass/autoMakefile.am
lustre/obdclass/linux/linux-obdo.c
lustre/obdclass/llog_ioctl.c
lustre/obdclass/llog_lvfs.c
lustre/obdclass/llog_swab.c
lustre/obdclass/obd_config.c
lustre/obdclass/obdo.c
lustre/obdecho/echo_client.c
lustre/obdfilter/filter.c
lustre/obdfilter/filter_capa.c
lustre/obdfilter/filter_internal.h
lustre/obdfilter/filter_io.c
lustre/obdfilter/filter_io_26.c
lustre/obdfilter/filter_log.c
lustre/obdfilter/filter_lvb.c
lustre/obdfilter/lproc_obdfilter.c
lustre/osc/osc_create.c
lustre/osc/osc_io.c
lustre/osc/osc_lock.c
lustre/osc/osc_object.c
lustre/osc/osc_request.c
lustre/osd/osd_handler.c
lustre/osd/osd_igif.c
lustre/osd/osd_internal.h
lustre/osd/osd_oi.c
lustre/ost/ost_handler.c
lustre/ptlrpc/llog_server.c
lustre/ptlrpc/pack_generic.c
lustre/ptlrpc/wiretest.c
lustre/tests/test-framework.sh
lustre/utils/liblustreapi.c
lustre/utils/ll_recover_lost_found_objs.c
lustre/utils/loadgen.c
lustre/utils/obd.c
lustre/utils/wirecheck.c
lustre/utils/wiretest.c

index 814c2af..db86bf4 100644 (file)
@@ -290,7 +290,7 @@ int libcfs_debug_cleanup(void);
 #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
index 712082b..6d18f09 100644 (file)
@@ -492,8 +492,8 @@ static int hf_lustre_lustre_msg_v2_lm_padding_3 = -1;
 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;
@@ -552,7 +552,7 @@ static int hf_lustre_lustre_msg_v2_lm_padding_2 = -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;
@@ -633,7 +633,7 @@ static int hf_lustre_llog_size_change_rec_lsc_hdr = -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;
@@ -662,7 +662,7 @@ static int hf_lustre_mds_rec_rename_rn_padding_3 = -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;
@@ -793,17 +793,17 @@ static int hf_lustre_llog_catid_lci_padding2 = -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;
@@ -1363,7 +1363,7 @@ lustre_dissect_struct_obd_connect_data(tvbuff_t *tvb _U_, int offset _U_, packet
 
 /* 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: } */
@@ -1377,9 +1377,9 @@ lustre_dissect_element_lov_ost_data_v1_l_object_id(tvbuff_t *tvb _U_, int offset
 }
 
 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;
 }
@@ -1418,7 +1418,7 @@ lustre_dissect_struct_lov_ost_data_v1(tvbuff_t *tvb _U_, int offset _U_, packet_
 
   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);
 
@@ -1434,7 +1434,7 @@ lustre_dissect_struct_lov_ost_data_v1(tvbuff_t *tvb _U_, int offset _U_, packet_
 /* 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 { */
@@ -1466,9 +1466,9 @@ lustre_dissect_element_lov_mds_md_v1_lmm_object_id(tvbuff_t *tvb _U_, int offset
 }
 
 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;
 }
@@ -1533,7 +1533,7 @@ lustre_dissect_struct_lov_mds_md_v1(tvbuff_t *tvb _U_, int offset _U_, packet_in
 
   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);
 
@@ -1809,7 +1809,7 @@ lustre_dissect_struct_obd_statfs(tvbuff_t *tvb _U_, int offset _U_, packet_info
 
 /* 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: } */
@@ -1823,9 +1823,9 @@ lustre_dissect_element_obd_ioobj_ioo_id(tvbuff_t *tvb _U_, int offset _U_, packe
 }
 
 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;
 }
@@ -1864,7 +1864,7 @@ lustre_dissect_struct_obd_ioobj(tvbuff_t *tvb _U_, int offset _U_, packet_info *
 
   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);
 
@@ -5119,7 +5119,7 @@ lustre_dissect_struct_cfg_marker(tvbuff_t *tvb _U_, int offset _U_, packet_info
 
 /* IDL: struct llog_logid { */
 /* IDL:        uint64 lgl_oid; */
-/* IDL:        uint64 lgl_oseq; */
+/* IDL:        uint64 lgl_ogr; */
 /* IDL:        uint32 lgl_ogen; */
 /* IDL: } */
 
@@ -5132,9 +5132,9 @@ lustre_dissect_element_llog_logid_lgl_oid(tvbuff_t *tvb _U_, int offset _U_, pac
 }
 
 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;
 }
@@ -5165,7 +5165,7 @@ lustre_dissect_struct_llog_logid(tvbuff_t *tvb _U_, int offset _U_, packet_info
 
   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);
 
@@ -6471,8 +6471,8 @@ lustre_dissect_struct_llogd_conn_body(tvbuff_t *tvb _U_, int offset _U_, packet_
 /* 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; */
@@ -6485,11 +6485,11 @@ lustre_dissect_struct_llogd_conn_body(tvbuff_t *tvb _U_, int offset _U_, packet_
 /* 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 { */
@@ -6518,17 +6518,17 @@ lustre_dissect_element_obdo_o_id(tvbuff_t *tvb _U_, int offset _U_, packet_info
 }
 
 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;
 }
@@ -6656,9 +6656,9 @@ lustre_dissect_element_obdo_o_nlink(tvbuff_t *tvb _U_, int offset _U_, packet_in
 }
 
 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;
 }
@@ -6688,9 +6688,9 @@ lustre_dissect_element_obdo_o_stripe_idx(tvbuff_t *tvb _U_, int offset _U_, pack
 }
 
 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;
 }
@@ -6769,9 +6769,9 @@ lustre_dissect_struct_obdo(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo
 
   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);
 
@@ -6797,7 +6797,7 @@ lustre_dissect_struct_obdo(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo
 
   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);
 
@@ -6805,7 +6805,7 @@ lustre_dissect_struct_obdo(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo
 
   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);
 
@@ -8554,10 +8554,10 @@ void proto_register_dcerpc_lustre(void)
       { "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, 
@@ -8672,8 +8672,8 @@ void proto_register_dcerpc_lustre(void)
       { "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, 
@@ -8962,8 +8962,8 @@ void proto_register_dcerpc_lustre(void)
       { "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, 
@@ -9020,8 +9020,8 @@ void proto_register_dcerpc_lustre(void)
       { "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, 
@@ -9291,14 +9291,14 @@ void proto_register_dcerpc_lustre(void)
       { "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, 
@@ -9311,8 +9311,8 @@ void proto_register_dcerpc_lustre(void)
       { "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, 
index bfc9dc6..061976c 100644 (file)
@@ -28,7 +28,7 @@ struct lov_user_md_v1 {
         __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;
@@ -39,7 +39,7 @@ struct lov_user_md_v3 {
         __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;
@@ -87,7 +87,7 @@ members containing per OST file information in the following format:
 .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));
@@ -96,7 +96,7 @@ struct lov_user_ost_data_v1 {
 .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
index 253ea38..e85d0ef 100644 (file)
@@ -388,7 +388,7 @@ static int seq_req_handle(struct ptlrpc_request *req,
 
         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));
index aa0c748..1dfb481 100644 (file)
@@ -68,7 +68,7 @@ const char fld_index_name[] = "fld";
 
 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
 };
 
index ec58e37..3198055 100644 (file)
@@ -45,8 +45,6 @@
  *
  * @{
  */
-#include <fcntl.h>
-#include <sys/queue.h>
 
 #ifdef __KERNEL__
 #error Kernel files should not #include <liblustre.h>
@@ -430,16 +428,6 @@ typedef struct file_lock {
 #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
@@ -527,9 +515,6 @@ static inline void set_fs(mm_segment_t seg)
 {
 }
 
-#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>
index 771e21f..b891491 100644 (file)
@@ -81,13 +81,12 @@ int ldiskfsfs_dirhash(const char *name, int len, struct ldiskfs_dx_hash_info *hi
 
 /* 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
index 54f0730..f331ec5 100644 (file)
 
 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
@@ -358,12 +345,6 @@ static inline void lustre_lma_swab(struct lustre_mdt_attrs *lma)
         }
 };
 
-/* 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
@@ -396,80 +377,20 @@ static inline void fid_zero(struct lu_fid *fid)
         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;
 }
 
 /**
@@ -477,177 +398,9 @@ static inline int fid_is_igif(const struct lu_fid *fid)
  * \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;
 }
 
 /**
@@ -661,21 +414,6 @@ static inline ino_t lu_igif_ino(const struct lu_fid *fid)
 }
 
 /**
- * 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.
@@ -1173,6 +911,20 @@ typedef enum {
 } 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,
@@ -1216,7 +968,7 @@ enum obdo_flags {
 #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) */
 };
@@ -1226,7 +978,7 @@ struct lov_mds_md_v1 {            /* LOV EA mds/wire data (little-endian) */
         __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 */
@@ -1254,7 +1006,7 @@ struct lov_mds_md_v3 {            /* LOV EA mds/wire data (little-endian) */
         __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 */
@@ -1363,7 +1115,7 @@ extern void lustre_swab_obd_statfs (struct obd_statfs *os);
 
 struct obd_ioobj {
         obd_id               ioo_id;
-        obd_seq              ioo_seq;
+        obd_gr               ioo_gr;
         __u32                ioo_type;
         __u32                ioo_bufcnt;
 };
@@ -2333,7 +2085,7 @@ typedef enum {
 /** Identifier for a single log object */
 struct llog_logid {
         __u64                   lgl_oid;
-        __u64                   lgl_oseq;
+        __u64                   lgl_ogr;
         __u32                   lgl_ogen;
 } __attribute__((packed));
 
@@ -2409,7 +2161,7 @@ struct llog_create_rec {
         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));
@@ -2425,7 +2177,7 @@ struct llog_orphan_rec {
 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));
@@ -2433,7 +2185,7 @@ struct llog_unlink_rec {
 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;
@@ -2443,7 +2195,7 @@ struct llog_setattr_rec {
 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;
@@ -2577,8 +2329,9 @@ struct llogd_conn_body {
 /* 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;
@@ -2593,11 +2346,11 @@ struct obdo {
         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 */
 
@@ -2608,19 +2361,11 @@ struct obdo {
         __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));
@@ -2821,7 +2566,7 @@ enum {
 #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 */
index 0709027..348f756 100644 (file)
@@ -179,7 +179,7 @@ struct obd_statfs {
 #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));
@@ -189,7 +189,7 @@ struct lov_user_md_v1 {           /* LOV EA user data (host-endian) */
         __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 */
@@ -200,7 +200,7 @@ struct lov_user_md_v3 {           /* LOV EA user data (host-endian) */
         __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 */
@@ -226,7 +226,7 @@ struct lov_user_mds_data_v3 {
 
 struct ll_recreate_obj {
         __u64 lrc_id;
-        __u64 lrc_seq;
+        __u64 lrc_group;
         __u32 lrc_ost_idx;
 };
 
@@ -237,6 +237,12 @@ struct ll_fid {
                            * 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];
 };
@@ -309,12 +315,6 @@ struct lu_fid {
         __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. */
index 5c5660e..73d7b72 100644 (file)
@@ -135,9 +135,9 @@ static inline __u32 capa_keyid(struct lustre_capa *capa)
         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)
@@ -166,8 +166,8 @@ CDEBUG(level, fmt " capability@%p fid "DFID" opc "LPX64" uid "LPU64" gid "     \
 
 #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 *);
index a4cd24d..00c8541 100644 (file)
@@ -457,7 +457,7 @@ static inline void llog_group_init(struct obd_llog_group *olg, int group)
         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,
@@ -468,7 +468,7 @@ 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);
index 040fe05..258c4d6 100644 (file)
@@ -88,7 +88,8 @@ struct osc_async_rc {
 };
 
 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 */
 
@@ -105,8 +106,6 @@ struct lov_oinfo {                 /* per-stripe data structure */
         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)
 {
@@ -135,7 +134,7 @@ struct lov_stripe_md {
         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/. */
@@ -150,7 +149,7 @@ struct lov_stripe_md {
 };
 
 #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
@@ -917,6 +916,13 @@ struct target_recovery_data {
         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
@@ -927,30 +933,48 @@ struct target_recovery_data {
   * 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;
@@ -1309,8 +1333,8 @@ struct obd_ops {
                       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,
@@ -1618,7 +1642,4 @@ static inline struct md_open_data *obd_mod_alloc(void)
         }                                                       \
 })
 
-extern void obdo_from_inode(struct obdo *dst, struct inode *src,
-                            struct lu_fid *parent, obd_flag valid);
-
 #endif /* __OBD_H */
index 1d523c1..76b934d 100644 (file)
 #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"
index a593621..2031b34 100644 (file)
 #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
 
@@ -952,13 +962,11 @@ void ccc_req_completion(const struct lu_env *env,
  *
  *    - o_mode
  *
- *    - o_parent_seq
+ *    - o_fid (filled with inode number?!)
  *
  *    - o_[ug]id
  *
- *    - o_parent_oid
- *
- *    - o_parent_ver
+ *    - o_generation
  *
  *    - o_ioepoch,
  *
@@ -990,11 +998,11 @@ void ccc_req_attr_set(const struct lu_env *env,
                         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 = {
index b8dc113..ce812de 100644 (file)
 #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)
index 32f41ae..c166ca9 100644 (file)
 #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.
@@ -293,10 +304,9 @@ int llu_objects_destroy(struct ptlrpc_request *req, struct inode *dir)
                 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;
index ed8c988..0aaa7bf 100644 (file)
 # 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>
index d63a0a9..9003491 100644 (file)
 #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 */
 
index 5fd0dc4..ba62ba6 100644 (file)
 
 #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>
@@ -66,6 +54,7 @@
 /* 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;
@@ -130,6 +119,7 @@ struct llu_inode_info {
         struct ost_lvb          lli_lvb;
 };
 
+
 static inline struct llu_sb_info *llu_fs2sbi(struct filesys *fs)
 {
         return (struct llu_sb_info*)(fs->fs_private);
@@ -140,18 +130,11 @@ static inline struct llu_inode_info *llu_i2info(struct inode *inode)
         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;
@@ -246,6 +229,7 @@ extern struct mount_option_s mount_option;
 /* 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,
index da5f150..3fea45d 100644 (file)
 #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)
index c9c0fe7..47be4e1 100644 (file)
 #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,
index 8ac87a7..7be70b9 100644 (file)
 # 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
@@ -224,14 +235,9 @@ void obdo_to_inode(struct inode *dst, struct obdo *src, 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 "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);
@@ -260,6 +266,76 @@ void obdo_to_inode(struct inode *dst, struct obdo *src, obd_flag valid)
                 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.
@@ -279,7 +355,7 @@ int llu_inode_getattr(struct inode *inode, struct obdo *obdo,
         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 |
@@ -287,7 +363,6 @@ int llu_inode_getattr(struct inode *inode, struct obdo *obdo,
                                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;
index f648e72..e652cbb 100644 (file)
@@ -1258,7 +1258,7 @@ int t55(char *name)
         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);
@@ -1266,7 +1266,7 @@ int t55(char *name)
                 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);
@@ -1324,7 +1324,7 @@ int t55(char *name)
         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);
@@ -1332,7 +1332,7 @@ int t55(char *name)
                 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);
index 6992c7e..cb41625 100644 (file)
@@ -702,7 +702,7 @@ static int ll_lsm_getattr(struct lov_stripe_md *lsm, struct obd_export *exp,
         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 |
@@ -1230,12 +1230,13 @@ static int ll_lov_recreate_obj(struct inode *inode, struct file *file,
                 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);
 
@@ -1588,11 +1589,12 @@ int ll_do_fiemap(struct inode *inode, struct ll_user_fiemap *fiemap,
                 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;
@@ -1888,12 +1890,11 @@ int ll_fsync(struct file *file, struct dentry *dentry, int data)
                         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,
index 5a50e8e..51aae73 100644 (file)
@@ -1730,13 +1730,14 @@ int ll_iocontrol(struct inode *inode, struct file *file,
                 }
 
                 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);
index 30d5d20..9ca42fe 100644 (file)
@@ -1133,7 +1133,7 @@ int ll_objects_destroy(struct ptlrpc_request *request, struct inode *dir)
                 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;
 
index 5db4708..74aeb59 100644 (file)
@@ -804,7 +804,7 @@ static int vvp_page_sync_io(const struct lu_env *env, struct cl_io *io,
 
         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);
index 4785944..aa7c299 100755 (executable)
@@ -146,7 +146,7 @@ static void lsm_unpackmd_common(struct lov_stripe_md *lsm,
          * 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';
@@ -207,7 +207,7 @@ int lsm_unpackmd_v1(struct lov_obd *lov, struct lov_stripe_md *lsm,
                 /* 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) {
@@ -277,7 +277,7 @@ int lsm_unpackmd_v3(struct lov_obd *lov, struct lov_stripe_md *lsm,
                 /* 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) {
index fb22e4f..7346f25 100644 (file)
@@ -92,24 +92,25 @@ static int lov_llog_origin_add(struct llog_ctxt *ctxt, struct llog_rec_hdr *rec,
                 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);
index 92a0370..53a0343 100644 (file)
@@ -1726,6 +1726,8 @@ static int lov_change_cbdata(struct obd_export *exp,
         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;
@@ -1736,9 +1738,8 @@ static int lov_change_cbdata(struct obd_export *exp,
                         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);
@@ -1763,6 +1764,8 @@ static int lov_find_cbdata(struct obd_export *exp,
         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;
@@ -1773,9 +1776,8 @@ static int lov_find_cbdata(struct obd_export *exp,
                         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);
@@ -1802,7 +1804,7 @@ static int lov_cancel(struct obd_export *exp, struct lov_stripe_md *lsm,
         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);
@@ -1858,7 +1860,7 @@ static int lov_cancel_unused(struct obd_export *exp,
 
         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];
@@ -1873,7 +1875,7 @@ static int lov_cancel_unused(struct obd_export *exp,
                         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);
@@ -2403,7 +2405,6 @@ static int lov_fiemap(struct lov_obd *lov, __u32 keylen, void *key,
                         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)
@@ -2549,7 +2550,7 @@ static int lov_get_info(struct obd_export *exp, __u32 keylen,
                                 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);
                         }
index d75b53b..7b1c458 100644 (file)
@@ -108,6 +108,28 @@ static void lov_install_raid0(const struct lu_env *env,
         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,
@@ -136,11 +158,11 @@ static int lov_init_sub(const struct lu_env *env, struct lov_object *lov,
         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) {
@@ -196,8 +218,7 @@ static int lov_init_raid0(const struct lu_env *env,
                         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);
index fea8cce..2972086 100644 (file)
@@ -80,7 +80,7 @@ static void lov_dump_lmm_objects(int level, struct lov_ost_data *lod,
         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));
         }
 }
@@ -215,7 +215,7 @@ int lov_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
          * 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);
@@ -229,11 +229,12 @@ int lov_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
 
         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);
         }
@@ -558,7 +559,7 @@ int lov_setea(struct obd_export *exp, struct lov_stripe_md **lsmp,
                 (*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);
 }
index 7028b68..59f20c3 100644 (file)
@@ -1005,7 +1005,7 @@ int qos_prep_create(struct obd_export *exp, struct lov_request_set *set)
 
         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;
index a6b3ade..7c0e040 100644 (file)
@@ -343,7 +343,7 @@ int lov_prep_enqueue_set(struct obd_export *exp, struct obd_info *oinfo,
 
                 /* 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;
@@ -453,7 +453,7 @@ int lov_prep_match_set(struct obd_export *exp, struct obd_info *oinfo,
 
                 /* 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);
@@ -536,7 +536,7 @@ int lov_prep_cancel_set(struct obd_export *exp, struct obd_info *oinfo,
 
                 /* 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);
@@ -605,7 +605,7 @@ static int create_done(struct obd_export *exp, struct lov_request_set *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);
@@ -691,7 +691,7 @@ int lov_update_create_set(struct lov_request_set *set,
         }
 
         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);
 
@@ -915,7 +915,6 @@ int lov_prep_brw_set(struct obd_export *exp, struct obd_info *oinfo,
                                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);
@@ -931,7 +930,7 @@ int lov_prep_brw_set(struct obd_export *exp, struct obd_info *oinfo,
 
                 /* 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;
@@ -1040,7 +1039,6 @@ int lov_prep_getattr_set(struct obd_export *exp, struct obd_info *oinfo,
                 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;
 
@@ -1119,7 +1117,6 @@ int lov_prep_destroy_set(struct obd_export *exp, struct obd_info *oinfo,
                 }
                 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)
@@ -1231,7 +1228,6 @@ int lov_prep_setattr_set(struct obd_export *exp, struct obd_info *oinfo,
                 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;
@@ -1365,7 +1361,7 @@ int lov_prep_punch_set(struct obd_export *exp, struct obd_info *oinfo,
                 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;
@@ -1454,7 +1450,6 @@ int lov_prep_sync_set(struct obd_export *exp, struct obd_info *oinfo,
                 }
                 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;
index 0ea8b9a..2b9535f 100644 (file)
@@ -354,6 +354,16 @@ int mdd_lov_set_md(const struct lu_env *env, struct mdd_object *pobj,
         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 */
@@ -417,9 +427,9 @@ int mdd_lov_create(const struct lu_env *env, struct mdd_device *mdd,
 
         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;
@@ -431,6 +441,8 @@ int mdd_lov_create(const struct lu_env *env, struct mdd_device *mdd,
                                            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;
@@ -464,18 +476,17 @@ int mdd_lov_create(const struct lu_env *env, struct mdd_device *mdd,
                         }
                         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)
@@ -496,8 +507,9 @@ int mdd_lov_create(const struct lu_env *env, struct mdd_device *mdd,
                  * 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;
@@ -516,6 +528,7 @@ int mdd_lov_create(const struct lu_env *env, struct mdd_device *mdd,
                         GOTO(out_oti, rc);
                 }
         }
+
         /* blksize should be changed after create data object */
         la->la_valid |= LA_BLKSIZE;
         la->la_blksize = oa->o_blksize;
@@ -576,7 +589,7 @@ int mdd_lovobj_unlink(const struct lu_env *env, struct mdd_device *mdd,
         }
 
         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;
 
@@ -586,8 +599,8 @@ int mdd_lovobj_unlink(const struct lu_env *env, struct mdd_device *mdd,
                 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);
 
@@ -730,7 +743,7 @@ int mdd_setattr_log(const struct lu_env *env, struct mdd_device *mdd,
 
 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;
@@ -751,8 +764,7 @@ static int mdd_osc_setattr_async(struct obd_device *obd, __u32 uid, __u32 gid,
 
         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);
         }
 
@@ -760,7 +772,7 @@ static int mdd_osc_setattr_async(struct obd_device *obd, __u32 uid, __u32 gid,
         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) {
@@ -768,7 +780,9 @@ static int mdd_osc_setattr_async(struct obd_device *obd, __u32 uid, __u32 gid,
                 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. */
@@ -801,6 +815,7 @@ int mdd_lov_setattr_async(const struct lu_env *env, struct mdd_object *obj,
                 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);
 }
index 49e8f66..d4c7750 100644 (file)
@@ -623,7 +623,7 @@ int mdd_get_default_md(struct mdd_object *mdd_obj, struct lov_mds_md *lmm,
         }
 
         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;
index ba5df4b..6c45e4a 100644 (file)
@@ -101,9 +101,6 @@ int mds_obd_create(struct obd_export *exp, struct obdo *oa,
 
         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);
@@ -137,7 +134,7 @@ int mds_obd_create(struct obd_export *exp, struct obdo *oa,
         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;
@@ -208,7 +205,6 @@ int mds_obd_destroy(struct obd_export *exp, struct obdo *oa,
         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)
index 4cefa7f..d01c6fd 100644 (file)
@@ -281,7 +281,7 @@ static int mds_log_lost_precreated(struct obd_device *obd,
         }
 
         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);
@@ -527,7 +527,7 @@ int mds_lov_clear_orphans(struct mds_obd *mds, struct obd_uuid *ost_uuid)
          * 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;
@@ -721,7 +721,7 @@ int mds_lov_connect(struct obd_device *obd, char * lov_name)
         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 */
@@ -845,7 +845,7 @@ static int __mds_lov_synchronize(void *data)
                 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),
index f01940d..a4cbe69 100644 (file)
@@ -55,7 +55,7 @@ static inline void set_capa_key_expiry(struct mdt_device *mdt)
 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));
 }
@@ -63,7 +63,7 @@ static void make_capa_key(struct lustre_capa_key *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));
@@ -72,7 +72,7 @@ static inline void lck_cpu_to_le(struct lustre_capa_key *tgt,
 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));
index 7a66b75..de23917 100644 (file)
@@ -542,7 +542,7 @@ void mdt_dump_lmm(int level, const struct lov_mds_md *lmm)
         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));
         }
 }
index a4c6373..f62cb29 100644 (file)
@@ -71,7 +71,6 @@ struct fs_db {
         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;
index f5ceabc..4848990 100644 (file)
@@ -193,7 +193,6 @@ static int mgs_fsdb_handler(struct llog_handle *llh, struct llog_rec_hdr *rec,
                 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 */
@@ -533,7 +532,7 @@ static __inline__ int next_index(void *index_map, int map_len)
         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;
@@ -546,26 +545,18 @@ static int mgs_set_index(struct obd_device *obd, struct mgs_target_info *mti)
                 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) {
index 54a3f20..fc64935 100644 (file)
@@ -5,7 +5,7 @@ endif
 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
index 77b5da4..9126027 100644 (file)
 #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)
 {
@@ -149,11 +217,6 @@ void obdo_to_inode(struct inode *dst, struct obdo *src, 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",
@@ -180,6 +243,8 @@ void obdo_to_inode(struct inode *dst, struct obdo *src, obd_flag valid)
                 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)
@@ -188,6 +253,8 @@ void obdo_to_inode(struct inode *dst, struct obdo *src, obd_flag valid)
                 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
index 23383cf..b7e1843 100644 (file)
@@ -74,7 +74,7 @@ static int str2logid(struct llog_logid *logid, char *str, int len)
                 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);
 
@@ -135,7 +135,7 @@ static int llog_check_cb(struct llog_handle *handle, struct llog_rec_hdr *rec,
                 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);
                 }
@@ -222,7 +222,7 @@ static int llog_print_cb(struct llog_handle *handle, struct llog_rec_hdr *rec,
                 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",
@@ -248,7 +248,7 @@ static int llog_remove_log(struct llog_handle *cat, struct llog_logid *logid)
         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);
         }
 
@@ -322,7 +322,7 @@ int llog_ioctl(struct llog_ctxt *ctxt, int cmd, struct obd_ioctl_data *data)
                              "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 &
@@ -448,7 +448,7 @@ int llog_catalog_list(struct obd_device *obd, int count,
                 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) {
index e30d678..1b7117c 100644 (file)
@@ -608,7 +608,7 @@ static int llog_lvfs_create(struct llog_ctxt *ctxt, struct llog_handle **res,
 
         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);
@@ -621,7 +621,7 @@ static int llog_lvfs_create(struct llog_ctxt *ctxt, struct llog_handle **res,
                         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);
                 }
 
@@ -644,7 +644,7 @@ static int llog_lvfs_create(struct llog_ctxt *ctxt, struct llog_handle **res,
                 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 =
@@ -654,19 +654,15 @@ static int llog_lvfs_create(struct llog_ctxt *ctxt, struct llog_handle **res,
                 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));
@@ -676,7 +672,7 @@ static int llog_lvfs_create(struct llog_ctxt *ctxt, struct llog_handle **res,
                 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;
         }
@@ -742,9 +738,8 @@ static int llog_lvfs_destroy(struct llog_handle *handle)
                 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);
index 2947989..41ee78a 100644 (file)
@@ -52,7 +52,7 @@ static void print_llogd_body(struct llogd_body *d)
 {
         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);
@@ -67,7 +67,7 @@ void lustre_swab_llogd_body (struct llogd_body *d)
         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);
@@ -85,7 +85,7 @@ void lustre_swab_llogd_conn_body (struct llogd_conn_body *d)
         __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);
 }
@@ -138,7 +138,7 @@ void lustre_swab_llog_rec(struct llog_rec_hdr *rec, struct llog_rec_tail *tail)
                 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;
         }
@@ -147,7 +147,7 @@ void lustre_swab_llog_rec(struct llog_rec_hdr *rec, struct llog_rec_tail *tail)
                 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;
@@ -180,7 +180,7 @@ void lustre_swab_llog_rec(struct llog_rec_hdr *rec, struct llog_rec_tail *tail)
                 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);
 
@@ -211,7 +211,7 @@ void lustre_swab_llog_rec(struct llog_rec_hdr *rec, struct llog_rec_tail *tail)
                 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;
         }
index c4f3c2d..00e672f 100644 (file)
@@ -278,7 +278,7 @@ int class_attach(struct lustre_cfg *lcfg)
         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)) {
index 1a88376..774f0ba 100644 (file)
 #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__
@@ -152,12 +81,8 @@ void obdo_cpy_md(struct obdo *dst, struct obdo *src, obd_flag valid)
                 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)
@@ -196,12 +121,8 @@ int obdo_cmp_md(struct obdo *dst, struct obdo *src, obd_flag compare)
                 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));
@@ -214,9 +135,9 @@ void obdo_to_ioobj(struct obdo *oa, struct obd_ioobj *ioobj)
 {
         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);
index bdcda06..237c146 100644 (file)
@@ -169,10 +169,8 @@ struct echo_object_conf *cl2echo_conf(const struct cl_object_conf *c)
 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 */
 
@@ -925,7 +923,7 @@ static struct echo_object *cl_echo_object_find(struct echo_device *d,
                         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;
@@ -1331,7 +1329,7 @@ static int echo_create_object(struct echo_device *ed, int on_target,
         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);
@@ -1384,9 +1382,9 @@ static int echo_get_object(struct echo_object **ecop, struct echo_device *ed,
 
         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);
@@ -1802,10 +1800,10 @@ echo_client_iocontrol(unsigned int cmd, struct obd_export *exp,
         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 */
@@ -1965,7 +1963,7 @@ static int echo_client_setup(struct obd_device *obddev, struct lustre_cfg *lcfg)
         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) {
index e3f13b7..f59732d 100644 (file)
@@ -530,7 +530,7 @@ void filter_fmd_expire(struct obd_export *exp)
  * 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;
 
@@ -553,7 +553,7 @@ static struct filter_mod_data *filter_fmd_find_nolock(struct filter_obd *filter,
 
 /* 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;
 
@@ -573,7 +573,7 @@ struct filter_mod_data *filter_fmd_find(struct obd_export *exp,
  * 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;
@@ -611,7 +611,7 @@ struct filter_mod_data *filter_fmd_get(struct obd_export *exp,
  * 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;
 
@@ -682,7 +682,7 @@ int filter_update_server_data(struct obd_device *obd)
         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;
@@ -692,19 +692,19 @@ int filter_update_last_objid(struct obd_device *obd, obd_seq group,
         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);
 }
@@ -1077,7 +1077,7 @@ static int filter_read_group_internal(struct obd_device *obd, int group,
                 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);
@@ -1141,7 +1141,7 @@ static int filter_read_group_internal(struct obd_device *obd, int group,
 
         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));
         }
@@ -1170,7 +1170,7 @@ static int filter_read_group_internal(struct obd_device *obd, int group,
                 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]);
@@ -1239,10 +1239,10 @@ static int filter_prep_groups(struct obd_device *obd)
         }
 
         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)
@@ -1390,7 +1390,7 @@ static void filter_post(struct obd_device *obd)
 }
 
 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);
 
@@ -1399,7 +1399,7 @@ static void filter_set_last_id(struct filter_obd *filter,
         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);
@@ -1419,13 +1419,13 @@ static int filter_lock_dentry(struct obd_device *obd, struct dentry *dparent)
 }
 
 /* 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];
@@ -1433,7 +1433,7 @@ struct dentry *filter_parent(struct obd_device *obd, obd_seq group, obd_id objid
 }
 
 /* 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;
@@ -1465,7 +1465,7 @@ static void filter_parent_unlock(struct dentry *dparent)
  * 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;
@@ -1489,7 +1489,7 @@ struct dentry *filter_fid2dentry(struct obd_device *obd,
         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);
@@ -1606,7 +1606,7 @@ out:
  * 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;
@@ -2413,7 +2413,7 @@ filter_find_olg_internal(struct filter_obd *filter, int group)
 
         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);
@@ -2429,7 +2429,7 @@ struct obd_llog_group *filter_find_olg(struct obd_device *obd, int group)
 
         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);
@@ -2451,7 +2451,7 @@ struct obd_llog_group *filter_find_create_olg(struct obd_device *obd, int group)
 
         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);
@@ -2504,12 +2504,12 @@ static int filter_llog_connect(struct obd_export *exp,
 
         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);
@@ -2520,7 +2520,7 @@ static int filter_llog_connect(struct obd_export *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;
@@ -2564,7 +2564,7 @@ static int filter_llog_preclean(struct obd_device *obd)
                 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);
         }
 
@@ -2979,7 +2979,7 @@ static int filter_destroy_export(struct obd_export *exp)
         }
 
         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);
 }
@@ -3003,24 +3003,24 @@ static void filter_sync_llogs(struct obd_device *obd, struct obd_export *dexp)
                 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;
@@ -3049,7 +3049,7 @@ static int filter_disconnect(struct obd_export *exp)
         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 */
@@ -3089,23 +3089,27 @@ static int filter_ping(struct obd_export *exp)
         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));
         }
@@ -3120,11 +3124,8 @@ static int filter_getattr(struct obd_export *exp, struct obd_info *oinfo)
         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);
@@ -3135,13 +3136,13 @@ static int filter_getattr(struct obd_export *exp, struct obd_info *oinfo)
                 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);
@@ -3160,21 +3161,19 @@ int filter_update_fidea(struct obd_export *exp, struct inode *inode,
                 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)
@@ -3372,24 +3371,21 @@ int filter_setattr(struct obd_export *exp, struct obd_info *oinfo,
         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 &&
@@ -3397,19 +3393,20 @@ int filter_setattr(struct obd_export *exp, struct obd_info *oinfo,
                 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));
 
@@ -3426,7 +3423,7 @@ int filter_setattr(struct obd_export *exp, struct obd_info *oinfo,
         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);
@@ -3451,7 +3448,7 @@ int filter_setattr(struct obd_export *exp, struct obd_info *oinfo,
         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;
@@ -3517,7 +3514,7 @@ static int filter_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp,
         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)
 {
@@ -3527,25 +3524,24 @@ static int filter_destroy_precreated(struct obd_export *exp, struct obdo *oa,
         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);
 
@@ -3563,32 +3559,32 @@ static int filter_destroy_precreated(struct obd_export *exp, struct obdo *oa,
                 /* 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;
@@ -3642,7 +3638,7 @@ static int filter_handle_precreate(struct obd_export *exp, struct obdo *oa,
                         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);
@@ -3657,7 +3653,7 @@ static int filter_handle_precreate(struct obd_export *exp, struct obdo *oa,
                 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);
         }
@@ -3690,7 +3686,7 @@ static int filter_statfs(struct obd_device *obd, struct obd_statfs *osfs,
                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 +
@@ -3770,7 +3766,7 @@ static __u64 filter_calc_free_inodes(struct obd_device *obd)
  * 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;
@@ -3835,14 +3831,6 @@ static int filter_precreate(struct obd_device *obd, struct obdo *oa,
                 } 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));
@@ -3888,7 +3876,7 @@ static int filter_precreate(struct obd_device *obd, struct obdo *oa,
                         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);
 
@@ -3950,7 +3938,7 @@ set_last_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);
@@ -3964,25 +3952,27 @@ static int filter_create(struct obd_export *exp, struct obdo *oa,
         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);
         }
 
@@ -4000,18 +3990,19 @@ static int filter_create(struct obd_export *exp, struct obdo *oa,
 
         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);
@@ -4045,10 +4036,8 @@ int filter_destroy(struct obd_export *exp, struct obdo *oa,
         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);
@@ -4059,26 +4048,26 @@ int filter_destroy(struct obd_export *exp, struct obdo *oa,
         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;
@@ -4090,7 +4079,7 @@ int filter_destroy(struct obd_export *exp, struct obdo *oa,
                 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);
 
@@ -4148,7 +4137,7 @@ int filter_destroy(struct obd_export *exp, struct obdo *oa,
          * 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 */
@@ -4162,12 +4151,12 @@ int filter_destroy(struct obd_export *exp, struct obdo *oa,
         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:
@@ -4237,8 +4226,8 @@ static int filter_truncate(struct obd_export *exp, struct obd_info *oinfo,
         }
 
         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;
@@ -4257,11 +4246,8 @@ static int filter_sync(struct obd_export *exp, struct obdo *oa,
         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);
@@ -4276,7 +4262,7 @@ static int filter_sync(struct obd_export *exp, struct obdo *oa,
                 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));
 
@@ -4299,7 +4285,7 @@ static int filter_sync(struct obd_export *exp, struct obdo *oa,
         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);
 
@@ -4362,17 +4348,14 @@ static int filter_get_info(struct obd_export *exp, __u32 keylen,
                 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));
 
@@ -4446,14 +4429,14 @@ static int filter_set_mds_conn(struct obd_export *exp, void *val)
         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);
@@ -4663,8 +4646,8 @@ static int __init obdfilter_init(void)
         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);
 
index d99357e..ed35959 100644 (file)
@@ -64,7 +64,7 @@ int filter_update_capa_key(struct obd_device *obd, struct lustre_capa_key *new)
 
         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]) {
@@ -112,7 +112,7 @@ int filter_update_capa_key(struct obd_device *obd, struct lustre_capa_key *new)
         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;
@@ -120,12 +120,13 @@ int filter_auth_capa(struct obd_export *exp, struct lu_fid *fid, obd_seq seq,
         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 */
@@ -135,15 +136,16 @@ int filter_auth_capa(struct obd_export *exp, struct lu_fid *fid, obd_seq seq,
         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);
         }
 
@@ -178,7 +180,7 @@ int filter_auth_capa(struct obd_export *exp, struct lu_fid *fid, obd_seq seq,
 
         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;
@@ -225,14 +227,15 @@ int filter_auth_capa(struct obd_export *exp, struct lu_fid *fid, obd_seq seq,
         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))
@@ -241,6 +244,7 @@ int filter_capa_fixoa(struct obd_export *exp, struct obdo *oa, obd_seq seq,
         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;
@@ -249,7 +253,7 @@ int filter_capa_fixoa(struct obd_export *exp, struct obdo *oa, obd_seq seq,
 
                 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;
index 5941dd6..36bf7ae 100644 (file)
@@ -43,7 +43,6 @@
 #include <lustre_handles.h>
 #include <lustre_debug.h>
 #include <obd.h>
-#include <obd_class.h>
 #include <lprocfs_status.h>
 
 #define FILTER_LAYOUT_VERSION "2"
@@ -95,31 +94,10 @@ struct filter_mod_data {
 #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);
 
@@ -149,20 +127,19 @@ extern void target_recovery_init(struct lu_target *lut,
 /* 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,
@@ -175,7 +152,7 @@ int filter_setattr(struct obd_export *exp, struct obd_info *oinfo,
 
 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;
@@ -254,9 +231,9 @@ static void lprocfs_filter_init_vars(struct lprocfs_static_vars *lvars)
 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);
 
index 0320bce..485560c 100644 (file)
@@ -393,11 +393,8 @@ static int filter_preprw_read(int cmd, struct obd_export *exp, struct obdo *oa,
         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);
@@ -416,7 +413,7 @@ static int filter_preprw_read(int cmd, struct obd_export *exp, struct obdo *oa,
                 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;
@@ -664,11 +661,8 @@ static int filter_preprw_write(int cmd, struct obd_export *exp, struct obdo *oa,
         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);
@@ -683,7 +677,7 @@ static int filter_preprw_write(int cmd, struct obd_export *exp, struct obdo *oa,
                 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));
@@ -697,7 +691,7 @@ static int filter_preprw_write(int cmd, struct obd_export *exp, struct obdo *oa,
 
         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);
         }
@@ -721,7 +715,7 @@ static int filter_preprw_write(int cmd, struct obd_export *exp, struct obdo *oa,
         /* 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);
@@ -903,7 +897,7 @@ static int filter_commitrw_read(struct obd_export *exp, struct obdo *oa,
         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 */
index 621ee05..ce656fc 100644 (file)
@@ -716,9 +716,11 @@ int filter_commitrw_write(struct obd_export *exp, struct obdo *oa,
         /* 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);
 
index 1f5d4fb..e32bea2 100644 (file)
@@ -125,16 +125,16 @@ void filter_cancel_cookies_cb(struct obd_device *obd, __u64 transno,
                 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);
         }
 
@@ -148,7 +148,7 @@ out:
         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,
@@ -168,21 +168,13 @@ static int filter_recov_log_unlink_cb(struct llog_ctxt *ctxt,
                 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)
@@ -222,14 +214,14 @@ static int filter_recov_log_setattr_cb(struct llog_ctxt *ctxt,
                 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;
         }
index 554b606..f3df18a 100644 (file)
@@ -79,7 +79,7 @@ static int filter_lvbo_init(struct ldlm_resource *res)
         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]);
 
index e39ae9b..d51f306 100644 (file)
@@ -110,7 +110,7 @@ static int lprocfs_filter_rd_last_id(char *page, char **start, off_t off,
         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;
index 6c555d5..cbe8d5d 100644 (file)
@@ -95,7 +95,7 @@ static int osc_interpret_create(const struct lu_env *env,
         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].
@@ -117,7 +117,7 @@ static int osc_interpret_create(const struct lu_env *env,
                                  * 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;
@@ -238,18 +238,9 @@ static int oscc_internal_create(struct osc_creator *oscc)
         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);
@@ -459,7 +450,7 @@ int osc_create_async(struct obd_export *exp, struct obd_info *oinfo,
         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);
@@ -533,7 +524,7 @@ int osc_create(struct obd_export *exp, struct obdo *oa,
                 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 */
index 5fe0eb2..b31fdf8 100644 (file)
@@ -473,7 +473,7 @@ static int osc_io_setattr_start(const struct lu_env *env,
         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;
@@ -635,7 +635,7 @@ static void osc_req_completion(const struct lu_env *env,
 
 /**
  * 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,
@@ -658,7 +658,7 @@ 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) {
index 54b52ca..26a2d2d 100644 (file)
@@ -240,9 +240,9 @@ void osc_lock_build_res(const struct lu_env *env, const struct osc_object *obj,
         } 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);
         }
 }
index b394fcd..84efcb5 100644 (file)
@@ -117,7 +117,7 @@ static int osc_object_print(const struct lu_env *env, void *cookie,
         (*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);
index 95112b9..014edf2 100644 (file)
@@ -96,9 +96,9 @@ static int osc_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
 
         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);
@@ -151,9 +151,9 @@ static int osc_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp,
         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;
@@ -485,7 +485,7 @@ int osc_real_create(struct obd_export *exp, struct obdo *oa,
          * 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) {
@@ -629,7 +629,7 @@ static int osc_resource_get_unused(struct obd_export *exp, struct obdo *oa,
         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);
@@ -1442,14 +1442,15 @@ static int check_write_checksum(struct obdo *oa, const lnet_process_id_t *peer,
                 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), "
@@ -1576,21 +1577,19 @@ static int osc_brw_fini_request(struct ptlrpc_request *req, int rc)
                                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 -
@@ -3104,7 +3103,7 @@ static int osc_change_cbdata(struct obd_export *exp, struct lov_stripe_md *lsm,
         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;
 }
@@ -3120,7 +3119,7 @@ static int osc_find_cbdata(struct obd_export *exp, struct lov_stripe_md *lsm,
         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);
@@ -3395,7 +3394,7 @@ static int osc_enqueue(struct obd_export *exp, struct obd_info *oinfo,
         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,
@@ -3472,7 +3471,7 @@ static int osc_cancel_unused(struct obd_export *exp,
 
         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);
@@ -3707,7 +3706,7 @@ static int osc_getstripe(struct lov_stripe_md *lsm, struct lov_user_md *lump)
         }
 
         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))
@@ -4042,9 +4041,9 @@ static int osc_set_info_async(struct obd_export *exp, obd_count keylen,
         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)) {
@@ -4133,7 +4132,7 @@ static int osc_llog_init(struct obd_device *obd, struct obd_llog_group *olg,
 
         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) {
index 631cb2c..cf60236 100644 (file)
@@ -257,7 +257,7 @@ static int osd_root_get(const struct lu_env *env,
         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;
 }
 
@@ -347,7 +347,7 @@ static int osd_fid_lookup(const struct lu_env *env,
 
         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
@@ -1720,7 +1720,7 @@ static int osd_ea_fid_set(const struct lu_env *env, struct dt_object *dt,
 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);
 }
 
 /**
index b6533bd..9228d18 100644 (file)
 /* 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));
+}
index 0b3aad3..9c5db4a 100644 (file)
@@ -306,21 +306,5 @@ static inline int osd_invariant(const struct osd_object *obj)
 #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 */
index 5d91f33..a0ac44c 100644 (file)
@@ -200,7 +200,7 @@ int osd_oi_lookup(struct osd_thread_info *info, struct osd_oi *oi,
         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 {
@@ -235,7 +235,7 @@ int osd_oi_insert(struct osd_thread_info *info, struct osd_oi *oi,
         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))
@@ -262,7 +262,7 @@ int osd_oi_delete(struct osd_thread_info *info,
         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;
index ea453e6..6712d4c 100644 (file)
@@ -167,7 +167,7 @@ static int ost_lock_get(struct obd_export *exp, struct obdo *oa,
                         __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;
 
@@ -181,7 +181,6 @@ static int ost_lock_get(struct obd_export *exp, struct obdo *oa,
             !(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;
@@ -472,7 +471,7 @@ static int ost_brw_lock_get(int mode, struct obd_export *exp,
         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));
 
@@ -577,7 +576,7 @@ static int ost_rw_prolong_locks(struct ptlrpc_request *req, struct obd_ioobj *ob
         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;
@@ -1201,20 +1200,18 @@ static int ost_brw_write(struct ptlrpc_request *req, struct obd_trans_info *oti)
                 }
 
                 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 );
@@ -1797,7 +1794,7 @@ static int ost_rw_hpreq_lock_match(struct ptlrpc_request *req,
                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);
 
index f989029..7a25f55 100644 (file)
@@ -564,7 +564,7 @@ static int llog_catinfo_cb(struct llog_handle *cat,
         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;
@@ -634,7 +634,7 @@ static int llog_catinfo_deletions(struct obd_device *obd, char *buf,
                              "\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;
index d2e894c..5af3db6 100644 (file)
@@ -1557,8 +1557,8 @@ void lustre_swab_obdo (struct obdo  *o)
 {
         __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);
@@ -1571,19 +1571,12 @@ void lustre_swab_obdo (struct obdo  *o)
         __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)
@@ -1599,21 +1592,13 @@ 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);
 }
@@ -1683,7 +1668,7 @@ void lustre_swab_mds_body (struct mds_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_body (struct mdt_body *b)
@@ -1714,7 +1699,7 @@ 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)
@@ -1851,6 +1836,10 @@ void lustre_swab_mdt_rec_reint (struct mdt_rec_reint *rr)
         __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);
@@ -1896,7 +1885,7 @@ static void print_lum (struct lov_user_md *lum)
         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);
@@ -1908,7 +1897,7 @@ static void lustre_swab_lov_user_md_common(struct lov_user_md_v1 *lum)
         __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);
@@ -1940,7 +1929,7 @@ void lustre_swab_lov_mds_md(struct lov_mds_md *lmm)
         __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;
@@ -1953,7 +1942,7 @@ void lustre_swab_lov_user_md_objects(struct lov_user_ost_data *lod,
         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));
         }
@@ -2034,15 +2023,15 @@ void lustre_swab_qdata(struct qunit_data *d)
         __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);
 }
 
@@ -2060,10 +2049,9 @@ void dump_obdo(struct obdo *oa)
         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)
@@ -2091,23 +2079,16 @@ void dump_obdo(struct obdo *oa)
         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");
@@ -2262,9 +2243,9 @@ void lustre_swab_lustre_capa(struct lustre_capa *c)
 
 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)
index 228bfbc..d186f71 100644 (file)
@@ -504,14 +504,14 @@ void lustre_assert_wire_constants(void)
                  (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",
@@ -560,10 +560,10 @@ void lustre_assert_wire_constants(void)
                  (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",
@@ -576,10 +576,10 @@ void lustre_assert_wire_constants(void)
                  (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",
@@ -674,10 +674,10 @@ void lustre_assert_wire_constants(void)
                  (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",
@@ -698,10 +698,10 @@ void lustre_assert_wire_constants(void)
                  (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",
@@ -731,10 +731,10 @@ void lustre_assert_wire_constants(void)
                  (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",
@@ -759,10 +759,10 @@ void lustre_assert_wire_constants(void)
                  (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",
@@ -860,10 +860,10 @@ void lustre_assert_wire_constants(void)
                  (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",
@@ -1911,10 +1911,10 @@ void lustre_assert_wire_constants(void)
                  (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",
@@ -2033,10 +2033,10 @@ void lustre_assert_wire_constants(void)
                  (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",
@@ -2077,10 +2077,10 @@ void lustre_assert_wire_constants(void)
                  (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",
@@ -2101,10 +2101,10 @@ void lustre_assert_wire_constants(void)
                  (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",
@@ -2133,10 +2133,10 @@ void lustre_assert_wire_constants(void)
                  (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",
index 3a9573e..2b97ab0 100644 (file)
@@ -3609,7 +3609,7 @@ combination()
         R=0
     else
         N=$((N + 1))
-        while [ $N -lt $M ]; do
+        while [ $N -le $M ]; do
             R=$((R * N))
             N=$((N + 1))
         done
@@ -3820,7 +3820,6 @@ wait_flavor()
             return 0
         else
             echo "found $res $flavor connections of $dir, not ready ($expect)"
-            return 0
             sleep 4
         fi
     done
index e28f533..057410b 100644 (file)
@@ -1380,8 +1380,8 @@ static void lov_dump_user_lmm_header(struct lov_user_md *lum, char *path,
         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) ");
         }
@@ -1392,8 +1392,8 @@ static void lov_dump_user_lmm_header(struct lov_user_md *lum, char *path,
         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);
         }
@@ -1464,7 +1464,7 @@ void lov_dump_user_lmm_v1v3(struct lov_user_md *lum, char *pool_name,
                 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",
index 8af6dfa..d95fb5a 100644 (file)
@@ -187,7 +187,7 @@ static unsigned filetype_dir_table[] = {
 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;
@@ -252,24 +252,25 @@ static int traverse_lost_found(char *src_dir, const char *mount_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 */
index 83585a3..20f51c5 100644 (file)
@@ -480,7 +480,7 @@ static int obj_create(struct kid_t *kid)
         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 |
index 80f051f..5e26909 100644 (file)
@@ -207,7 +207,7 @@ char *obdo_print(struct obdo *obd)
                 "\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);
@@ -1090,9 +1090,9 @@ int jt_obd_create(int argc, char **argv)
                         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",
index c54c862..49092b1 100644 (file)
@@ -230,8 +230,8 @@ check_obdo(void)
         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);
@@ -244,11 +244,11 @@ check_obdo(void)
         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);
@@ -318,7 +318,7 @@ check_lov_mds_md_v1(void)
         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);
@@ -326,7 +326,7 @@ check_lov_mds_md_v1(void)
         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);
 
@@ -344,7 +344,7 @@ check_lov_mds_md_v3(void)
         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);
@@ -353,7 +353,7 @@ check_lov_mds_md_v3(void)
         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);
 
@@ -394,7 +394,7 @@ check_obd_ioobj(void)
         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);
 }
@@ -833,7 +833,7 @@ check_llog_logid(void)
         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);
index 3ca25ce..ada400e 100644 (file)
@@ -501,14 +501,14 @@ void lustre_assert_wire_constants(void)
                  (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",
@@ -557,10 +557,10 @@ void lustre_assert_wire_constants(void)
                  (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",
@@ -573,10 +573,10 @@ void lustre_assert_wire_constants(void)
                  (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",
@@ -671,10 +671,10 @@ void lustre_assert_wire_constants(void)
                  (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",
@@ -695,10 +695,10 @@ void lustre_assert_wire_constants(void)
                  (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",
@@ -728,10 +728,10 @@ void lustre_assert_wire_constants(void)
                  (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