staging/lustre: Convert lustre_cfg_new/free to use kzalloc/kfree
[firefly-linux-kernel-4.4.55.git] / drivers / staging / lustre / lustre / include / lustre_cfg.h
index 03017fe49d46748c5d84ab378508575ff0224c89..c80d78e5b30d00335e426d86bc04b94610fde996 100644 (file)
@@ -231,8 +231,8 @@ static inline struct lustre_cfg *lustre_cfg_new(int cmd,
        char *ptr;
        int i;
 
-       OBD_ALLOC(lcfg, lustre_cfg_len(bufs->lcfg_bufcount,
-                                      bufs->lcfg_buflen));
+       lcfg = kzalloc(lustre_cfg_len(bufs->lcfg_bufcount, bufs->lcfg_buflen),
+                      GFP_NOFS);
        if (!lcfg)
                return ERR_PTR(-ENOMEM);
 
@@ -254,7 +254,7 @@ static inline void lustre_cfg_free(struct lustre_cfg *lcfg)
 
        len = lustre_cfg_len(lcfg->lcfg_bufcount, lcfg->lcfg_buflens);
 
-       OBD_FREE(lcfg, len);
+       kfree(lcfg);
        return;
 }
 
@@ -290,4 +290,4 @@ static inline int lustre_cfg_sanity_check(void *buf, int len)
 
 /** @} cfg */
 
-#endif // _LUSTRE_CFG_H
+#endif /* _LUSTRE_CFG_H */