Motr  M0
cob.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2011-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 
23 #pragma once
24 
25 #ifndef __MOTR_COB_COB_H__
26 #define __MOTR_COB_COB_H__
27 
28 #include "file/file.h"
29 #include "lib/atomic.h"
30 #include "lib/rwlock.h"
31 #include "lib/refs.h"
32 #include "lib/bitstring.h"
33 #include "lib/bitstring_xc.h"
34 #include "fid/fid.h"
35 #include "mdservice/md_fid.h"
36 #include "be/btree.h"
37 #include "be/btree_xc.h"
38 
39 /* import */
40 struct m0_be_tx;
41 struct m0_be_btree;
42 struct m0_be_domain;
43 struct m0_stob;
44 
217 struct m0_cob;
218 struct m0_fid;
219 struct m0_cob_id;
220 struct m0_cob_domain;
221 struct m0_cob_domain_id;
222 
223 /*
224  * This is used to separate the range of COB IDs for IOS-es and MDS-es, which is
225  * needed to do correct restart and match cob domains by id for each service
226  * which uses its own cob-domain.
227  */
228 enum {
231 };
232 
240  uint64_t id;
241 } M0_XCA_RECORD M0_XCA_DOMAIN(be);
242 
266  /*
267  * m0_be_btree has it's own volatile-only fields, so it can't be placed
268  * before the m0_format_footer, where only persistent fields allowed
269  */
277 } M0_XCA_RECORD M0_XCA_DOMAIN(be);
278 
281 
282  /* future versions, uncomment and update M0_COB_DOMAIN_FORMAT_VERSION */
283  /*M0_COB_DOMAIN_FORMAT_VERSION_2,*/
284  /*M0_COB_DOMAIN_FORMAT_VERSION_3,*/
285 
288 };
289 
291  struct m0_be_seg *seg);
292 void m0_cob_domain_fini(struct m0_cob_domain *dom);
293 
296  struct m0_sm_group *grp,
297  const struct m0_cob_domain_id *cdid,
298  struct m0_be_domain *bedom,
299  struct m0_be_seg *seg);
300 
306  struct m0_sm_group *grp,
307  struct m0_be_domain *bedom);
308 
309 M0_INTERNAL int m0_cob_domain_credit_add(struct m0_cob_domain *dom,
310  struct m0_be_domain *bedom,
311  struct m0_be_seg *seg,
312  const struct m0_cob_domain_id *cdid,
313  struct m0_be_tx_credit *cred);
314 
315 M0_INTERNAL
317  struct m0_sm_group *grp,
318  const struct m0_cob_domain_id *cdid,
319  struct m0_be_domain *bedom,
320  struct m0_be_seg *seg,
321  struct m0_be_tx *tx);
322 
327 M0_INTERNAL int m0_cob_domain_mkfs(struct m0_cob_domain *dom,
328  const struct m0_fid *rootfid,
329  struct m0_be_tx *tx);
330 
335  M0_COB_ATIME = 1 << 0,
336  M0_COB_MTIME = 1 << 1,
337  M0_COB_CTIME = 1 << 2,
338  M0_COB_SIZE = 1 << 3,
339  M0_COB_MODE = 1 << 4,
340  M0_COB_UID = 1 << 5,
341  M0_COB_GID = 1 << 6,
342  M0_COB_BLOCKS = 1 << 7,
343  M0_COB_TYPE = 1 << 8,
344  M0_COB_FLAGS = 1 << 9,
345  M0_COB_NLINK = 1 << 10,
346  M0_COB_RDEV = 1 << 11,
347  M0_COB_BLKSIZE = 1 << 12,
348  M0_COB_LID = 1 << 13,
349  M0_COB_PVER = 1 << 14
350 };
351 
352 #define M0_COB_ALL (M0_COB_ATIME | M0_COB_MTIME | M0_COB_CTIME | \
353  M0_COB_SIZE | M0_COB_MODE | M0_COB_UID | M0_COB_GID | \
354  M0_COB_BLOCKS | M0_COB_TYPE | M0_COB_FLAGS | M0_COB_NLINK |\
355  M0_COB_RDEV | M0_COB_BLKSIZE | M0_COB_LID | M0_COB_PVER)
356 
363 struct m0_cob_attr {
364  struct m0_fid ca_pfid;
365  struct m0_fid ca_tfid;
366  struct m0_fid ca_pver;
367  uint32_t ca_valid;
368  uint32_t ca_mode;
369  uint32_t ca_uid;
370  uint32_t ca_gid;
371  uint64_t ca_atime;
372  uint64_t ca_mtime;
373  uint64_t ca_ctime;
374  uint64_t ca_rdev;
375  uint32_t ca_nlink;
376  uint64_t ca_size;
377  uint64_t ca_blksize;
378  uint64_t ca_blocks;
379  uint64_t ca_version;
380  uint64_t ca_lid;
381  struct m0_buf ca_name;
382  struct m0_buf ca_link;
383  struct m0_buf ca_eakey;
384  struct m0_buf ca_eaval;
385 };
386 
390 struct m0_cob_nskey {
391  struct m0_fid cnk_pfid;
393 } M0_XCA_RECORD M0_XCA_DOMAIN(be);
394 
395 M0_INTERNAL size_t m0_cob_nskey_size(const struct m0_cob_nskey *nskey);
396 
400 M0_INTERNAL int m0_cob_nskey_cmp(const struct m0_cob_nskey *k0,
401  const struct m0_cob_nskey *k1);
402 
409 M0_INTERNAL void m0_cob_init(struct m0_cob_domain *dom, struct m0_cob *cob);
417 struct m0_cob_nsrec {
419  struct m0_fid cnr_fid;
420  uint32_t cnr_linkno;
426  uint32_t cnr_nlink;
427  uint32_t cnr_cntr;
428  char cnr_pad[4];
429  uint64_t cnr_omgid;
430  uint64_t cnr_size;
431  uint64_t cnr_bytecount;
432  uint64_t cnr_blksize;
433  uint64_t cnr_blocks;
434  uint64_t cnr_atime;
435  uint64_t cnr_mtime;
436  uint64_t cnr_ctime;
437  uint64_t cnr_lid;
438  struct m0_fid cnr_pver;
440 } M0_XCA_RECORD M0_XCA_DOMAIN(be);
441 
444 
445  /* future versions, uncomment and update M0_COB_NSREC_FORMAT_VERSION */
446  /*M0_COB_NSREC_FORMAT_VERSION_2,*/
447  /*M0_COB_NSREC_FORMAT_VERSION_3,*/
448 
451 };
452 
453 M0_INTERNAL void m0_cob_nsrec_init(struct m0_cob_nsrec *nsrec);
456 struct m0_cob_oikey {
457  struct m0_fid cok_fid;
458  uint32_t cok_linkno;
459 } M0_XCA_RECORD M0_XCA_DOMAIN(be);
460 
474  struct m0_fid cfb_fid;
475 } M0_XCA_RECORD M0_XCA_DOMAIN(be);
476 
478  struct m0_fid cfb_pver;
479  uint64_t cfb_version;
480  uint64_t cfb_layoutid;
481  uint32_t cfb_linklen;
482  char cfb_link[0];
483  /* add ACL, Besides ACL, no further metadata is needed for stat(2). */
484 } M0_XCA_RECORD M0_XCA_DOMAIN(be);
485 
490  uint64_t cok_omgid;
491 } M0_XCA_RECORD M0_XCA_DOMAIN(be);
492 
497  uint32_t cor_uid;
498  uint32_t cor_mode;
499  uint32_t cor_gid;
500 } M0_XCA_RECORD M0_XCA_DOMAIN(be);
501 
503 struct m0_cob_eakey {
504  struct m0_fid cek_fid;
506 } M0_XCA_RECORD M0_XCA_DOMAIN(be);
507 
509 struct m0_cob_earec {
510  uint32_t cer_size;
511  char cer_body[0];
512 } M0_XCA_RECORD M0_XCA_DOMAIN(be);
513 
515 struct m0_cob_bckey {
516  struct m0_fid cbk_pfid;
517  uint64_t cbk_user_id;
518 } M0_XCA_RECORD M0_XCA_DOMAIN(be);
519 
521 struct m0_cob_bcrec {
522  uint64_t cbr_bytecount;
523  uint64_t cbr_cob_objects;
524 } M0_XCA_RECORD M0_XCA_DOMAIN(be);
525 
581 struct m0_cob {
583  struct m0_stob *co_stob;
584  struct m0_ref co_ref;
585  uint64_t co_flags;
586  struct m0_file co_file;
593 };
594 
598 struct m0_dirent {
599  uint32_t d_namelen;
600  uint32_t d_reclen;
601  char d_name[0];
602 };
603 
607 struct m0_rdpg {
609  struct m0_buf r_buf;
611 };
612 
617  struct m0_cob *ci_cob;
620 };
621 
626  struct m0_cob *ci_cob;
630 };
631 
636  struct m0_cob *ci_cob;
640 };
641 
646  M0_CA_NSKEY = (1 << 0),
647  M0_CA_NSKEY_FREE = (1 << 1),
648  M0_CA_NSREC = (1 << 2),
649  M0_CA_FABREC = (1 << 3),
650  M0_CA_OMGREC = (1 << 4),
651  M0_CA_LAYOUT = (1 << 5),
652  M0_CA_BCREC = (1 << 6),
653 };
654 
670 M0_INTERNAL int m0_cob_lookup(struct m0_cob_domain *dom,
671  struct m0_cob_nskey *nskey,
672  uint64_t flags,
673  struct m0_cob **out);
674 
690 M0_INTERNAL int m0_cob_locate(struct m0_cob_domain *dom,
691  struct m0_cob_oikey *oikey,
692  uint64_t flags,
693  struct m0_cob **out);
694 
708 M0_INTERNAL int m0_cob_create(struct m0_cob *cob,
709  struct m0_cob_nskey *nskey,
710  struct m0_cob_nsrec *nsrec,
711  struct m0_cob_fabrec *fabrec,
712  struct m0_cob_omgrec *omgrec,
713  struct m0_be_tx *tx);
714 
727 M0_INTERNAL int m0_cob_delete(struct m0_cob *cob, struct m0_be_tx *tx);
728 
734 M0_INTERNAL int m0_cob_delete_put(struct m0_cob *cob, struct m0_be_tx *tx);
735 
746 M0_INTERNAL int m0_cob_update(struct m0_cob *cob,
747  struct m0_cob_nsrec *nsrec,
748  struct m0_cob_fabrec *fabrec,
749  struct m0_cob_omgrec *omgrec,
750  struct m0_be_tx *tx);
751 
759 M0_INTERNAL int m0_cob_name_add(struct m0_cob *cob,
760  struct m0_cob_nskey *nskey,
761  struct m0_cob_nsrec *nsrec,
762  struct m0_be_tx *tx);
763 
771 M0_INTERNAL int m0_cob_name_del(struct m0_cob *cob,
772  struct m0_cob_nskey *nskey,
773  struct m0_be_tx *tx);
774 
783 M0_INTERNAL int m0_cob_name_update(struct m0_cob *cob,
784  struct m0_cob_nskey *srckey,
785  struct m0_cob_nskey *tgtkey,
786  struct m0_be_tx *tx);
787 
789 M0_INTERNAL size_t m0_cob_max_earec_size(void);
790 
794 M0_INTERNAL int m0_cob_eakey_make(struct m0_cob_eakey **keyh,
795  const struct m0_fid *fid,
796  const char *name,
797  size_t namelen);
798 
802 M0_INTERNAL int m0_cob_ea_get(struct m0_cob *cob,
803  struct m0_cob_eakey *eakey,
804  struct m0_cob_earec *out,
805  struct m0_be_tx *tx);
806 
811 M0_INTERNAL int m0_cob_ea_set(struct m0_cob *cob,
812  struct m0_cob_eakey *eakey,
813  struct m0_cob_earec *earec,
814  struct m0_be_tx *tx);
815 
819 M0_INTERNAL int m0_cob_ea_del(struct m0_cob *cob,
820  struct m0_cob_eakey *eakey,
821  struct m0_be_tx *tx);
822 
826 M0_INTERNAL int m0_cob_ea_iterator_init(struct m0_cob *cob,
827  struct m0_cob_ea_iterator *it,
828  struct m0_bitstring *name);
829 
837 M0_INTERNAL int m0_cob_ea_iterator_next(struct m0_cob_ea_iterator *it);
838 
846 M0_INTERNAL int m0_cob_ea_iterator_get(struct m0_cob_ea_iterator *it);
847 
851 M0_INTERNAL void m0_cob_ea_iterator_fini(struct m0_cob_ea_iterator *it);
852 
867 M0_INTERNAL int m0_cob_bc_lookup(struct m0_cob *cob,
868  struct m0_cob_bckey *bc_key,
869  struct m0_cob_bcrec *bc_rec);
870 
883 M0_INTERNAL int m0_cob_bc_insert(struct m0_cob *cob,
884  struct m0_cob_bckey *bc_key,
885  struct m0_cob_bcrec *bc_val,
886  struct m0_be_tx *tx);
887 
900 M0_INTERNAL int m0_cob_bc_update(struct m0_cob *cob,
901  struct m0_cob_bckey *bc_key,
902  struct m0_cob_bcrec *bc_val,
903  struct m0_be_tx *tx);
904 
917 M0_INTERNAL int m0_cob_bc_iterator_init(struct m0_cob *cob,
918  struct m0_cob_bc_iterator *it,
919  const struct m0_fid *pver_fid,
920  uint64_t user_id);
921 
929 M0_INTERNAL int m0_cob_bc_iterator_next(struct m0_cob_bc_iterator *it);
930 
939 M0_INTERNAL int m0_cob_bc_iterator_get(struct m0_cob_bc_iterator *it);
940 
963 M0_INTERNAL int m0_cob_bc_entries_dump(struct m0_cob_domain *cdom,
964  struct m0_buf **out_keys,
965  struct m0_buf **out_recs,
966  uint32_t *out_count);
967 
971 M0_INTERNAL void m0_cob_bc_iterator_fini(struct m0_cob_bc_iterator *it);
972 
976 M0_INTERNAL int m0_cob_iterator_init(struct m0_cob *cob,
977  struct m0_cob_iterator *it,
978  struct m0_bitstring *name);
979 
987 M0_INTERNAL int m0_cob_iterator_next(struct m0_cob_iterator *it);
988 
996 M0_INTERNAL int m0_cob_iterator_get(struct m0_cob_iterator *it);
997 
1001 M0_INTERNAL void m0_cob_iterator_fini(struct m0_cob_iterator *it);
1002 
1006 M0_INTERNAL int m0_cob_alloc(struct m0_cob_domain *dom, struct m0_cob **out);
1007 
1013 M0_INTERNAL void m0_cob_get(struct m0_cob *obj);
1014 
1023 M0_INTERNAL void m0_cob_put(struct m0_cob *obj);
1024 
1030 M0_INTERNAL void m0_cob_oikey_make(struct m0_cob_oikey *oikey,
1031  const struct m0_fid *fid, int linkno);
1032 
1037 M0_INTERNAL int m0_cob_nskey_make(struct m0_cob_nskey **keyh,
1038  const struct m0_fid *pfid,
1039  const char *name, size_t namelen);
1040 
1045 M0_INTERNAL int m0_cob_fabrec_make(struct m0_cob_fabrec **rech,
1046  const char *link, size_t linklen);
1047 
1055 M0_INTERNAL int m0_cob_setattr(struct m0_cob *cob,
1056  struct m0_cob_attr *attr,
1057  struct m0_be_tx *tx);
1058 
1059 M0_INTERNAL int m0_cob_size_update(struct m0_cob *cob, uint64_t size,
1060  struct m0_be_tx *tx);
1065 /* XXX move tx to the end of the declaration */
1066 M0_INTERNAL int m0_cob_alloc_omgid(struct m0_cob_domain *dom,uint64_t * omgid);
1067 
1085 } M0_XCA_ENUM;
1086 
1087 M0_INTERNAL void m0_cob_tx_credit(struct m0_cob_domain *dom,
1088  enum m0_cob_op optype,
1089  struct m0_be_tx_credit *accum);
1090 
1092 M0_INTERNAL void m0_cob_ea_get_credit(struct m0_cob *cob,
1093  struct m0_cob_eakey *eakey,
1094  struct m0_cob_earec *out,
1095  struct m0_be_tx_credit *accum);
1097 M0_INTERNAL void m0_cob_ea_set_credit(struct m0_cob *cob,
1098  struct m0_cob_eakey *eakey,
1099  struct m0_cob_earec *earec,
1100  struct m0_be_tx_credit *accum);
1102 M0_INTERNAL void m0_cob_ea_del_credit(struct m0_cob *cob,
1103  struct m0_cob_eakey *eakey,
1104  struct m0_be_tx_credit *accum);
1106 M0_INTERNAL void m0_cob_ea_iterator_init_credit(struct m0_cob *cob,
1107  struct m0_cob_ea_iterator *it,
1108  struct m0_bitstring *name,
1109  struct m0_be_tx_credit *accum);
1110 
1111 M0_INTERNAL const struct m0_fid *m0_cob_fid(const struct m0_cob *cob);
1112 
1116 M0_INTERNAL int m0_cob_mod_init(void);
1117 
1121 M0_INTERNAL void m0_cob_mod_fini(void);
1122 
1123 extern const struct m0_fid_type m0_cob_fid_type;
1127 };
1128 
1129 extern const struct m0_fid_type m0_cob_fid_type;
1130 
1132 #endif /* __MOTR_COB_COB_H__ */
1133 
1134 /*
1135  * Local variables:
1136  * c-indentation-style: "K&R"
1137  * c-basic-offset: 8
1138  * tab-width: 8
1139  * fill-column: 80
1140  * scroll-step: 1
1141  * End:
1142  */
m0_cob_flags
Definition: cob.h:645
struct m0_cob_nsrec co_nsrec
Definition: cob.h:590
uint64_t ca_lid
Definition: cob.h:380
uint64_t id
Definition: cob.h:240
char d_name[0]
Definition: cob.h:601
uint64_t cnr_mtime
Definition: cob.h:435
uint32_t cnr_nlink
Definition: cob.h:426
Definition: cob.h:581
uint64_t cfb_version
Definition: cob.h:479
M0_INTERNAL int m0_cob_ea_del(struct m0_cob *cob, struct m0_cob_eakey *eakey, struct m0_be_tx *tx)
Definition: cob.c:2193
struct m0_stob * co_stob
Definition: cob.h:583
M0_INTERNAL int m0_cob_bc_iterator_next(struct m0_cob_bc_iterator *it)
Definition: cob.c:467
uint64_t cnr_size
Definition: cob.h:430
uint64_t cbk_user_id
Definition: cob.h:517
int const char const void size_t int flags
Definition: dir.c:328
M0_INTERNAL int m0_cob_domain_mkfs(struct m0_cob_domain *dom, const struct m0_fid *rootfid, struct m0_be_tx *tx)
Definition: cob.c:980
static const uint64_t k1
Definition: hash_fnc.c:34
m0_cob_domain_format_version
Definition: cob.h:279
M0_INTERNAL size_t m0_cob_max_earec_size(void)
Definition: cob.c:241
uint64_t co_flags
Definition: cob.h:585
struct m0_fid ca_tfid
Definition: cob.h:365
struct m0_file co_file
Definition: cob.h:586
uint64_t cnr_blocks
Definition: cob.h:433
struct m0_be_btree cd_object_index
Definition: cob.h:270
M0_INTERNAL int m0_cob_ea_get(struct m0_cob *cob, struct m0_cob_eakey *eakey, struct m0_cob_earec *out, struct m0_be_tx *tx)
Definition: cob.c:2155
m0_cob_nsrec_format_version
Definition: cob.h:442
M0_INTERNAL void m0_cob_iterator_fini(struct m0_cob_iterator *it)
Definition: cob.c:1477
M0_INTERNAL int m0_cob_alloc_omgid(struct m0_cob_domain *dom, uint64_t *omgid)
Definition: cob.c:1634
M0_INTERNAL int m0_cob_mod_init(void)
Definition: cob.c:129
static struct m0_sm_group * grp
Definition: bytecount.c:38
M0_INTERNAL int m0_cob_nskey_cmp(const struct m0_cob_nskey *k0, const struct m0_cob_nskey *k1)
Definition: cob.c:163
uint64_t ca_mtime
Definition: cob.h:372
Definition: cob.h:598
struct m0_cob_domain * co_dom
Definition: cob.h:582
uint64_t cnr_blksize
Definition: cob.h:432
M0_INTERNAL int m0_cob_ea_iterator_next(struct m0_cob_ea_iterator *it)
Definition: cob.c:1593
void m0_cob_domain_fini(struct m0_cob_domain *dom)
Definition: cob.c:726
const struct m0_fid_type m0_cob_fid_type
Definition: cob.h:1129
M0_INTERNAL void m0_cob_put(struct m0_cob *cob)
Definition: cob.c:1095
static struct m0_be_emap_cursor it
Definition: extmap.c:46
uint64_t cnr_atime
Definition: cob.h:434
uint64_t ca_rdev
Definition: cob.h:374
struct m0_format_footer cd_footer
Definition: cob.h:265
M0_INTERNAL int m0_cob_bc_insert(struct m0_cob *cob, struct m0_cob_bckey *bc_key, struct m0_cob_bcrec *bc_val, struct m0_be_tx *tx)
Definition: cob.c:1140
M0_INTERNAL int m0_cob_domain_credit_add(struct m0_cob_domain *dom, struct m0_be_domain *bedom, struct m0_be_seg *seg, const struct m0_cob_domain_id *cdid, struct m0_be_tx_credit *cred)
Definition: cob.c:742
uint32_t ca_valid
Definition: cob.h:367
int m0_cob_domain_create(struct m0_cob_domain **dom, struct m0_sm_group *grp, const struct m0_cob_domain_id *cdid, struct m0_be_domain *bedom, struct m0_be_seg *seg)
Definition: cob.c:840
M0_INTERNAL int m0_cob_fabrec_make(struct m0_cob_fabrec **rech, const char *link, size_t linklen)
Definition: cob.c:262
uint64_t cok_omgid
Definition: cob.h:490
M0_INTERNAL void m0_cob_bc_iterator_fini(struct m0_cob_bc_iterator *it)
Definition: cob.c:489
uint32_t ca_mode
Definition: cob.h:368
struct m0_fid cek_fid
Definition: cob.h:504
struct m0_be_btree cd_fileattr_basic
Definition: cob.h:272
struct m0_cob_bckey * ci_key
Definition: cob.h:638
struct m0_be_btree cd_fileattr_ea
Definition: cob.h:274
M0_INTERNAL int m0_cob_name_update(struct m0_cob *cob, struct m0_cob_nskey *srckey, struct m0_cob_nskey *tgtkey, struct m0_be_tx *tx)
Definition: cob.c:2004
struct m0_buf ca_name
Definition: cob.h:381
static struct m0_cob_domain * cdom
Definition: xform.c:55
m0_cob_op
Definition: cob.h:1068
M0_INTERNAL int m0_cob_size_update(struct m0_cob *cob, uint64_t size, struct m0_be_tx *tx)
Definition: cob.c:2144
static struct foo * obj
Definition: tlist.c:302
M0_INTERNAL void m0_cob_init(struct m0_cob_domain *dom, struct m0_cob *cob)
Definition: cob.c:1057
uint32_t cnr_cntr
Definition: cob.h:427
struct m0_cob_earec * ci_rec
Definition: cob.h:629
uint32_t ca_uid
Definition: cob.h:369
M0_INTERNAL int m0_cob_nskey_make(struct m0_cob_nskey **keyh, const struct m0_fid *pfid, const char *name, size_t namelen)
Definition: cob.c:148
struct m0_fid fid
Definition: di.c:46
uint64_t ca_version
Definition: cob.h:379
M0_INTERNAL void m0_cob_tx_credit(struct m0_cob_domain *dom, enum m0_cob_op optype, struct m0_be_tx_credit *accum)
Definition: cob.c:2281
char cer_body[0]
Definition: cob.h:511
M0_INTERNAL int m0_cob_ea_set(struct m0_cob *cob, struct m0_cob_eakey *eakey, struct m0_cob_earec *earec, struct m0_be_tx *tx)
Definition: cob.c:2171
static const uint64_t k0
Definition: hash_fnc.c:33
struct m0_cob_nskey * co_nskey
Definition: cob.h:588
Definition: buf.h:37
uint32_t cnr_linkno
Definition: cob.h:420
struct m0_fid cbk_pfid
Definition: cob.h:516
struct m0_cob_fabrec * co_fabrec
Definition: cob.h:591
M0_INTERNAL int m0_cob_delete_put(struct m0_cob *cob, struct m0_be_tx *tx)
Definition: cob.c:1853
M0_INTERNAL int m0_cob_bc_update(struct m0_cob *cob, struct m0_cob_bckey *bc_key, struct m0_cob_bcrec *bc_val, struct m0_be_tx *tx)
Definition: cob.c:1161
uint32_t ca_gid
Definition: cob.h:370
M0_INTERNAL void m0_cob_ea_del_credit(struct m0_cob *cob, struct m0_cob_eakey *eakey, struct m0_be_tx_credit *accum)
Definition: cob.c:2372
uint32_t cok_linkno
Definition: cob.h:458
uint32_t d_namelen
Definition: cob.h:599
M0_INTERNAL int m0_cob_iterator_next(struct m0_cob_iterator *it)
Definition: cob.c:1512
M0_INTERNAL int m0_cob_ea_iterator_init(struct m0_cob *cob, struct m0_cob_ea_iterator *it, struct m0_bitstring *name)
Definition: cob.c:1539
const char * name
Definition: trace.c:110
Definition: refs.h:34
static void attr(struct m0_addb2__context *ctx, const uint64_t *v, char *buf)
Definition: dump.c:949
uint64_t cnr_omgid
Definition: cob.h:429
struct m0_bitstring * r_pos
Definition: cob.h:608
Definition: stob.h:163
M0_INTERNAL int m0_cob_name_add(struct m0_cob *cob, struct m0_cob_nskey *nskey, struct m0_cob_nsrec *nsrec, struct m0_be_tx *tx)
Definition: cob.c:1924
struct m0_buf ca_link
Definition: cob.h:382
struct m0_format_header cnr_header
Definition: cob.h:418
static struct m0_cob * cob
Definition: bytecount.c:40
M0_INTERNAL int m0_cob_domain_create_prepared(struct m0_cob_domain **out, struct m0_sm_group *grp, const struct m0_cob_domain_id *cdid, struct m0_be_domain *bedom, struct m0_be_seg *seg, struct m0_be_tx *tx)
Definition: cob.c:763
struct m0_ref co_ref
Definition: cob.h:584
struct m0_bitstring cnk_name
Definition: cob.h:392
struct m0_fid cok_fid
Definition: cob.h:457
uint32_t ca_nlink
Definition: cob.h:375
uint32_t d_reclen
Definition: cob.h:600
struct m0_cob_bcrec * ci_rec
Definition: cob.h:639
M0_INTERNAL void m0_cob_nsrec_init(struct m0_cob_nsrec *nsrec)
Definition: cob.c:2058
struct m0_buf ca_eaval
Definition: cob.h:384
int m0_cob_domain_destroy(struct m0_cob_domain *dom, struct m0_sm_group *grp, struct m0_be_domain *bedom)
Definition: cob.c:871
M0_INTERNAL void m0_cob_oikey_make(struct m0_cob_oikey *oikey, const struct m0_fid *fid, int linkno)
Definition: cob.c:141
M0_INTERNAL void m0_cob_mod_fini(void)
Definition: cob.c:135
struct m0_fid cfb_fid
Definition: cob.h:474
enum m0_cob_op M0_XCA_ENUM
static struct m0_stob_domain * dom
Definition: storage.c:38
M0_INTERNAL int m0_cob_create(struct m0_cob *cob, struct m0_cob_nskey *nskey, struct m0_cob_nsrec *nsrec, struct m0_cob_fabrec *fabrec, struct m0_cob_omgrec *omgrec, struct m0_be_tx *tx)
Definition: cob.c:1681
struct m0_be_rwlock cd_lock
Definition: cob.h:276
M0_INTERNAL void m0_cob_ea_iterator_fini(struct m0_cob_ea_iterator *it)
Definition: cob.c:1620
struct m0_buf ca_eakey
Definition: cob.h:383
uint32_t cor_mode
Definition: cob.h:498
struct m0_cob_nskey * ci_key
Definition: cob.h:619
uint32_t cor_uid
Definition: cob.h:497
uint64_t ca_ctime
Definition: cob.h:373
struct m0_cob_oikey co_oikey
Definition: cob.h:589
M0_INTERNAL int m0_cob_lookup(struct m0_cob_domain *dom, struct m0_cob_nskey *nskey, uint64_t flags, struct m0_cob **out)
Definition: cob.c:1371
uint64_t cfb_layoutid
Definition: cob.h:480
M0_INTERNAL void m0_cob_get(struct m0_cob *cob)
Definition: cob.c:1090
M0_INTERNAL int m0_cob_bc_iterator_init(struct m0_cob *cob, struct m0_cob_bc_iterator *it, const struct m0_fid *pver_fid, uint64_t user_id)
Definition: cob.c:420
M0_INTERNAL void m0_cob_ea_iterator_init_credit(struct m0_cob *cob, struct m0_cob_ea_iterator *it, struct m0_bitstring *name, struct m0_be_tx_credit *accum)
Definition: cob.c:2379
Definition: seg.h:66
struct m0_cob * ci_cob
Definition: cob.h:617
int m0_cob_domain_init(struct m0_cob_domain *dom, struct m0_be_seg *seg)
Definition: cob.c:708
struct m0_fid ca_pver
Definition: cob.h:366
uint64_t ca_blocks
Definition: cob.h:378
enum m0_cob_domain_format_version M0_XCA_DOMAIN
char cnr_pad[4]
Definition: cob.h:428
struct m0_format_header cd_header
Definition: cob.h:263
struct m0_cob_eakey * ci_key
Definition: cob.h:628
struct m0_fid cnr_pver
Definition: cob.h:438
struct m0_fid cfb_pver
Definition: cob.h:478
Definition: fid.h:38
M0_INTERNAL int m0_cob_eakey_make(struct m0_cob_eakey **keyh, const struct m0_fid *fid, const char *name, size_t namelen)
Definition: cob.c:181
uint64_t cbr_bytecount
Definition: cob.h:522
M0_INTERNAL int m0_cob_bc_lookup(struct m0_cob *cob, struct m0_cob_bckey *bc_key, struct m0_cob_bcrec *bc_rec)
Definition: cob.c:1120
M0_INTERNAL void m0_cob_ea_get_credit(struct m0_cob *cob, struct m0_cob_eakey *eakey, struct m0_cob_earec *out, struct m0_be_tx_credit *accum)
Definition: cob.c:2356
struct m0_be_btree_cursor ci_cursor
Definition: cob.h:618
uint32_t cer_size
Definition: cob.h:510
struct m0_buf r_buf
Definition: cob.h:609
m0_cob_valid_flags
Definition: cob.h:334
M0_INTERNAL int m0_cob_bc_iterator_get(struct m0_cob_bc_iterator *it)
Definition: cob.c:443
m0_bcount_t size
Definition: di.c:39
m0_cob_type
Definition: cob.h:1124
struct m0_cob_omgrec co_omgrec
Definition: cob.h:592
M0_INTERNAL int m0_cob_update(struct m0_cob *cob, struct m0_cob_nsrec *nsrec, struct m0_cob_fabrec *fabrec, struct m0_cob_omgrec *omgrec, struct m0_be_tx *tx)
Definition: cob.c:1860
Definition: cob.h:607
M0_INTERNAL int m0_cob_delete(struct m0_cob *cob, struct m0_be_tx *tx)
Definition: cob.c:1789
M0_INTERNAL int m0_cob_iterator_get(struct m0_cob_iterator *it)
Definition: cob.c:1483
M0_INTERNAL int m0_cob_locate(struct m0_cob_domain *dom, struct m0_cob_oikey *oikey, uint64_t flags, struct m0_cob **out)
Definition: cob.c:1407
M0_INTERNAL int m0_cob_setattr(struct m0_cob *cob, struct m0_cob_attr *attr, struct m0_be_tx *tx)
Definition: cob.c:2068
static struct m0_be_seg * seg
Definition: btree.c:40
uint64_t cbr_cob_objects
Definition: cob.h:523
M0_INTERNAL int m0_cob_name_del(struct m0_cob *cob, struct m0_cob_nskey *nskey, struct m0_be_tx *tx)
Definition: cob.c:1966
struct m0_fid ca_pfid
Definition: cob.h:364
M0_INTERNAL void m0_cob_ea_set_credit(struct m0_cob *cob, struct m0_cob_eakey *eakey, struct m0_cob_earec *earec, struct m0_be_tx_credit *accum)
Definition: cob.c:2364
M0_INTERNAL int m0_cob_alloc(struct m0_cob_domain *dom, struct m0_cob **out)
Definition: cob.c:1100
M0_INTERNAL size_t m0_cob_nskey_size(const struct m0_cob_nskey *cnk)
Definition: cob.c:175
M0_INTERNAL int m0_cob_bc_entries_dump(struct m0_cob_domain *cdom, struct m0_buf **out_keys, struct m0_buf **out_recs, uint32_t *out_count)
Definition: cob.c:496
#define out(...)
Definition: gen.c:41
Definition: file.h:81
struct m0_be_btree cd_fileattr_omg
Definition: cob.h:273
uint32_t cor_gid
Definition: cob.h:499
M0_INTERNAL const struct m0_fid * m0_cob_fid(const struct m0_cob *cob)
Definition: cob.c:122
struct m0_bitstring * r_end
Definition: cob.h:610
struct m0_bitstring cek_name
Definition: cob.h:505
uint64_t cnr_ctime
Definition: cob.h:436
uint64_t ca_blksize
Definition: cob.h:377
uint32_t cfb_linklen
Definition: cob.h:481
struct m0_be_btree cd_bytecount
Definition: cob.h:275
struct m0_fid cnk_pfid
Definition: cob.h:391
M0_INTERNAL int m0_cob_iterator_init(struct m0_cob *cob, struct m0_cob_iterator *it, struct m0_bitstring *name)
Definition: cob.c:1457
struct m0_format_footer cnr_footer
Definition: cob.h:439
static struct m0_be_ut_backend be
Definition: service_ut.c:59
struct m0_cob_domain_id cd_id
Definition: cob.h:264
uint64_t cnr_lid
Definition: cob.h:437
uint64_t ca_atime
Definition: cob.h:371
uint64_t cnr_bytecount
Definition: cob.h:431
Definition: tx.h:280
M0_INTERNAL int m0_cob_ea_iterator_get(struct m0_cob_ea_iterator *it)
Definition: cob.c:1565
uint64_t ca_size
Definition: cob.h:376
struct m0_be_btree cd_namespace
Definition: cob.h:271
struct m0_fid cnr_fid
Definition: cob.h:419
char cfb_link[0]
Definition: cob.h:482