~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/fs/bcachefs/journal_reclaim.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef _BCACHEFS_JOURNAL_RECLAIM_H
  3 #define _BCACHEFS_JOURNAL_RECLAIM_H
  4 
  5 #define JOURNAL_PIN     (32 * 1024)
  6 
  7 static inline void journal_reclaim_kick(struct journal *j)
  8 {
  9         struct task_struct *p = READ_ONCE(j->reclaim_thread);
 10 
 11         j->reclaim_kicked = true;
 12         if (p)
 13                 wake_up_process(p);
 14 }
 15 
 16 unsigned bch2_journal_dev_buckets_available(struct journal *,
 17                                             struct journal_device *,
 18                                             enum journal_space_from);
 19 void bch2_journal_set_watermark(struct journal *);
 20 void bch2_journal_space_available(struct journal *);
 21 
 22 static inline bool journal_pin_active(struct journal_entry_pin *pin)
 23 {
 24         return pin->seq != 0;
 25 }
 26 
 27 static inline struct journal_entry_pin_list *
 28 journal_seq_pin(struct journal *j, u64 seq)
 29 {
 30         EBUG_ON(seq < j->pin.front || seq >= j->pin.back);
 31 
 32         return &j->pin.data[seq & j->pin.mask];
 33 }
 34 
 35 void bch2_journal_reclaim_fast(struct journal *);
 36 bool __bch2_journal_pin_put(struct journal *, u64);
 37 void bch2_journal_pin_put(struct journal *, u64);
 38 void bch2_journal_pin_drop(struct journal *, struct journal_entry_pin *);
 39 
 40 void bch2_journal_pin_set(struct journal *, u64, struct journal_entry_pin *,
 41                           journal_pin_flush_fn);
 42 
 43 static inline void bch2_journal_pin_add(struct journal *j, u64 seq,
 44                                         struct journal_entry_pin *pin,
 45                                         journal_pin_flush_fn flush_fn)
 46 {
 47         if (unlikely(!journal_pin_active(pin) || pin->seq > seq))
 48                 bch2_journal_pin_set(j, seq, pin, flush_fn);
 49 }
 50 
 51 void bch2_journal_pin_copy(struct journal *,
 52                            struct journal_entry_pin *,
 53                            struct journal_entry_pin *,
 54                            journal_pin_flush_fn);
 55 
 56 static inline void bch2_journal_pin_update(struct journal *j, u64 seq,
 57                                            struct journal_entry_pin *pin,
 58                                            journal_pin_flush_fn flush_fn)
 59 {
 60         if (unlikely(!journal_pin_active(pin) || pin->seq < seq))
 61                 bch2_journal_pin_set(j, seq, pin, flush_fn);
 62 }
 63 
 64 void bch2_journal_pin_flush(struct journal *, struct journal_entry_pin *);
 65 
 66 void bch2_journal_do_discards(struct journal *);
 67 int bch2_journal_reclaim(struct journal *);
 68 
 69 void bch2_journal_reclaim_stop(struct journal *);
 70 int bch2_journal_reclaim_start(struct journal *);
 71 
 72 bool bch2_journal_flush_pins(struct journal *, u64);
 73 
 74 static inline bool bch2_journal_flush_all_pins(struct journal *j)
 75 {
 76         return bch2_journal_flush_pins(j, U64_MAX);
 77 }
 78 
 79 int bch2_journal_flush_device_pins(struct journal *, int);
 80 
 81 #endif /* _BCACHEFS_JOURNAL_RECLAIM_H */
 82 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php