#ifndef _LUSTRE_CFG_H
 #define _LUSTRE_CFG_H
 
+#include <linux/errno.h>
+#include <linux/kernel.h>
 #include "../../../../lustre/include/lustre/lustre_user.h"
 
 /** \defgroup cfg cfg
 #define LUSTRE_CFG_MAX_BUFCOUNT 8
 
 #define LCFG_HDR_SIZE(count) \
-       cfs_size_round(offsetof(struct lustre_cfg, lcfg_buflens[(count)]))
+       __ALIGN_KERNEL(offsetof(struct lustre_cfg, lcfg_buflens[(count)]), 8)
 
 /** If the LCFG_REQUIRED bit is set in a configuration command,
  * then the client is required to understand this parameter
 
        offset = LCFG_HDR_SIZE(lcfg->lcfg_bufcount);
        for (i = 0; i < index; i++)
-               offset += cfs_size_round(lcfg->lcfg_buflens[i]);
+               offset += __ALIGN_KERNEL(lcfg->lcfg_buflens[i], 8);
        return (char *)lcfg + offset;
 }
 
 
        len = LCFG_HDR_SIZE(bufcount);
        for (i = 0; i < bufcount; i++)
-               len += cfs_size_round(buflens[i]);
+               len += __ALIGN_KERNEL(buflens[i], 8);
 
-       return cfs_size_round(len);
+       return __ALIGN_KERNEL(len, 8);
 }
 
 static inline void lustre_cfg_init(struct lustre_cfg *lcfg, int cmd,
        ptr = (char *)lcfg + LCFG_HDR_SIZE(lcfg->lcfg_bufcount);
        for (i = 0; i < lcfg->lcfg_bufcount; i++) {
                lcfg->lcfg_buflens[i] = bufs->lcfg_buflen[i];
-               LOGL((char *)bufs->lcfg_buf[i], bufs->lcfg_buflen[i], ptr);
+               if (bufs->lcfg_buf[i]) {
+                       memcpy(ptr, bufs->lcfg_buf[i], bufs->lcfg_buflen[i]);
+                       ptr += __ALIGN_KERNEL(bufs->lcfg_buflen[i], 8);
+               }
        }
 }