@@ -148,6 +148,11 @@ static int ll_close_inode_openhandle(struct inode *inode,
ll_prepare_close(inode, op_data, och);
switch (bias) {
case MDS_CLOSE_LAYOUT_MERGE:
+ /* merge blocks from the victim inode */
+ op_data->op_attr_blocks += ((struct inode *)data)->i_blocks;
+ op_data->op_attr.ia_valid |= ATTR_SIZE;
+ op_data->op_xvalid |= OP_XVALID_BLOCKS;
+ /* fallthrough */
case MDS_CLOSE_LAYOUT_SWAP:
LASSERT(data);
op_data->op_bias |= bias;
@@ -257,6 +257,13 @@ static int lov_io_slice_init(struct lov_io *lio, struct lov_object *obj,
}
case CIT_GLIMPSE:
+ lio->lis_pos = 0;
+ lio->lis_endpos = OBD_OBJECT_EOF;
+
+ if ((obj->lo_lsm->lsm_flags & LCM_FL_FLR_MASK) == LCM_FL_RDONLY)
+ return 1; /* SoM is accurate, no need glimpse */
+ break;
+
case CIT_MISC:
lio->lis_pos = 0;
lio->lis_endpos = OBD_OBJECT_EOF;
@@ -1068,18 +1075,21 @@ int lov_io_init_composite(const struct lu_env *env, struct cl_object *obj,
{
struct lov_io *lio = lov_env_io(env);
struct lov_object *lov = cl2lov(obj);
+ int result;
INIT_LIST_HEAD(&lio->lis_active);
- io->ci_result = lov_io_slice_init(lio, lov, io);
- if (io->ci_result)
- return io->ci_result;
+ result = lov_io_slice_init(lio, lov, io);
+ if (result)
+ goto out;
- io->ci_result = lov_io_subio_init(env, lio, io);
- if (io->ci_result == 0) {
+ result = lov_io_subio_init(env, lio, io);
+ if (!result) {
cl_io_slice_add(io, &lio->lis_cl, obj, &lov_io_ops);
atomic_inc(&lov->lo_active_ios);
}
- return io->ci_result;
+out:
+ io->ci_result = result < 0 ? result : 0;
+ return result;
}
int lov_io_init_empty(const struct lu_env *env, struct cl_object *obj,
@@ -1015,6 +1015,7 @@ struct lov_mds_md_v1 { /* LOV EA mds/wire data (little-endian) */
#define XATTR_SECURITY_PREFIX "security."
#define XATTR_LUSTRE_PREFIX "lustre."
+#define XATTR_NAME_SOM "trusted.som"
#define XATTR_NAME_LOV "trusted.lov"
#define XATTR_NAME_LMA "trusted.lma"
#define XATTR_NAME_LMV "trusted.lmv"
@@ -201,6 +201,17 @@ struct lustre_mdt_attrs {
*/
#define LMA_OLD_SIZE (sizeof(struct lustre_mdt_attrs) + 5 * sizeof(__u64))
+enum {
+ LSOM_FL_VALID = 1 << 0,
+};
+
+struct lustre_som_attrs {
+ __u16 lsa_valid;
+ __u16 lsa_reserved[3];
+ __u64 lsa_size;
+ __u64 lsa_blocks;
+};
+
/**
* OST object IDentifier.
*/