^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #ifndef __UTIL_DOT_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #define __UTIL_DOT_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #ifdef pr_fmt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #undef pr_fmt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <linux/mempool.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include "incore.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #define fs_emerg(fs, fmt, ...) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) pr_emerg("fsid=%s: " fmt, (fs)->sd_fsname, ##__VA_ARGS__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #define fs_warn(fs, fmt, ...) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) pr_warn("fsid=%s: " fmt, (fs)->sd_fsname, ##__VA_ARGS__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #define fs_err(fs, fmt, ...) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) pr_err("fsid=%s: " fmt, (fs)->sd_fsname, ##__VA_ARGS__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #define fs_info(fs, fmt, ...) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) pr_info("fsid=%s: " fmt, (fs)->sd_fsname, ##__VA_ARGS__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) void gfs2_assert_i(struct gfs2_sbd *sdp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #define gfs2_assert(sdp, assertion) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) do { \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) if (unlikely(!(assertion))) { \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) gfs2_assert_i(sdp); \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) BUG(); \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) } \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) } while (0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) void gfs2_assert_withdraw_i(struct gfs2_sbd *sdp, char *assertion,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) const char *function, char *file, unsigned int line,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) bool delayed);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) #define gfs2_assert_withdraw(sdp, assertion) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) ({ \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) bool _bool = (assertion); \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) if (unlikely(!_bool)) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) gfs2_assert_withdraw_i((sdp), #assertion, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) __func__, __FILE__, __LINE__, false); \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) !_bool; \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) })
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) #define gfs2_assert_withdraw_delayed(sdp, assertion) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) ({ \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) bool _bool = (assertion); \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) if (unlikely(!_bool)) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) gfs2_assert_withdraw_i((sdp), #assertion, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) __func__, __FILE__, __LINE__, true); \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) !_bool; \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) })
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) void gfs2_assert_warn_i(struct gfs2_sbd *sdp, char *assertion,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) const char *function, char *file, unsigned int line);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) #define gfs2_assert_warn(sdp, assertion) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) ({ \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) bool _bool = (assertion); \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) if (unlikely(!_bool)) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) gfs2_assert_warn_i((sdp), #assertion, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) __func__, __FILE__, __LINE__); \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) !_bool; \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) })
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) void gfs2_consist_i(struct gfs2_sbd *sdp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) const char *function, char *file, unsigned int line);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) #define gfs2_consist(sdp) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) gfs2_consist_i((sdp), __func__, __FILE__, __LINE__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) void gfs2_consist_inode_i(struct gfs2_inode *ip,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) const char *function, char *file, unsigned int line);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) #define gfs2_consist_inode(ip) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) gfs2_consist_inode_i((ip), __func__, __FILE__, __LINE__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) void gfs2_consist_rgrpd_i(struct gfs2_rgrpd *rgd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) const char *function, char *file, unsigned int line);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) #define gfs2_consist_rgrpd(rgd) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) gfs2_consist_rgrpd_i((rgd), __func__, __FILE__, __LINE__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) int gfs2_meta_check_ii(struct gfs2_sbd *sdp, struct buffer_head *bh,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) const char *type, const char *function,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) char *file, unsigned int line);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) static inline int gfs2_meta_check(struct gfs2_sbd *sdp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) struct buffer_head *bh)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) struct gfs2_meta_header *mh = (struct gfs2_meta_header *)bh->b_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) u32 magic = be32_to_cpu(mh->mh_magic);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) if (unlikely(magic != GFS2_MAGIC)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) fs_err(sdp, "Magic number missing at %llu\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) (unsigned long long)bh->b_blocknr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) int gfs2_metatype_check_ii(struct gfs2_sbd *sdp, struct buffer_head *bh,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) u16 type, u16 t,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) const char *function,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) char *file, unsigned int line);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) static inline int gfs2_metatype_check_i(struct gfs2_sbd *sdp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) struct buffer_head *bh,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) u16 type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) const char *function,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) char *file, unsigned int line)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) struct gfs2_meta_header *mh = (struct gfs2_meta_header *)bh->b_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) u32 magic = be32_to_cpu(mh->mh_magic);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) u16 t = be32_to_cpu(mh->mh_type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) if (unlikely(magic != GFS2_MAGIC))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) return gfs2_meta_check_ii(sdp, bh, "magic number", function,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) file, line);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) if (unlikely(t != type))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) return gfs2_metatype_check_ii(sdp, bh, type, t, function,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) file, line);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) #define gfs2_metatype_check(sdp, bh, type) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) gfs2_metatype_check_i((sdp), (bh), (type), __func__, __FILE__, __LINE__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) static inline void gfs2_metatype_set(struct buffer_head *bh, u16 type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) u16 format)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) struct gfs2_meta_header *mh;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) mh = (struct gfs2_meta_header *)bh->b_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) mh->mh_type = cpu_to_be32(type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) mh->mh_format = cpu_to_be32(format);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) int gfs2_io_error_i(struct gfs2_sbd *sdp, const char *function,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) char *file, unsigned int line);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) extern int check_journal_clean(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) bool verbose);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) extern int gfs2_freeze_lock(struct gfs2_sbd *sdp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) struct gfs2_holder *freeze_gh, int caller_flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) extern void gfs2_freeze_unlock(struct gfs2_holder *freeze_gh);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) #define gfs2_io_error(sdp) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) gfs2_io_error_i((sdp), __func__, __FILE__, __LINE__);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) void gfs2_io_error_bh_i(struct gfs2_sbd *sdp, struct buffer_head *bh,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) const char *function, char *file, unsigned int line,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) bool withdraw);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) #define gfs2_io_error_bh_wd(sdp, bh) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) gfs2_io_error_bh_i((sdp), (bh), __func__, __FILE__, __LINE__, true);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) #define gfs2_io_error_bh(sdp, bh) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) gfs2_io_error_bh_i((sdp), (bh), __func__, __FILE__, __LINE__, false);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) extern struct kmem_cache *gfs2_glock_cachep;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) extern struct kmem_cache *gfs2_glock_aspace_cachep;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) extern struct kmem_cache *gfs2_inode_cachep;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) extern struct kmem_cache *gfs2_bufdata_cachep;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) extern struct kmem_cache *gfs2_rgrpd_cachep;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) extern struct kmem_cache *gfs2_quotad_cachep;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) extern struct kmem_cache *gfs2_qadata_cachep;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) extern struct kmem_cache *gfs2_trans_cachep;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) extern mempool_t *gfs2_page_pool;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) extern struct workqueue_struct *gfs2_control_wq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) static inline unsigned int gfs2_tune_get_i(struct gfs2_tune *gt,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) unsigned int *p)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) unsigned int x;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) spin_lock(>->gt_spin);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) x = *p;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) spin_unlock(>->gt_spin);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) return x;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) * gfs2_withdraw_delayed - withdraw as soon as possible without deadlocks
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) * @sdp: the superblock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) static inline void gfs2_withdraw_delayed(struct gfs2_sbd *sdp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) set_bit(SDF_WITHDRAWING, &sdp->sd_flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) * gfs2_withdrawn - test whether the file system is withdrawing or withdrawn
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) * @sdp: the superblock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) static inline bool gfs2_withdrawn(struct gfs2_sbd *sdp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) return test_bit(SDF_WITHDRAWN, &sdp->sd_flags) ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) test_bit(SDF_WITHDRAWING, &sdp->sd_flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) * gfs2_withdrawing - check if a withdraw is pending
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) * @sdp: the superblock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) static inline bool gfs2_withdrawing(struct gfs2_sbd *sdp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) return test_bit(SDF_WITHDRAWING, &sdp->sd_flags) &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) !test_bit(SDF_WITHDRAWN, &sdp->sd_flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) #define gfs2_tune_get(sdp, field) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) gfs2_tune_get_i(&(sdp)->sd_tune, &(sdp)->sd_tune.field)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) __printf(2, 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) void gfs2_lm(struct gfs2_sbd *sdp, const char *fmt, ...);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) int gfs2_withdraw(struct gfs2_sbd *sdp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) #endif /* __UTIL_DOT_H__ */