Motr  M0
dir.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016-2020 Seagate Technology LLC and/or its Affiliates
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * For any questions about this software or licensing,
17  * please email opensource@seagate.com or cortx-questions@seagate.com.
18  *
19  */
20 
21 #pragma once
22 #ifndef __MOTR_CONF_DIR_H__
23 #define __MOTR_CONF_DIR_H__
24 
25 #include "lib/tlist.h"
26 
33 /* defined in conf/objs/dir.c */
35 M0_TL_DECLARE(m0_conf_dir, M0_INTERNAL, struct m0_conf_obj);
36 
43 M0_INTERNAL void m0_conf_dir_add(struct m0_conf_dir *dir,
44  struct m0_conf_obj *obj);
45 
52 M0_INTERNAL void m0_conf_dir_del(struct m0_conf_dir *dir,
53  struct m0_conf_obj *obj);
54 
56 M0_INTERNAL bool m0_conf_dir_elems_match(const struct m0_conf_dir *dir,
57  const struct m0_fid_arr *fids);
58 
59 static inline uint32_t m0_conf_dir_len(const struct m0_conf_dir *dir)
60 {
61  return m0_conf_dir_tlist_length(&dir->cd_items);
62 }
63 
77 M0_INTERNAL int m0_conf_dir_new(struct m0_conf_obj *parent,
78  const struct m0_fid *relfid,
79  const struct m0_conf_obj_type *children_type,
80  const struct m0_fid_arr *children_ids,
81  struct m0_conf_dir **out);
82 
84 #endif /* __MOTR_CONF_DIR_H__ */
M0_TL_DECLARE(m0_conf_dir, M0_INTERNAL, struct m0_conf_obj)
M0_INTERNAL void m0_conf_dir_add(struct m0_conf_dir *dir, struct m0_conf_obj *obj)
Definition: dir.c:43
M0_TL_DESCR_DECLARE(m0_conf_dir, M0_EXTERN)
static struct foo * obj
Definition: tlist.c:302
M0_INTERNAL int m0_conf_dir_new(struct m0_conf_obj *parent, const struct m0_fid *relfid, const struct m0_conf_obj_type *children_type, const struct m0_fid_arr *children_ids, struct m0_conf_dir **out)
Definition: dir.c:159
static uint32_t m0_conf_dir_len(const struct m0_conf_dir *dir)
Definition: dir.h:59
Definition: fid.h:43
static const struct m0_fid fids[]
Definition: diter.c:76
Definition: fid.h:38
struct inode * dir
Definition: dir.c:1028
M0_INTERNAL void m0_conf_dir_del(struct m0_conf_dir *dir, struct m0_conf_obj *obj)
Definition: dir.c:53
#define out(...)
Definition: gen.c:41
M0_INTERNAL bool m0_conf_dir_elems_match(const struct m0_conf_dir *dir, const struct m0_fid_arr *fids)
Definition: dir.c:63