Motr  M0
obj_ops.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2013-2020 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 
22 #pragma once
23 #ifndef __MOTR_CONF_OBJOPS_H__
24 #define __MOTR_CONF_OBJOPS_H__
25 
26 #include "conf/obj.h"
27 
28 struct m0_conf_cache;
29 struct m0_confx_obj;
30 struct m0_fid_arr;
31 
53 
74 };
75 
79  bool (*coo_invariant)(const struct m0_conf_obj *obj);
80 
88  const struct m0_confx_obj *src);
89 
95  const struct m0_conf_obj *src);
96 
101  bool (*coo_match)(const struct m0_conf_obj *cached,
102  const struct m0_confx_obj *flat);
103 
118  int (*coo_lookup)(const struct m0_conf_obj *parent,
119  const struct m0_fid *name, struct m0_conf_obj **out);
120 
140  int (*coo_readdir)(const struct m0_conf_obj *dir,
141  struct m0_conf_obj **pptr);
142 
151  const struct m0_fid **(*coo_downlinks)(const struct m0_conf_obj *obj);
152 
159  void (*coo_delete)(struct m0_conf_obj *obj);
160 };
161 
173 M0_INTERNAL struct m0_conf_obj *m0_conf_obj_create(const struct m0_fid *id,
174  struct m0_conf_cache *cache);
175 
184 M0_INTERNAL int m0_conf_obj_find(struct m0_conf_cache *cache,
185  const struct m0_fid *id,
186  struct m0_conf_obj **out);
187 
188 M0_INTERNAL int m0_conf_obj_find_lock(struct m0_conf_cache *cache,
189  const struct m0_fid *id,
190  struct m0_conf_obj **out);
196 M0_INTERNAL void m0_conf_obj_delete(struct m0_conf_obj *obj);
197 
199 M0_INTERNAL bool m0_conf_obj_invariant(const struct m0_conf_obj *obj);
200 
208 M0_INTERNAL void m0_conf_obj_get(struct m0_conf_obj *obj);
209 
210 M0_INTERNAL void m0_conf_obj_get_lock(struct m0_conf_obj *obj);
220 M0_INTERNAL void m0_conf_obj_put(struct m0_conf_obj *obj);
221 
241 M0_INTERNAL int m0_conf_obj_fill(struct m0_conf_obj *dest,
242  const struct m0_confx_obj *src);
243 
253 M0_INTERNAL bool m0_conf_obj_match(const struct m0_conf_obj *cached,
254  const struct m0_confx_obj *flat);
255 
257 #endif /* __MOTR_CONF_OBJOPS_H__ */
Definition: beck.c:235
M0_INTERNAL void m0_conf_obj_put(struct m0_conf_obj *obj)
Definition: obj_ops.c:205
M0_INTERNAL int m0_conf_obj_find_lock(struct m0_conf_cache *cache, const struct m0_fid *id, struct m0_conf_obj **out)
Definition: obj_ops.c:154
M0_INTERNAL bool m0_conf_obj_invariant(const struct m0_conf_obj *obj)
Definition: obj_ops.c:52
bool(* coo_invariant)(const struct m0_conf_obj *obj)
Definition: obj_ops.h:79
void(* coo_delete)(struct m0_conf_obj *obj)
Definition: obj_ops.h:159
static struct foo * obj
Definition: tlist.c:302
int(* coo_readdir)(const struct m0_conf_obj *dir, struct m0_conf_obj **pptr)
Definition: obj_ops.h:140
const char * name
Definition: trace.c:110
M0_INTERNAL int m0_conf_obj_fill(struct m0_conf_obj *dest, const struct m0_confx_obj *src)
Definition: obj_ops.c:232
M0_INTERNAL void m0_conf_obj_delete(struct m0_conf_obj *obj)
Definition: obj_ops.c:167
Definition: fid.h:43
M0_INTERNAL void m0_conf_obj_get_lock(struct m0_conf_obj *obj)
Definition: obj_ops.c:198
int(* coo_decode)(struct m0_conf_obj *dest, const struct m0_confx_obj *src)
Definition: obj_ops.h:87
Definition: fid.h:38
int(* coo_lookup)(const struct m0_conf_obj *parent, const struct m0_fid *name, struct m0_conf_obj **out)
Definition: obj_ops.h:118
m0_conf_dirval
Definition: obj_ops.h:64
M0_INTERNAL void m0_conf_obj_get(struct m0_conf_obj *obj)
Definition: obj_ops.c:186
int(* coo_encode)(struct m0_confx_obj *dest, const struct m0_conf_obj *src)
Definition: obj_ops.h:94
struct inode * dir
Definition: dir.c:1028
M0_INTERNAL bool m0_conf_obj_match(const struct m0_conf_obj *cached, const struct m0_confx_obj *flat)
Definition: obj_ops.c:254
#define out(...)
Definition: gen.c:41
bool(* coo_match)(const struct m0_conf_obj *cached, const struct m0_confx_obj *flat)
Definition: obj_ops.h:101
M0_INTERNAL int m0_conf_obj_find(struct m0_conf_cache *cache, const struct m0_fid *id, struct m0_conf_obj **out)
Definition: obj_ops.c:136
struct m0_pdclust_src_addr src
Definition: fd.c:108
M0_INTERNAL struct m0_conf_obj * m0_conf_obj_create(const struct m0_fid *id, struct m0_conf_cache *cache)
Definition: obj_ops.c:80