| 1 |
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- |
| 2 |
* |
| 3 |
* Copyright (C) 2017 Red Hat, Inc. |
| 4 |
* |
| 5 |
* This program is free software; you can redistribute it and/or modify |
| 6 |
* it under the terms of the GNU General Public License as published by |
| 7 |
* the Free Software Foundation; either version 2 of the License, or |
| 8 |
* (at your option) any later version. |
| 9 |
* |
| 10 |
* This program is distributed in the hope that it will be useful, |
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
* GNU General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU General Public License |
| 16 |
* along with this program; if not, write to the Free Software |
| 17 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 |
* |
| 19 |
* Author: Vratislav Podzimek <[email protected]> |
| 20 |
* |
| 21 |
*/ |
| 22 |
|
| 23 |
#ifndef __LVM_JOB_HELPERS_H__ |
| 24 |
#define __LVM_JOB_HELPERS_H__ |
| 25 |
|
| 26 |
#include <glib.h> |
| 27 |
#include <blockdev/lvm.h> |
| 28 |
|
| 29 |
#include <src/udisksthreadedjob.h> |
| 30 |
|
| 31 |
G_BEGIN_DECLS |
| 32 |
|
| 33 |
typedef struct { |
| 34 |
const gchar *vg_name; |
| 35 |
const gchar *lv_name; |
| 36 |
const gchar *new_lv_name; |
| 37 |
const gchar *new_lv_layout; |
| 38 |
const gchar **new_lv_pvs; |
| 39 |
const gchar *pool_name; |
| 40 |
guint64 new_lv_size; |
| 41 |
guint32 new_lv_stripes; |
| 42 |
guint32 new_lv_mirrors; |
| 43 |
guint64 virtual_size; |
| 44 |
guint64 extent_size; |
| 45 |
gboolean resize_fs; |
| 46 |
gboolean force; |
| 47 |
gboolean destroy; |
| 48 |
gboolean deduplication; |
| 49 |
gboolean compression; |
| 50 |
guint64 index_memory; |
| 51 |
const gchar *write_policy; |
| 52 |
} LVJobData; |
| 53 |
|
| 54 |
typedef struct { |
| 55 |
const gchar *vg_name; |
| 56 |
const gchar *new_vg_name; |
| 57 |
const gchar *pv_path; |
| 58 |
const gchar **pvs; |
| 59 |
} VGJobData; |
| 60 |
|
| 61 |
typedef struct { |
| 62 |
const gchar *path; |
| 63 |
} PVJobData; |
| 64 |
|
| 65 |
typedef struct { |
| 66 |
BDLVMVGdata **vgs; |
| 67 |
BDLVMPVdata **pvs; |
| 68 |
} VGsPVsData; |
| 69 |
|
| 70 |
gboolean lvcreate_job_func (UDisksThreadedJob *job, |
| 71 |
GCancellable *cancellable, |
| 72 |
gpointer user_data, |
| 73 |
GError **error); |
| 74 |
|
| 75 |
gboolean lvcreate_thin_pool_job_func (UDisksThreadedJob *job, |
| 76 |
GCancellable *cancellable, |
| 77 |
gpointer user_data, |
| 78 |
GError **error); |
| 79 |
|
| 80 |
gboolean lvcreate_thin_job_func (UDisksThreadedJob *job, |
| 81 |
GCancellable *cancellable, |
| 82 |
gpointer user_data, |
| 83 |
GError **error); |
| 84 |
|
| 85 |
gboolean lvcreate_vdo_job_func (UDisksThreadedJob *job, |
| 86 |
GCancellable *cancellable, |
| 87 |
gpointer user_data, |
| 88 |
GError **error); |
| 89 |
|
| 90 |
gboolean lvremove_job_func (UDisksThreadedJob *job, |
| 91 |
GCancellable *cancellable, |
| 92 |
gpointer user_data, |
| 93 |
GError **error); |
| 94 |
|
| 95 |
gboolean lvrename_job_func (UDisksThreadedJob *job, |
| 96 |
GCancellable *cancellable, |
| 97 |
gpointer user_data, |
| 98 |
GError **error); |
| 99 |
|
| 100 |
gboolean lvresize_job_func (UDisksThreadedJob *job, |
| 101 |
GCancellable *cancellable, |
| 102 |
gpointer user_data, |
| 103 |
GError **error); |
| 104 |
|
| 105 |
gboolean lvrepair_job_func (UDisksThreadedJob *job, |
| 106 |
GCancellable *cancellable, |
| 107 |
gpointer user_data, |
| 108 |
GError **error); |
| 109 |
|
| 110 |
gboolean lvactivate_job_func (UDisksThreadedJob *job, |
| 111 |
GCancellable *cancellable, |
| 112 |
gpointer user_data, |
| 113 |
GError **error); |
| 114 |
|
| 115 |
gboolean lvdeactivate_job_func (UDisksThreadedJob *job, |
| 116 |
GCancellable *cancellable, |
| 117 |
gpointer user_data, |
| 118 |
GError **error); |
| 119 |
|
| 120 |
gboolean lvsnapshot_create_job_func (UDisksThreadedJob *job, |
| 121 |
GCancellable *cancellable, |
| 122 |
gpointer user_data, |
| 123 |
GError **error); |
| 124 |
|
| 125 |
gboolean lvcache_attach_job_func (UDisksThreadedJob *job, |
| 126 |
GCancellable *cancellable, |
| 127 |
gpointer user_data, |
| 128 |
GError **error); |
| 129 |
|
| 130 |
gboolean lvcache_detach_job_func (UDisksThreadedJob *job, |
| 131 |
GCancellable *cancellable, |
| 132 |
gpointer user_data, |
| 133 |
GError **error); |
| 134 |
|
| 135 |
gboolean lv_vdo_compression_job_func (UDisksThreadedJob *job, |
| 136 |
GCancellable *cancellable, |
| 137 |
gpointer user_data, |
| 138 |
GError **error); |
| 139 |
|
| 140 |
gboolean lv_vdo_deduplication_job_func (UDisksThreadedJob *job, |
| 141 |
GCancellable *cancellable, |
| 142 |
gpointer user_data, |
| 143 |
GError **error); |
| 144 |
|
| 145 |
gboolean vgcreate_job_func (UDisksThreadedJob *job, |
| 146 |
GCancellable *cancellable, |
| 147 |
gpointer user_data, |
| 148 |
GError **error); |
| 149 |
|
| 150 |
gboolean vgremove_job_func (UDisksThreadedJob *job, |
| 151 |
GCancellable *cancellable, |
| 152 |
gpointer user_data, |
| 153 |
GError **error); |
| 154 |
|
| 155 |
gboolean vgrename_job_func (UDisksThreadedJob *job, |
| 156 |
GCancellable *cancellable, |
| 157 |
gpointer user_data, |
| 158 |
GError **error); |
| 159 |
|
| 160 |
gboolean vgextend_job_func (UDisksThreadedJob *job, |
| 161 |
GCancellable *cancellable, |
| 162 |
gpointer user_data, |
| 163 |
GError **error); |
| 164 |
|
| 165 |
gboolean vgreduce_job_func (UDisksThreadedJob *job, |
| 166 |
GCancellable *cancellable, |
| 167 |
gpointer user_data, |
| 168 |
GError **error); |
| 169 |
|
| 170 |
|
| 171 |
gboolean pvcreate_job_func (UDisksThreadedJob *job, |
| 172 |
GCancellable *cancellable, |
| 173 |
gpointer user_data, |
| 174 |
GError **error); |
| 175 |
|
| 176 |
gboolean pvremove_job_func (UDisksThreadedJob *job, |
| 177 |
GCancellable *cancellable, |
| 178 |
gpointer user_data, |
| 179 |
GError **error); |
| 180 |
|
| 181 |
gboolean pvmove_job_func (UDisksThreadedJob *job, |
| 182 |
GCancellable *cancellable, |
| 183 |
gpointer user_data, |
| 184 |
GError **error); |
| 185 |
|
| 186 |
|
| 187 |
void vg_list_free (BDLVMVGdata **vg_list); |
| 188 |
void pv_list_free (BDLVMPVdata **pv_list); |
| 189 |
void lv_list_free (BDLVMLVdata **lv_list); |
| 190 |
void vgs_pvs_data_free (VGsPVsData *data); |
| 191 |
|
| 192 |
void vgs_task_func (GTask *task, |
| 193 |
gpointer source_obj, |
| 194 |
gpointer task_data, |
| 195 |
GCancellable *cancellable); |
| 196 |
|
| 197 |
void lvs_task_func (GTask *task, |
| 198 |
gpointer source_obj, |
| 199 |
gpointer task_data, |
| 200 |
GCancellable *cancellable); |
| 201 |
|
| 202 |
G_END_DECLS |
| 203 |
|
| 204 |
#endif /* __LVM_JOB_HELPERS_H__ */ |