Skip to content
This repository was archived by the owner on May 3, 2024. It is now read-only.

Commit 6283f5d

Browse files
committed
CORTX-32172: Fixes ADDB client logs to bundled it in rgw support bundle
Signed-off-by: Rahul Kumar <[email protected]>
1 parent 60c6d3b commit 6283f5d

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

motr/client.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ struct m0_client_layout {
845845

846846
/**
847847
* Index attributes.
848-
*
848+
*
849849
* This is supplied by an application and return by the implementation
850850
* when an index is created.
851851
*
@@ -1002,6 +1002,8 @@ struct m0_config {
10021002
* ADDB size
10031003
*/
10041004
m0_bcount_t mc_addb_size;
1005+
1006+
const char *mc_addb_stob_location;
10051007
};
10061008

10071009
/** The identifier of the root of realm hierarchy. */

motr/client_init.c

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,8 +1527,13 @@ M0_INTERNAL int m0_client_global_init(void)
15271527
return M0_RC(rc);
15281528
}
15291529

1530+
/**
1531+
* To get the enviroment value for M0_CLIENT_ADDB_DIR
1532+
*/
1533+
#ifndef __KERNEL__
1534+
#include <stdlib.h>
1535+
#endif
15301536
#define NOT_EMPTY(x) (x != NULL && *x != '\0')
1531-
15321537
static struct m0 m0_client_motr_instance;
15331538
int m0_client_init(struct m0_client **m0c_p,
15341539
struct m0_config *conf, bool init_m0)
@@ -1678,7 +1683,7 @@ int m0_client_init(struct m0_client **m0c_p,
16781683
}
16791684

16801685
if (conf->mc_is_addb_init) {
1681-
char buf[64];
1686+
char buf[128];
16821687
/* Default client addb record file size set to 128M */
16831688
m0_bcount_t size = DEFAULT_CLIENT_ADDB2_RECORD_SIZE;
16841689
if (conf->mc_addb_size != 0) {
@@ -1687,7 +1692,15 @@ int m0_client_init(struct m0_client **m0c_p,
16871692
size = conf->mc_addb_size;
16881693
M0_LOG(M0_DEBUG, "ADDB size = %" PRIu64 "", size);
16891694
}
1690-
sprintf(buf, "linuxstob:./addb_%d", (int)m0_pid());
1695+
#ifndef __KERNEL__
1696+
conf->mc_addb_stob_location = getenv("M0_CLIENT_ADDB_DIR");
1697+
#endif
1698+
if(conf->mc_addb_stob_location == NULL)
1699+
{
1700+
conf->mc_addb_stob_location = ".";
1701+
}
1702+
sprintf(buf, "linuxstob:%s/addb_%d",
1703+
conf->mc_addb_stob_location, (int)m0_pid());
16911704
M0_LOG(M0_DEBUG, "addb size=%llu\n", (unsigned long long)size);
16921705
rc = m0_reqh_addb2_init(&m0c->m0c_reqh, buf,
16931706
0xaddbf11e, true, true, size);

0 commit comments

Comments
 (0)