#include <linux/buffer_head.h>
#include <linux/fs.h>
#include <linux/kernel.h>
#include "ntfs.h"
#include "ntfs_fs.h"
#define NTFS_MAX_WND_EXTENTS …
struct rb_node_key { … };
struct e_node { … };
static int wnd_rescan(struct wnd_bitmap *wnd);
static struct buffer_head *wnd_map(struct wnd_bitmap *wnd, size_t iw);
static bool wnd_is_free_hlp(struct wnd_bitmap *wnd, size_t bit, size_t bits);
static struct kmem_cache *ntfs_enode_cachep;
int __init ntfs3_init_bitmap(void)
{ … }
void ntfs3_exit_bitmap(void)
{ … }
static size_t wnd_scan(const void *buf, size_t wbit, u32 wpos, u32 wend,
size_t to_alloc, size_t *prev_tail, size_t *b_pos,
size_t *b_len)
{ … }
void wnd_close(struct wnd_bitmap *wnd)
{ … }
static struct rb_node *rb_lookup(struct rb_root *root, size_t v)
{ … }
static inline bool rb_insert_count(struct rb_root *root, struct e_node *e)
{ … }
static inline bool rb_insert_start(struct rb_root *root, struct e_node *e)
{ … }
static void wnd_add_free_ext(struct wnd_bitmap *wnd, size_t bit, size_t len,
bool build)
{ … }
static void wnd_remove_free_ext(struct wnd_bitmap *wnd, size_t bit, size_t len)
{ … }
static int wnd_rescan(struct wnd_bitmap *wnd)
{ … }
int wnd_init(struct wnd_bitmap *wnd, struct super_block *sb, size_t nbits)
{ … }
static struct buffer_head *wnd_map(struct wnd_bitmap *wnd, size_t iw)
{ … }
int wnd_set_free(struct wnd_bitmap *wnd, size_t bit, size_t bits)
{ … }
int wnd_set_used(struct wnd_bitmap *wnd, size_t bit, size_t bits)
{ … }
int wnd_set_used_safe(struct wnd_bitmap *wnd, size_t bit, size_t bits,
size_t *done)
{ … }
static bool wnd_is_free_hlp(struct wnd_bitmap *wnd, size_t bit, size_t bits)
{ … }
bool wnd_is_free(struct wnd_bitmap *wnd, size_t bit, size_t bits)
{ … }
bool wnd_is_used(struct wnd_bitmap *wnd, size_t bit, size_t bits)
{ … }
size_t wnd_find(struct wnd_bitmap *wnd, size_t to_alloc, size_t hint,
size_t flags, size_t *allocated)
{ … }
int wnd_extend(struct wnd_bitmap *wnd, size_t new_bits)
{ … }
void wnd_zone_set(struct wnd_bitmap *wnd, size_t lcn, size_t len)
{ … }
int ntfs_trim_fs(struct ntfs_sb_info *sbi, struct fstrim_range *range)
{ … }
#if BITS_PER_LONG == 64
bitmap_ulong;
#define cpu_to_ul(x) …
#define ul_to_cpu(x) …
#else
typedef __le32 bitmap_ulong;
#define cpu_to_ul …
#define ul_to_cpu …
#endif
void ntfs_bitmap_set_le(void *map, unsigned int start, int len)
{ … }
void ntfs_bitmap_clear_le(void *map, unsigned int start, int len)
{ … }
unsigned int ntfs_bitmap_weight_le(const void *bitmap, int bits)
{ … }