.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. |
---|
3 | 4 | * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. |
---|
4 | | - * |
---|
5 | | - * This copyrighted material is made available to anyone wishing to use, |
---|
6 | | - * modify, copy, or redistribute it subject to the terms and conditions |
---|
7 | | - * of the GNU General Public License version 2. |
---|
8 | 5 | */ |
---|
9 | 6 | |
---|
10 | 7 | #ifndef __GLOCK_DOT_H__ |
---|
.. | .. |
---|
193 | 190 | extern int gfs2_glock_nq(struct gfs2_holder *gh); |
---|
194 | 191 | extern int gfs2_glock_poll(struct gfs2_holder *gh); |
---|
195 | 192 | extern int gfs2_glock_wait(struct gfs2_holder *gh); |
---|
| 193 | +extern int gfs2_glock_async_wait(unsigned int num_gh, struct gfs2_holder *ghs); |
---|
196 | 194 | extern void gfs2_glock_dq(struct gfs2_holder *gh); |
---|
197 | 195 | extern void gfs2_glock_dq_wait(struct gfs2_holder *gh); |
---|
198 | 196 | extern void gfs2_glock_dq_uninit(struct gfs2_holder *gh); |
---|
.. | .. |
---|
202 | 200 | struct gfs2_holder *gh); |
---|
203 | 201 | extern int gfs2_glock_nq_m(unsigned int num_gh, struct gfs2_holder *ghs); |
---|
204 | 202 | extern void gfs2_glock_dq_m(unsigned int num_gh, struct gfs2_holder *ghs); |
---|
205 | | -extern void gfs2_dump_glock(struct seq_file *seq, const struct gfs2_glock *gl); |
---|
206 | | -#define GLOCK_BUG_ON(gl,x) do { if (unlikely(x)) { gfs2_dump_glock(NULL, gl); BUG(); } } while(0) |
---|
| 203 | +extern void gfs2_dump_glock(struct seq_file *seq, struct gfs2_glock *gl, |
---|
| 204 | + bool fsid); |
---|
| 205 | +#define GLOCK_BUG_ON(gl,x) do { if (unlikely(x)) { \ |
---|
| 206 | + gfs2_dump_glock(NULL, gl, true); \ |
---|
| 207 | + BUG(); } } while(0) |
---|
| 208 | +#define gfs2_glock_assert_warn(gl, x) do { if (unlikely(!(x))) { \ |
---|
| 209 | + gfs2_dump_glock(NULL, gl, true); \ |
---|
| 210 | + gfs2_assert_warn((gl)->gl_name.ln_sbd, (x)); } } \ |
---|
| 211 | + while (0) |
---|
| 212 | +#define gfs2_glock_assert_withdraw(gl, x) do { if (unlikely(!(x))) { \ |
---|
| 213 | + gfs2_dump_glock(NULL, gl, true); \ |
---|
| 214 | + gfs2_assert_withdraw((gl)->gl_name.ln_sbd, (x)); } } \ |
---|
| 215 | + while (0) |
---|
| 216 | + |
---|
207 | 217 | extern __printf(2, 3) |
---|
208 | 218 | void gfs2_print_dbg(struct seq_file *seq, const char *fmt, ...); |
---|
209 | 219 | |
---|
.. | .. |
---|
234 | 244 | |
---|
235 | 245 | extern void gfs2_glock_cb(struct gfs2_glock *gl, unsigned int state); |
---|
236 | 246 | extern void gfs2_glock_complete(struct gfs2_glock *gl, int ret); |
---|
| 247 | +extern bool gfs2_queue_delete_work(struct gfs2_glock *gl, unsigned long delay); |
---|
| 248 | +extern void gfs2_cancel_delete_work(struct gfs2_glock *gl); |
---|
| 249 | +extern bool gfs2_delete_work_queued(const struct gfs2_glock *gl); |
---|
| 250 | +extern void gfs2_flush_delete_work(struct gfs2_sbd *sdp); |
---|
237 | 251 | extern void gfs2_gl_hash_clear(struct gfs2_sbd *sdp); |
---|
238 | 252 | extern void gfs2_glock_finish_truncate(struct gfs2_inode *ip); |
---|
239 | 253 | extern void gfs2_glock_thaw(struct gfs2_sbd *sdp); |
---|
.. | .. |
---|
243 | 257 | extern int __init gfs2_glock_init(void); |
---|
244 | 258 | extern void gfs2_glock_exit(void); |
---|
245 | 259 | |
---|
246 | | -extern int gfs2_create_debugfs_file(struct gfs2_sbd *sdp); |
---|
| 260 | +extern void gfs2_create_debugfs_file(struct gfs2_sbd *sdp); |
---|
247 | 261 | extern void gfs2_delete_debugfs_file(struct gfs2_sbd *sdp); |
---|
248 | | -extern int gfs2_register_debugfs(void); |
---|
| 262 | +extern void gfs2_register_debugfs(void); |
---|
249 | 263 | extern void gfs2_unregister_debugfs(void); |
---|
250 | 264 | |
---|
251 | 265 | extern const struct lm_lockops gfs2_dlm_ops; |
---|
.. | .. |
---|
260 | 274 | return gh->gh_gl; |
---|
261 | 275 | } |
---|
262 | 276 | |
---|
| 277 | +static inline bool gfs2_holder_queued(struct gfs2_holder *gh) |
---|
| 278 | +{ |
---|
| 279 | + return !list_empty(&gh->gh_list); |
---|
| 280 | +} |
---|
| 281 | + |
---|
263 | 282 | /** |
---|
264 | 283 | * glock_set_object - set the gl_object field of a glock |
---|
265 | 284 | * @gl: the glock |
---|
.. | .. |
---|
269 | 288 | { |
---|
270 | 289 | spin_lock(&gl->gl_lockref.lock); |
---|
271 | 290 | if (gfs2_assert_warn(gl->gl_name.ln_sbd, gl->gl_object == NULL)) |
---|
272 | | - gfs2_dump_glock(NULL, gl); |
---|
| 291 | + gfs2_dump_glock(NULL, gl, true); |
---|
273 | 292 | gl->gl_object = object; |
---|
274 | 293 | spin_unlock(&gl->gl_lockref.lock); |
---|
275 | 294 | } |
---|
.. | .. |
---|
281 | 300 | * |
---|
282 | 301 | * I'd love to similarly add this: |
---|
283 | 302 | * else if (gfs2_assert_warn(gl->gl_sbd, gl->gl_object == object)) |
---|
284 | | - * gfs2_dump_glock(NULL, gl); |
---|
| 303 | + * gfs2_dump_glock(NULL, gl, true); |
---|
285 | 304 | * Unfortunately, that's not possible because as soon as gfs2_delete_inode |
---|
286 | 305 | * frees the block in the rgrp, another process can reassign it for an I_NEW |
---|
287 | 306 | * inode in gfs2_create_inode because that calls new_inode, not gfs2_iget. |
---|
.. | .. |
---|
300 | 319 | spin_unlock(&gl->gl_lockref.lock); |
---|
301 | 320 | } |
---|
302 | 321 | |
---|
| 322 | +extern void gfs2_inode_remember_delete(struct gfs2_glock *gl, u64 generation); |
---|
| 323 | +extern bool gfs2_inode_already_deleted(struct gfs2_glock *gl, u64 generation); |
---|
| 324 | + |
---|
303 | 325 | #endif /* __GLOCK_DOT_H__ */ |
---|