Whamcloud - gitweb
LU-2675 libcfs: remove unused open flag conversions
[fs/lustre-release.git] / lustre / lod / lod_object.c
index 6f7cd46..18c8000 100644 (file)
@@ -1476,9 +1476,9 @@ next:
                                cpu_to_le16(lo->ldo_def_stripe_offset);
                        v3->lmm_stripe_size =
                                cpu_to_le32(lo->ldo_def_stripe_size);
-                       if (lo->ldo_pool)
-                               strncpy(v3->lmm_pool_name, lo->ldo_pool,
-                                       LOV_MAXPOOLNAME);
+                       if (lo->ldo_pool != NULL)
+                               strlcpy(v3->lmm_pool_name, lo->ldo_pool,
+                                       sizeof(v3->lmm_pool_name));
 
                        info->lti_buf.lb_buf = v3;
                        info->lti_buf.lb_len = sizeof(*v3);
@@ -1768,7 +1768,7 @@ static int lod_xattr_set_lov_on_dir(const struct lu_env *env,
        LASSERT(buf != NULL && buf->lb_buf != NULL);
        lum = buf->lb_buf;
 
-       rc = lod_verify_striping(d, buf, 0);
+       rc = lod_verify_striping(d, buf, false);
        if (rc)
                RETURN(rc);
 
@@ -1933,9 +1933,9 @@ static int lod_xattr_set_lmv(const struct lu_env *env, struct dt_object *dt,
                                cpu_to_le16(lo->ldo_def_stripe_offset);
                        v3->lmm_stripe_size =
                                cpu_to_le32(lo->ldo_def_stripe_size);
-                       if (lo->ldo_pool)
-                               strncpy(v3->lmm_pool_name, lo->ldo_pool,
-                                       LOV_MAXPOOLNAME);
+                       if (lo->ldo_pool != NULL)
+                               strlcpy(v3->lmm_pool_name, lo->ldo_pool,
+                                       sizeof(v3->lmm_pool_name));
 
                        info->lti_buf.lb_buf = v3;
                        info->lti_buf.lb_len = sizeof(*v3);
@@ -2076,9 +2076,9 @@ int lod_dir_striping_create_internal(const struct lu_env *env,
                v3->lmm_stripe_count = cpu_to_le16(lo->ldo_def_stripenr);
                v3->lmm_stripe_offset = cpu_to_le16(lo->ldo_def_stripe_offset);
                v3->lmm_stripe_size = cpu_to_le32(lo->ldo_def_stripe_size);
-               if (lo->ldo_pool)
-                       strncpy(v3->lmm_pool_name, lo->ldo_pool,
-                               LOV_MAXPOOLNAME);
+               if (lo->ldo_pool != NULL)
+                       strlcpy(v3->lmm_pool_name, lo->ldo_pool,
+                               sizeof(v3->lmm_pool_name));
 
                info->lti_buf.lb_buf = v3;
                info->lti_buf.lb_len = sizeof(*v3);