Motr
M0
common.c
Go to the documentation of this file.
1
/* -*- C -*- */
2
/*
3
* Copyright (c) 2021 Seagate Technology LLC and/or its Affiliates
4
*
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
* you may not use this file except in compliance with the License.
7
* You may obtain a copy of the License at
8
*
9
* http://www.apache.org/licenses/LICENSE-2.0
10
*
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
16
*
17
* For any questions about this software or licensing,
18
* please email opensource@seagate.com or cortx-questions@seagate.com.
19
*/
20
21
#include <
string.h
>
22
23
#include "
lib/misc.h
"
24
#include "
fid/fid.h
"
25
26
void
isc_fid_get
(
const
char
*f_name,
struct
m0_fid
*
fid
)
27
{
28
uint32_t
f_key
=
m0_full_name_hash
((
const
unsigned
char
*)f_name,
29
strlen(f_name));
30
uint32_t f_cont =
m0_full_name_hash
((
const
unsigned
char
*)
"libdemo"
,
31
strlen(
"libdemo"
));
32
33
m0_fid_set
(
fid
, f_cont,
f_key
);
34
}
35
36
/*
37
* Local variables:
38
* c-indentation-style: "K&R"
39
* c-basic-offset: 8
40
* tab-width: 8
41
* fill-column: 80
42
* scroll-step: 1
43
* End:
44
*/
fid.h
isc_fid_get
void isc_fid_get(const char *f_name, struct m0_fid *fid)
Definition:
common.c:26
string.h
fid
struct m0_fid fid
Definition:
di.c:46
m0_fid_set
M0_INTERNAL void m0_fid_set(struct m0_fid *fid, uint64_t container, uint64_t key)
Definition:
fid.c:116
f_key
uint64_t f_key
Definition:
fid.h:329
m0_fid
Definition:
fid.h:38
misc.h
m0_full_name_hash
M0_INTERNAL unsigned int m0_full_name_hash(const unsigned char *name, unsigned int len)
Definition:
misc.c:266
iscservice
demo
common.c
Generated on Thu Apr 14 2022 14:02:51 for Motr by
1.8.14