#include <string.h>
#include <assert.h>
-#define PROGRAM_NAME "mkfs.ubifs"
-#include "common.h"
-#include "defs.h"
#include "fscrypt.h"
+#include "defs.h"
+#include "ubifs.h"
+
+/* common.h requires the PROGRAM_NAME macro */
+extern struct ubifs_info info_;
+#define PROGRAM_NAME (info_.program_name)
+#include "common.h"
static int do_hash(const EVP_MD *md, const unsigned char *in, size_t len, unsigned char *out)
{
#include <byteswap.h>
#include <errno.h>
+#define MKFS_PROGRAM_NAME "mkfs.ubifs"
+
+enum { MKFS_PROGRAM_TYPE = 0 };
+
extern int debug_level;
#define dbg_msg(lvl, fmt, ...) do {if (debug_level >= lvl) \
#include <endian.h>
-#define PROGRAM_NAME "mkfs.ubifs"
-#include "common.h"
#include "fscrypt.h"
#include "defs.h"
+#include "ubifs.h"
+/* common.h requires the PROGRAM_NAME macro */
+extern struct ubifs_info info_;
+#define PROGRAM_NAME (info_.program_name)
+#include "common.h"
static __u8 fscrypt_masterkey[FS_MAX_KEY_SIZE];
static struct cipher *fscrypt_cipher;
/* Copyright (C) 2004 Christopher Clark <firstname.lastname@cl.cam.ac.uk> */
-#define PROGRAM_NAME "hashtable"
-
-#include "common.h"
-#include "hashtable.h"
-#include "hashtable_private.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
+#include "ubifs.h"
+#include "hashtable.h"
+#include "hashtable_private.h"
+
+/* common.h requires the PROGRAM_NAME macro */
+extern struct ubifs_info info_;
+#define PROGRAM_NAME (info_.program_name)
+#include "common.h"
+
/*
Credit for primes table: Aaron Krowne
http://br.endernet.org/~akrowne/
#include <openssl/evp.h>
#endif
-#define PROGRAM_NAME "mkfs.ubifs"
-#include "common.h"
#include "lpt.h"
#include "defs.h"
#include "ubifs.h"
#include "crc16.h"
#include "sign.h"
+/* common.h requires the PROGRAM_NAME macro */
+extern struct ubifs_info info_;
+#define PROGRAM_NAME (info_.program_name)
+#include "common.h"
+
/**
* do_calc_lpt_geom - calculate sizes for the LPT area.
* @c: the UBIFS file-system description object
* @highest_inum: highest used inode number
* @max_sqnum: current global sequence number
*
+ * @program_type: used to identify the type of current program
+ * @program_name: program name
+ *
* @jhead_cnt: count of journal heads
* @max_bud_bytes: maximum number of bytes allowed in buds
*
ino_t highest_inum;
unsigned long long max_sqnum;
+ int program_type;
+ const char *program_name;
+
int jhead_cnt;
long long max_bud_bytes;
{
int err;
+ info_.program_name = MKFS_PROGRAM_NAME;
+ info_.program_type = MKFS_PROGRAM_TYPE;
+
if (crypto_init())
return -1;