18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/* -*- mode: c; c-basic-offset: 8; -*-
38c2ecf20Sopenharmony_ci * vim: noexpandtab sw=8 ts=8 sts=0:
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * localalloc.h
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Function prototypes
88c2ecf20Sopenharmony_ci *
98c2ecf20Sopenharmony_ci * Copyright (C) 2002, 2004 Oracle.  All rights reserved.
108c2ecf20Sopenharmony_ci */
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#ifndef OCFS2_LOCALALLOC_H
138c2ecf20Sopenharmony_ci#define OCFS2_LOCALALLOC_H
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ciint ocfs2_load_local_alloc(struct ocfs2_super *osb);
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_civoid ocfs2_shutdown_local_alloc(struct ocfs2_super *osb);
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_civoid ocfs2_la_set_sizes(struct ocfs2_super *osb, int requested_mb);
208c2ecf20Sopenharmony_ciunsigned int ocfs2_la_default_mb(struct ocfs2_super *osb);
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ciint ocfs2_begin_local_alloc_recovery(struct ocfs2_super *osb,
238c2ecf20Sopenharmony_ci				     int node_num,
248c2ecf20Sopenharmony_ci				     struct ocfs2_dinode **alloc_copy);
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ciint ocfs2_complete_local_alloc_recovery(struct ocfs2_super *osb,
278c2ecf20Sopenharmony_ci					struct ocfs2_dinode *alloc);
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ciint ocfs2_alloc_should_use_local(struct ocfs2_super *osb,
308c2ecf20Sopenharmony_ci				 u64 bits);
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_cistruct ocfs2_alloc_context;
338c2ecf20Sopenharmony_ciint ocfs2_reserve_local_alloc_bits(struct ocfs2_super *osb,
348c2ecf20Sopenharmony_ci				   u32 bits_wanted,
358c2ecf20Sopenharmony_ci				   struct ocfs2_alloc_context *ac);
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ciint ocfs2_claim_local_alloc_bits(struct ocfs2_super *osb,
388c2ecf20Sopenharmony_ci				 handle_t *handle,
398c2ecf20Sopenharmony_ci				 struct ocfs2_alloc_context *ac,
408c2ecf20Sopenharmony_ci				 u32 bits_wanted,
418c2ecf20Sopenharmony_ci				 u32 *bit_off,
428c2ecf20Sopenharmony_ci				 u32 *num_bits);
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ciint ocfs2_free_local_alloc_bits(struct ocfs2_super *osb,
458c2ecf20Sopenharmony_ci				handle_t *handle,
468c2ecf20Sopenharmony_ci				struct ocfs2_alloc_context *ac,
478c2ecf20Sopenharmony_ci				u32 bit_off,
488c2ecf20Sopenharmony_ci				u32 num_bits);
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_civoid ocfs2_local_alloc_seen_free_bits(struct ocfs2_super *osb,
518c2ecf20Sopenharmony_ci				      unsigned int num_clusters);
528c2ecf20Sopenharmony_civoid ocfs2_la_enable_worker(struct work_struct *work);
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci#endif /* OCFS2_LOCALALLOC_H */
55