Line | Count | Source |
1 | | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
2 | | * Copyright by The HDF Group. * |
3 | | * All rights reserved. * |
4 | | * * |
5 | | * This file is part of HDF5. The full HDF5 copyright notice, including * |
6 | | * terms governing use, modification, and redistribution, is contained in * |
7 | | * the LICENSE file, which can be found at the root of the source code * |
8 | | * distribution tree, or in https://www.hdfgroup.org/licenses. * |
9 | | * If you do not have access to either file, you may request a copy from * |
10 | | * help@hdfgroup.org. * |
11 | | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
12 | | |
13 | | /*------------------------------------------------------------------------- |
14 | | * |
15 | | * Created: H5FSint.c |
16 | | * |
17 | | * Purpose: Internal routines for free space managers. |
18 | | * |
19 | | *------------------------------------------------------------------------- |
20 | | */ |
21 | | |
22 | | /**********************/ |
23 | | /* Module Declaration */ |
24 | | /**********************/ |
25 | | |
26 | | #include "H5FSmodule.h" /* This source code file is part of the H5FS module */ |
27 | | |
28 | | /***********************/ |
29 | | /* Other Packages Used */ |
30 | | /***********************/ |
31 | | |
32 | | /***********/ |
33 | | /* Headers */ |
34 | | /***********/ |
35 | | #include "H5private.h" /* Generic Functions */ |
36 | | #include "H5Eprivate.h" /* Error Handling */ |
37 | | #include "H5FSpkg.h" /* Free Space Managers */ |
38 | | |
39 | | /****************/ |
40 | | /* Local Macros */ |
41 | | /****************/ |
42 | | |
43 | | /******************/ |
44 | | /* Local Typedefs */ |
45 | | /******************/ |
46 | | |
47 | | /********************/ |
48 | | /* Package Typedefs */ |
49 | | /********************/ |
50 | | |
51 | | /********************/ |
52 | | /* Local Prototypes */ |
53 | | /********************/ |
54 | | |
55 | | /*********************/ |
56 | | /* Package Variables */ |
57 | | /*********************/ |
58 | | |
59 | | /*****************************/ |
60 | | /* Library Private Variables */ |
61 | | /*****************************/ |
62 | | |
63 | | /*******************/ |
64 | | /* Local Variables */ |
65 | | /*******************/ |
66 | | |
67 | | /*------------------------------------------------------------------------- |
68 | | * Function: H5FS_init |
69 | | * |
70 | | * Purpose: Initialize the interface in case it is unable to initialize |
71 | | * itself soon enough. |
72 | | * |
73 | | * Return: Success: non-negative |
74 | | * Failure: negative |
75 | | * |
76 | | *------------------------------------------------------------------------- |
77 | | */ |
78 | | herr_t |
79 | | H5FS_init(void) |
80 | 1 | { |
81 | 1 | herr_t ret_value = SUCCEED; /* Return value */ |
82 | | |
83 | 1 | FUNC_ENTER_NOAPI_NOERR |
84 | | /* FUNC_ENTER() does all the work */ |
85 | | |
86 | 1 | FUNC_LEAVE_NOAPI(ret_value) |
87 | 1 | } /* end H5FS_init() */ |
88 | | |
89 | | /*------------------------------------------------------------------------- |
90 | | * Function: H5FS__create_flush_depend |
91 | | * |
92 | | * Purpose: Create a flush dependency between two data structure components |
93 | | * |
94 | | * Return: SUCCEED/FAIL |
95 | | * |
96 | | *------------------------------------------------------------------------- |
97 | | */ |
98 | | herr_t |
99 | | H5FS__create_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry) |
100 | 0 | { |
101 | 0 | herr_t ret_value = SUCCEED; /* Return value */ |
102 | |
|
103 | 0 | FUNC_ENTER_PACKAGE |
104 | | |
105 | | /* Sanity check */ |
106 | 0 | assert(parent_entry); |
107 | 0 | assert(child_entry); |
108 | | |
109 | | /* Create a flush dependency between parent and child entry */ |
110 | 0 | if (H5AC_create_flush_dependency(parent_entry, child_entry) < 0) |
111 | 0 | HGOTO_ERROR(H5E_FSPACE, H5E_CANTDEPEND, FAIL, "unable to create flush dependency"); |
112 | | |
113 | 0 | done: |
114 | 0 | FUNC_LEAVE_NOAPI(ret_value) |
115 | 0 | } /* end H5FS__create_flush_depend() */ |
116 | | |
117 | | /*------------------------------------------------------------------------- |
118 | | * Function: H5FS__destroy_flush_depend |
119 | | * |
120 | | * Purpose: Destroy a flush dependency between two data structure components |
121 | | * |
122 | | * Return: SUCCEED/FAIL |
123 | | * |
124 | | *------------------------------------------------------------------------- |
125 | | */ |
126 | | herr_t |
127 | | H5FS__destroy_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry) |
128 | 0 | { |
129 | 0 | herr_t ret_value = SUCCEED; /* Return value */ |
130 | |
|
131 | 0 | FUNC_ENTER_PACKAGE |
132 | | |
133 | | /* Sanity check */ |
134 | 0 | assert(parent_entry); |
135 | 0 | assert(child_entry); |
136 | | |
137 | | /* Destroy a flush dependency between parent and child entry */ |
138 | 0 | if (H5AC_destroy_flush_dependency(parent_entry, child_entry) < 0) |
139 | 0 | HGOTO_ERROR(H5E_FSPACE, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency"); |
140 | | |
141 | 0 | done: |
142 | 0 | FUNC_LEAVE_NOAPI(ret_value) |
143 | 0 | } /* end H5FS__destroy_flush_depend() */ |