Symbol: bfs
sbin/newfs_sysvbfs/newfs_sysvbfs.c
181
struct bfs_super_block *bfs = (void *)buf;
sbin/newfs_sysvbfs/newfs_sysvbfs.c
189
bfs->header.magic = BFS_MAGIC;
sbin/newfs_sysvbfs/newfs_sysvbfs.c
190
bfs->header.data_start_byte = DEV_BSIZE * 2; /* super block + inode */
sbin/newfs_sysvbfs/newfs_sysvbfs.c
191
bfs->header.data_end_byte = nsectors * BFS_BSIZE - 1;
sbin/newfs_sysvbfs/newfs_sysvbfs.c
192
bfs->compaction.from = 0xffffffff;
sbin/newfs_sysvbfs/newfs_sysvbfs.c
193
bfs->compaction.to = 0xffffffff;
sbin/newfs_sysvbfs/newfs_sysvbfs.c
194
bfs->compaction.from_backup = 0xffffffff;
sbin/newfs_sysvbfs/newfs_sysvbfs.c
195
bfs->compaction.to_backup = 0xffffffff;
sys/arch/ews4800mips/ews4800mips/disklabel_conv.c
146
bfs = &vtoc->partition[3];
sys/arch/ews4800mips/ews4800mips/disklabel_conv.c
147
bfs->tag = VTOC_TAG_STAND;
sys/arch/ews4800mips/ews4800mips/disklabel_conv.c
148
bfs->flags = 0;
sys/arch/ews4800mips/ews4800mips/disklabel_conv.c
149
bfs->start_sector = _BOOTBLOCK_SIZE;
sys/arch/ews4800mips/ews4800mips/disklabel_conv.c
151
res = nsectors - bfs->start_sector;
sys/arch/ews4800mips/ews4800mips/disklabel_conv.c
152
bfs->nsectors = res > _BFS_SIZE ? _BFS_SIZE : res;
sys/arch/ews4800mips/ews4800mips/disklabel_conv.c
93
struct ux_partition *bfs;
sys/arch/ews4800mips/include/bfs.h
38
int bfs_init(struct bfs **);
sys/arch/ews4800mips/stand/common/bfs_subr.c
56
bfs_init(struct bfs **bfsp)
sys/arch/ews4800mips/stand/common/bootfs.c
43
FS_DEF(bfs);
sys/arch/ews4800mips/stand/common/bootfs.c
50
struct bfs *bfs;
sys/arch/ews4800mips/stand/common/bootfs.c
66
if (bfs_init(&file->bfs) != 0) {
sys/arch/ews4800mips/stand/common/bootfs.c
71
if (!bfs_file_lookup(file->bfs, name, &file->start, &file->end,
sys/arch/ews4800mips/stand/common/bootfs.c
73
bfs_fini(file->bfs);
sys/arch/ews4800mips/stand/common/bootfs.c
91
bfs_fini(file->bfs);
sys/arch/ews4800mips/stand/common/diskutil.c
102
struct bfs *bfs;
sys/arch/ews4800mips/stand/common/diskutil.c
110
if (bfs_init(&bfs) != 0)
sys/arch/ews4800mips/stand/common/diskutil.c
113
for (file = bfs->dirent, i = 0; i < bfs->max_dirent; i++, file++) {
sys/arch/ews4800mips/stand/common/diskutil.c
115
inode = &bfs->inode[file->inode - BFS_ROOT_INODE];
sys/arch/ews4800mips/stand/common/diskutil.c
122
bfs_fini(bfs);
sys/arch/ews4800mips/stand/common/mem.c
114
if (bfs_file_write(bfs, filename, p, size) != 0)
sys/arch/ews4800mips/stand/common/mem.c
116
bfs_fini(bfs);
sys/arch/ews4800mips/stand/common/mem.c
120
if (bfs_file_read(bfs, filename, p, size, 0) != 0)
sys/arch/ews4800mips/stand/common/mem.c
124
bfs_fini(bfs);
sys/arch/ews4800mips/stand/common/mem.c
129
if (bfs_file_write(bfs, filename, p, size) != 0)
sys/arch/ews4800mips/stand/common/mem.c
131
bfs_fini(bfs);
sys/arch/ews4800mips/stand/common/mem.c
55
struct bfs *bfs;
sys/arch/ews4800mips/stand/common/mem.c
91
if (bfs_init(&bfs) != 0) {
sys/arch/ews4800mips/stand/common/prompt.c
195
struct bfs *bfs;
sys/arch/ews4800mips/stand/common/prompt.c
197
if (bfs_init(&bfs) != 0) {
sys/arch/ews4800mips/stand/common/prompt.c
202
if (bfs_file_write(bfs, "boot.log", __log, LOG_SIZE) != 0)
sys/arch/ews4800mips/stand/common/prompt.c
205
bfs_fini(bfs);
sys/fs/sysvbfs/bfs.c
100
if ((err = bfs_init_superblock(bfs, bfs_sector, &memsize)) != 0) {
sys/fs/sysvbfs/bfs.c
101
bfs_fini(bfs);
sys/fs/sysvbfs/bfs.c
105
bfs->super_block_size = memsize;
sys/fs/sysvbfs/bfs.c
107
bfs_fini(bfs);
sys/fs/sysvbfs/bfs.c
111
if ((err = bfs_init_inode(bfs, p, &memsize)) != 0) {
sys/fs/sysvbfs/bfs.c
112
bfs_fini(bfs);
sys/fs/sysvbfs/bfs.c
116
bfs->dirent_size = memsize;
sys/fs/sysvbfs/bfs.c
118
bfs_fini(bfs);
sys/fs/sysvbfs/bfs.c
122
if ((err = bfs_init_dirent(bfs, p)) != 0) {
sys/fs/sysvbfs/bfs.c
123
bfs_fini(bfs);
sys/fs/sysvbfs/bfs.c
128
bfs_dump(bfs);
sys/fs/sysvbfs/bfs.c
130
*bfsp = bfs;
sys/fs/sysvbfs/bfs.c
136
bfs_fini(struct bfs *bfs)
sys/fs/sysvbfs/bfs.c
139
if (bfs == 0)
sys/fs/sysvbfs/bfs.c
141
if (bfs->super_block)
sys/fs/sysvbfs/bfs.c
142
__FREE(bfs->super_block, bfs->super_block_size, M_BFS);
sys/fs/sysvbfs/bfs.c
143
if (bfs->dirent)
sys/fs/sysvbfs/bfs.c
144
__FREE(bfs->dirent, bfs->dirent_size, M_BFS);
sys/fs/sysvbfs/bfs.c
145
__FREE(bfs, sizeof(struct bfs), M_BFS);
sys/fs/sysvbfs/bfs.c
149
bfs_init_superblock(struct bfs *bfs, int bfs_sector, size_t *required_memory)
sys/fs/sysvbfs/bfs.c
153
bfs->start_sector = bfs_sector;
sys/fs/sysvbfs/bfs.c
156
if (!bfs->io->read(bfs->io, (uint8_t *)&super, bfs_sector))
sys/fs/sysvbfs/bfs.c
163
bfs->data_start = super.header.data_start_byte;
sys/fs/sysvbfs/bfs.c
164
bfs->data_end = super.header.data_end_byte;
sys/fs/sysvbfs/bfs.c
166
bfs->max_inode = (bfs->data_start - sizeof(struct bfs_super_block)) /
sys/fs/sysvbfs/bfs.c
169
*required_memory = ROUND_SECTOR(bfs->data_start);
sys/fs/sysvbfs/bfs.c
175
bfs_init_inode(struct bfs *bfs, uint8_t *p, size_t *required_memory)
sys/fs/sysvbfs/bfs.c
180
if (!bfs->io->read_n(bfs->io, p, bfs->start_sector,
sys/fs/sysvbfs/bfs.c
181
bfs->data_start >> DEV_BSHIFT))
sys/fs/sysvbfs/bfs.c
184
bfs->super_block = (struct bfs_super_block *)p;
sys/fs/sysvbfs/bfs.c
185
bfs->inode = (struct bfs_inode *)(p + sizeof(struct bfs_super_block));
sys/fs/sysvbfs/bfs.c
186
p += bfs->data_start;
sys/fs/sysvbfs/bfs.c
188
bfs->n_inode = 0;
sys/fs/sysvbfs/bfs.c
189
inode = bfs->inode;
sys/fs/sysvbfs/bfs.c
191
for (i = 0; i < bfs->max_inode; i++, inode++) {
sys/fs/sysvbfs/bfs.c
193
bfs->n_inode++;
sys/fs/sysvbfs/bfs.c
198
DPRINTF(bfs->debug, "inode: %d/%d\n", bfs->n_inode, bfs->max_inode);
sys/fs/sysvbfs/bfs.c
201
DPRINTF(bfs->debug, "no root directory.\n");
sys/fs/sysvbfs/bfs.c
205
DPRINTF(bfs->debug, "root inode: %d-%d\n", root_inode->start_sector,
sys/fs/sysvbfs/bfs.c
207
bfs->root_inode = root_inode;
sys/fs/sysvbfs/bfs.c
216
bfs_init_dirent(struct bfs *bfs, uint8_t *p)
sys/fs/sysvbfs/bfs.c
219
struct bfs_inode *inode = bfs->root_inode;
sys/fs/sysvbfs/bfs.c
224
if (!bfs->io->read_n(bfs->io, p,
sys/fs/sysvbfs/bfs.c
225
bfs->start_sector + inode->start_sector, n))
sys/fs/sysvbfs/bfs.c
228
bfs->dirent = (struct bfs_dirent *)p;
sys/fs/sysvbfs/bfs.c
229
bfs->max_dirent = (n << DEV_BSHIFT) / sizeof(struct bfs_dirent);
sys/fs/sysvbfs/bfs.c
231
file = bfs->dirent;
sys/fs/sysvbfs/bfs.c
232
bfs->n_dirent = 0;
sys/fs/sysvbfs/bfs.c
233
for (i = 0; i < bfs->max_dirent; i++, file++)
sys/fs/sysvbfs/bfs.c
235
bfs->n_dirent++;
sys/fs/sysvbfs/bfs.c
237
DPRINTF(bfs->debug, "dirent: %d/%d\n", bfs->n_dirent, bfs->max_dirent);
sys/fs/sysvbfs/bfs.c
243
bfs_file_read(const struct bfs *bfs, const char *fname, void *buf, size_t bufsz,
sys/fs/sysvbfs/bfs.c
251
if (!bfs_file_lookup(bfs, fname, &start, &end, &sz))
sys/fs/sysvbfs/bfs.c
259
if (!bfs->io->read_n(bfs->io, p, start, n))
sys/fs/sysvbfs/bfs.c
263
if (!bfs->io->read(bfs->io, tmpbuf, end))
sys/fs/sysvbfs/bfs.c
274
bfs_file_write(struct bfs *bfs, const char *fname, void *buf,
sys/fs/sysvbfs/bfs.c
284
if (bfs_dirent_lookup_by_name(bfs, name, &dirent)) {
sys/fs/sysvbfs/bfs.c
286
if (!bfs_inode_lookup(bfs, dirent->inode, &inode)) {
sys/fs/sysvbfs/bfs.c
287
DPRINTF(bfs->debug, "%s: dirent found, but inode "
sys/fs/sysvbfs/bfs.c
293
bfs_file_delete(bfs, name, false);
sys/fs/sysvbfs/bfs.c
294
if ((err = bfs_file_create(bfs, name, buf, bufsz, &attr)) != 0)
sys/fs/sysvbfs/bfs.c
303
if ((err = bfs_file_create(bfs, name, buf, bufsz, &attr)) != 0)
sys/fs/sysvbfs/bfs.c
311
bfs_file_delete(struct bfs *bfs, const char *fname, bool keep_inode)
sys/fs/sysvbfs/bfs.c
316
if (!bfs_dirent_lookup_by_name(bfs, fname, &dirent))
sys/fs/sysvbfs/bfs.c
319
if (!keep_inode && !bfs_inode_lookup(bfs, dirent->inode, &inode))
sys/fs/sysvbfs/bfs.c
323
bfs->n_dirent--;
sys/fs/sysvbfs/bfs.c
324
bfs_writeback_dirent(bfs, dirent, false);
sys/fs/sysvbfs/bfs.c
328
bfs->n_inode--;
sys/fs/sysvbfs/bfs.c
329
bfs_writeback_inode(bfs, inode);
sys/fs/sysvbfs/bfs.c
331
DPRINTF(bfs->debug, "%s: \"%s\" deleted.\n", __func__, fname);
sys/fs/sysvbfs/bfs.c
337
bfs_file_rename(struct bfs *bfs, const char *from_name, const char *to_name)
sys/fs/sysvbfs/bfs.c
342
if (!bfs_dirent_lookup_by_name(bfs, from_name, &dirent)) {
sys/fs/sysvbfs/bfs.c
348
bfs_writeback_dirent(bfs, dirent, false);
sys/fs/sysvbfs/bfs.c
351
DPRINTF(bfs->debug, "%s: \"%s\" -> \"%s\" error=%d.\n", __func__,
sys/fs/sysvbfs/bfs.c
358
bfs_file_create(struct bfs *bfs, const char *fname, void *buf, size_t bufsz,
sys/fs/sysvbfs/bfs.c
368
if ((err = bfs_inode_alloc(bfs, &inode, &j, &start)) != 0)
sys/fs/sysvbfs/bfs.c
376
if ((start + n) * DEV_BSIZE >= bfs->data_end) {
sys/fs/sysvbfs/bfs.c
377
DPRINTF(bfs->debug, "disk full.\n");
sys/fs/sysvbfs/bfs.c
382
for (file = bfs->dirent, i = 0; i < bfs->max_dirent; i++, file++)
sys/fs/sysvbfs/bfs.c
385
if (i == bfs->max_dirent) {
sys/fs/sysvbfs/bfs.c
386
DPRINTF(bfs->debug, "dirent full.\n");
sys/fs/sysvbfs/bfs.c
400
bfs_inode_set_attr(bfs, inode, attr);
sys/fs/sysvbfs/bfs.c
407
DPRINTF(bfs->debug, "%s: start %d end %d\n", __func__,
sys/fs/sysvbfs/bfs.c
415
if (!bfs->io->write(bfs->io, p, bfs->start_sector + i))
sys/fs/sysvbfs/bfs.c
423
if (!bfs->io->write(bfs->io, tmpbuf, bfs->start_sector + i))
sys/fs/sysvbfs/bfs.c
427
bfs->n_inode++;
sys/fs/sysvbfs/bfs.c
428
bfs->n_dirent++;
sys/fs/sysvbfs/bfs.c
429
bfs_writeback_dirent(bfs, file, true);
sys/fs/sysvbfs/bfs.c
430
bfs_writeback_inode(bfs, inode);
sys/fs/sysvbfs/bfs.c
436
bfs_writeback_dirent(const struct bfs *bfs, struct bfs_dirent *dir,
sys/fs/sysvbfs/bfs.c
439
struct bfs_dirent *dir_base = bfs->dirent;
sys/fs/sysvbfs/bfs.c
440
struct bfs_inode *root_inode = bfs->root_inode;
sys/fs/sysvbfs/bfs.c
464
bfs_writeback_inode(bfs, root_inode);
sys/fs/sysvbfs/bfs.c
467
return bfs->io->write(bfs->io, (uint8_t *)dir_base + (i << DEV_BSHIFT),
sys/fs/sysvbfs/bfs.c
468
bfs->start_sector + bfs->root_inode->start_sector + i);
sys/fs/sysvbfs/bfs.c
472
bfs_writeback_inode(const struct bfs *bfs, struct bfs_inode *inode)
sys/fs/sysvbfs/bfs.c
474
struct bfs_inode *inode_base = bfs->inode;
sys/fs/sysvbfs/bfs.c
479
return bfs->io->write(bfs->io,
sys/fs/sysvbfs/bfs.c
481
bfs->start_sector + 1/*super block*/ + i);
sys/fs/sysvbfs/bfs.c
485
bfs_file_lookup(const struct bfs *bfs, const char *fname, int *start, int *end,
sys/fs/sysvbfs/bfs.c
491
if (!bfs_dirent_lookup_by_name(bfs, fname, &dirent))
sys/fs/sysvbfs/bfs.c
493
if (!bfs_inode_lookup(bfs, dirent->inode, &inode))
sys/fs/sysvbfs/bfs.c
497
*start = inode->start_sector + bfs->start_sector;
sys/fs/sysvbfs/bfs.c
499
*end = inode->end_sector + bfs->start_sector;
sys/fs/sysvbfs/bfs.c
503
DPRINTF(bfs->debug, "%s: %d + %d -> %d (%zd)\n",
sys/fs/sysvbfs/bfs.c
504
fname, bfs->start_sector, inode->start_sector,
sys/fs/sysvbfs/bfs.c
511
bfs_dirent_lookup_by_inode(const struct bfs *bfs, int inode,
sys/fs/sysvbfs/bfs.c
517
for (file = bfs->dirent, i = 0; i < bfs->max_dirent; i++, file++)
sys/fs/sysvbfs/bfs.c
521
if (i == bfs->max_dirent)
sys/fs/sysvbfs/bfs.c
530
bfs_dirent_lookup_by_name(const struct bfs *bfs, const char *fname,
sys/fs/sysvbfs/bfs.c
536
for (file = bfs->dirent, i = 0; i < bfs->max_dirent; i++, file++)
sys/fs/sysvbfs/bfs.c
541
if (i == bfs->max_dirent)
sys/fs/sysvbfs/bfs.c
550
bfs_inode_lookup(const struct bfs *bfs, ino_t n, struct bfs_inode **iinode)
sys/fs/sysvbfs/bfs.c
555
for (inode = bfs->inode, i = 0; i < bfs->max_inode; i++, inode++)
sys/fs/sysvbfs/bfs.c
559
if (i == bfs->max_inode)
sys/fs/sysvbfs/bfs.c
568
bfs_inode_delete(struct bfs *bfs, ino_t ino)
sys/fs/sysvbfs/bfs.c
572
if (!bfs_inode_lookup(bfs, ino, &inode))
sys/fs/sysvbfs/bfs.c
576
bfs->n_inode--;
sys/fs/sysvbfs/bfs.c
578
bfs_writeback_inode(bfs, inode);
sys/fs/sysvbfs/bfs.c
579
DPRINTF(bfs->debug, "%s: %lld deleted.\n", __func__, (long long)ino);
sys/fs/sysvbfs/bfs.c
593
bfs_inode_alloc(const struct bfs *bfs, struct bfs_inode **free_inode,
sys/fs/sysvbfs/bfs.c
600
inode = bfs->inode;
sys/fs/sysvbfs/bfs.c
603
for (i = BFS_ROOT_INODE; i < bfs->max_inode; i++, inode++) {
sys/fs/sysvbfs/bfs.c
623
DPRINTF(bfs->debug, "i-node full.\n");
sys/fs/sysvbfs/bfs.c
627
if (start * DEV_BSIZE >= bfs->data_end) {
sys/fs/sysvbfs/bfs.c
628
DPRINTF(bfs->debug, "data block full.\n");
sys/fs/sysvbfs/bfs.c
643
bfs_inode_set_attr(const struct bfs *bfs, struct bfs_inode *inode,
sys/fs/sysvbfs/bfs.c
662
bfs_writeback_inode(bfs, inode);
sys/fs/sysvbfs/bfs.c
673
bfs_dump(const struct bfs *bfs)
sys/fs/sysvbfs/bfs.c
682
if (!bfs_superblock_valid(bfs->super_block)) {
sys/fs/sysvbfs/bfs.c
683
DPRINTF(bfs->debug, "invalid bfs super block.\n");
sys/fs/sysvbfs/bfs.c
686
h = &bfs->super_block->header;
sys/fs/sysvbfs/bfs.c
687
compaction = &bfs->super_block->compaction;
sys/fs/sysvbfs/bfs.c
689
DPRINTF(bfs->debug, "super block %zdbyte, inode %zdbyte, dirent %zdbyte\n",
sys/fs/sysvbfs/bfs.c
690
sizeof *bfs->super_block, sizeof *inode, sizeof *file);
sys/fs/sysvbfs/bfs.c
692
DPRINTF(bfs->debug, "magic=%x\n", h->magic);
sys/fs/sysvbfs/bfs.c
693
DPRINTF(bfs->debug, "data_start_byte=0x%x\n", h->data_start_byte);
sys/fs/sysvbfs/bfs.c
694
DPRINTF(bfs->debug, "data_end_byte=0x%x\n", h->data_end_byte);
sys/fs/sysvbfs/bfs.c
695
DPRINTF(bfs->debug, "from=%#x\n", compaction->from);
sys/fs/sysvbfs/bfs.c
696
DPRINTF(bfs->debug, "to=%#x\n", compaction->to);
sys/fs/sysvbfs/bfs.c
697
DPRINTF(bfs->debug, "from_backup=%#x\n", compaction->from_backup);
sys/fs/sysvbfs/bfs.c
698
DPRINTF(bfs->debug, "to_backup=%#x\n", compaction->to_backup);
sys/fs/sysvbfs/bfs.c
699
DPRINTF(bfs->debug, "fsname=%s\n", bfs->super_block->fsname);
sys/fs/sysvbfs/bfs.c
700
DPRINTF(bfs->debug, "volume=%s\n", bfs->super_block->volume);
sys/fs/sysvbfs/bfs.c
703
DPRINTF(bfs->debug, "[inode index list]\n");
sys/fs/sysvbfs/bfs.c
704
for (inode = bfs->inode, i = j = 0; i < bfs->max_inode; inode++, i++) {
sys/fs/sysvbfs/bfs.c
707
DPRINTF(bfs->debug, "%3d %8d %8d %8d (%d) ",
sys/fs/sysvbfs/bfs.c
714
DPRINTF(bfs->debug, "%d %d %d %d %d %08x %08x %08x\n",
sys/fs/sysvbfs/bfs.c
72
STATIC int bfs_init_superblock(struct bfs *, int, size_t *);
sys/fs/sysvbfs/bfs.c
720
if (j != bfs->n_inode) {
sys/fs/sysvbfs/bfs.c
721
DPRINTF(bfs->debug, "inconsistent cached data. (i-node)\n");
sys/fs/sysvbfs/bfs.c
724
DPRINTF(bfs->debug, "total %d i-node.\n", j);
sys/fs/sysvbfs/bfs.c
727
DPRINTF(bfs->debug, "[dirent index list]\n");
sys/fs/sysvbfs/bfs.c
728
DPRINTF(bfs->debug, "%d file entries.\n", bfs->max_dirent);
sys/fs/sysvbfs/bfs.c
729
file = bfs->dirent;
sys/fs/sysvbfs/bfs.c
73
STATIC int bfs_init_inode(struct bfs *, uint8_t *, size_t *);
sys/fs/sysvbfs/bfs.c
730
for (i = j = 0; i < bfs->max_dirent; i++, file++) {
sys/fs/sysvbfs/bfs.c
732
if (bfs_file_lookup(bfs, file->name, &s, &e, &bytes))
sys/fs/sysvbfs/bfs.c
733
DPRINTF(bfs->debug, "%3d %14s %8d %8d %8zd\n",
sys/fs/sysvbfs/bfs.c
738
if (j != bfs->n_dirent) {
sys/fs/sysvbfs/bfs.c
739
DPRINTF(bfs->debug, "inconsistent cached data. (dirent)\n");
sys/fs/sysvbfs/bfs.c
74
STATIC int bfs_init_dirent(struct bfs *, uint8_t *);
sys/fs/sysvbfs/bfs.c
742
DPRINTF(bfs->debug, "%d files.\n", j);
sys/fs/sysvbfs/bfs.c
78
STATIC bool bfs_writeback_dirent(const struct bfs *, struct bfs_dirent *,
sys/fs/sysvbfs/bfs.c
80
STATIC bool bfs_writeback_inode(const struct bfs *, struct bfs_inode *);
sys/fs/sysvbfs/bfs.c
83
bfs_init2(struct bfs **bfsp, int bfs_sector, struct sector_io_ops *io,
sys/fs/sysvbfs/bfs.c
86
struct bfs *bfs;
sys/fs/sysvbfs/bfs.c
93
if ((bfs = (void *)__MALLOC(sizeof(struct bfs), M_BFS, M_WAITOK)) == 0)
sys/fs/sysvbfs/bfs.c
95
memset(bfs, 0, sizeof *bfs);
sys/fs/sysvbfs/bfs.c
96
bfs->io = io;
sys/fs/sysvbfs/bfs.c
97
bfs->debug = debug;
sys/fs/sysvbfs/bfs.h
147
int bfs_init2(struct bfs **, int, struct sector_io_ops *, bool);
sys/fs/sysvbfs/bfs.h
148
void bfs_fini(struct bfs *);
sys/fs/sysvbfs/bfs.h
149
int bfs_file_read(const struct bfs *, const char *, void *, size_t, size_t *);
sys/fs/sysvbfs/bfs.h
150
int bfs_file_write(struct bfs *, const char *, void *, size_t);
sys/fs/sysvbfs/bfs.h
151
int bfs_file_create(struct bfs *, const char *, void *, size_t,
sys/fs/sysvbfs/bfs.h
153
int bfs_file_delete(struct bfs *, const char *, bool);
sys/fs/sysvbfs/bfs.h
154
int bfs_file_rename(struct bfs *, const char *, const char *);
sys/fs/sysvbfs/bfs.h
155
bool bfs_file_lookup(const struct bfs *, const char *, int *, int *,
sys/fs/sysvbfs/bfs.h
159
bool bfs_dump(const struct bfs *);
sys/fs/sysvbfs/bfs.h
162
int sysvbfs_bfs_init(struct bfs **, struct vnode *);
sys/fs/sysvbfs/bfs.h
163
void sysvbfs_bfs_fini(struct bfs *);
sys/fs/sysvbfs/bfs.h
164
bool bfs_inode_lookup(const struct bfs *, ino_t, struct bfs_inode **);
sys/fs/sysvbfs/bfs.h
165
int bfs_inode_delete(struct bfs *, ino_t);
sys/fs/sysvbfs/bfs.h
166
bool bfs_dirent_lookup_by_name(const struct bfs *, const char *,
sys/fs/sysvbfs/bfs.h
168
bool bfs_dirent_lookup_by_inode(const struct bfs *, int,
sys/fs/sysvbfs/bfs.h
170
void bfs_inode_set_attr(const struct bfs *, struct bfs_inode *,
sys/fs/sysvbfs/bfs.h
172
int bfs_inode_alloc(const struct bfs *, struct bfs_inode **, int *,
sys/fs/sysvbfs/bfs_sysvbfs.c
58
sysvbfs_bfs_init(struct bfs **bfsp, struct vnode *vp)
sys/fs/sysvbfs/bfs_sysvbfs.c
78
sysvbfs_bfs_fini(struct bfs *bfs)
sys/fs/sysvbfs/bfs_sysvbfs.c
81
free(bfs->io, M_TEMP);
sys/fs/sysvbfs/bfs_sysvbfs.c
82
bfs_fini(bfs);
sys/fs/sysvbfs/sysvbfs.h
35
struct bfs;
sys/fs/sysvbfs/sysvbfs.h
61
struct bfs *bfs;
sys/fs/sysvbfs/sysvbfs_vfsops.c
189
if ((error = sysvbfs_bfs_init(&bmp->bfs, devvp)) != 0) {
sys/fs/sysvbfs/sysvbfs_vfsops.c
234
sysvbfs_bfs_fini(bmp->bfs);
sys/fs/sysvbfs/sysvbfs_vfsops.c
261
struct bfs *bfs = bmp->bfs;
sys/fs/sysvbfs/sysvbfs_vfsops.c
265
data_block = (bfs->data_end - bfs->data_start) >> BFS_BSHIFT;
sys/fs/sysvbfs/sysvbfs_vfsops.c
266
if (bfs_inode_alloc(bfs, 0, 0, &free_block) != 0)
sys/fs/sysvbfs/sysvbfs_vfsops.c
269
free_block = (bfs->data_end >> BFS_BSHIFT) - free_block;
sys/fs/sysvbfs/sysvbfs_vfsops.c
271
DPRINTF("%s: %d %d %d\n", __func__, bfs->data_start,
sys/fs/sysvbfs/sysvbfs_vfsops.c
272
bfs->data_end, free_block);
sys/fs/sysvbfs/sysvbfs_vfsops.c
281
f->f_files = bfs->max_inode;
sys/fs/sysvbfs/sysvbfs_vfsops.c
282
f->f_ffree = bfs->max_inode - bfs->n_inode;
sys/fs/sysvbfs/sysvbfs_vfsops.c
321
struct bfs *bfs;
sys/fs/sysvbfs/sysvbfs_vfsops.c
332
bfs = bmp->bfs;
sys/fs/sysvbfs/sysvbfs_vfsops.c
335
if (!bfs_inode_lookup(bfs, ino, &inode)) {
sys/fs/sysvbfs/sysvbfs_vnops.c
104
if (!bfs_dirent_lookup_by_name(bfs, cnp->cn_nameptr,
sys/fs/sysvbfs/sysvbfs_vnops.c
141
struct bfs *bfs = bmp->bfs;
sys/fs/sysvbfs/sysvbfs_vnops.c
155
if ((err = bfs_file_create(bfs, a->a_cnp->cn_nameptr, 0, 0, &attr))
sys/fs/sysvbfs/sysvbfs_vnops.c
161
if (!bfs_dirent_lookup_by_name(bfs, a->a_cnp->cn_nameptr, &dirent))
sys/fs/sysvbfs/sysvbfs_vnops.c
231
bfs_inode_set_attr(bnode->bmp->bfs, bnode->inode, &attr);
sys/fs/sysvbfs/sysvbfs_vnops.c
338
struct bfs *bfs = bnode->bmp->bfs;
sys/fs/sysvbfs/sysvbfs_vnops.c
413
bfs_inode_set_attr(bfs, inode, attr);
sys/fs/sysvbfs/sysvbfs_vnops.c
521
struct bfs *bfs = bmp->bfs;
sys/fs/sysvbfs/sysvbfs_vnops.c
531
if ((err = bfs_file_delete(bfs, ap->a_cnp->cn_nameptr, true)) != 0)
sys/fs/sysvbfs/sysvbfs_vnops.c
562
struct bfs *bfs = bnode->bmp->bfs;
sys/fs/sysvbfs/sysvbfs_vnops.c
592
error = bfs_file_delete(bfs, to_name, true);
sys/fs/sysvbfs/sysvbfs_vnops.c
596
error = bfs_file_rename(bfs, from_name, to_name);
sys/fs/sysvbfs/sysvbfs_vnops.c
626
struct bfs *bfs = bnode->bmp->bfs;
sys/fs/sysvbfs/sysvbfs_vnops.c
643
if ((i + n) > bfs->n_dirent)
sys/fs/sysvbfs/sysvbfs_vnops.c
644
n = bfs->n_dirent - i;
sys/fs/sysvbfs/sysvbfs_vnops.c
646
DPRINTF("%s 1: %d %d %d\n", __func__, i, n, bfs->n_dirent);
sys/fs/sysvbfs/sysvbfs_vnops.c
647
for (file = &bfs->dirent[i]; n > 0; file++, i++) {
sys/fs/sysvbfs/sysvbfs_vnops.c
648
if (i == bfs->max_dirent) {
sys/fs/sysvbfs/sysvbfs_vnops.c
670
DPRINTF("%s 2: %d %d %d\n", __func__, i, n, bfs->n_dirent);
sys/fs/sysvbfs/sysvbfs_vnops.c
671
*ap->a_eofflag = (i == bfs->n_dirent);
sys/fs/sysvbfs/sysvbfs_vnops.c
705
struct bfs *bfs = bnode->bmp->bfs;
sys/fs/sysvbfs/sysvbfs_vnops.c
712
if (bfs_inode_delete(bfs, bnode->inode->number) != 0)
sys/fs/sysvbfs/sysvbfs_vnops.c
742
if (blk * BFS_BSIZE > bmp->bfs->data_end)
sys/fs/sysvbfs/sysvbfs_vnops.c
75
struct bfs *bfs = bnode->bmp->bfs; /* my filesystem */
sys/fs/sysvbfs/sysvbfs_vnops.c
798
bfs_dump(bnode->bmp->bfs);
sys/fs/sysvbfs/sysvbfs_vnops.c
907
bfs_inode_set_attr(bnode->bmp->bfs, bnode->inode, &attr);
sys/ufs/ffs/ffs_vfsops.c
2414
struct fs *bfs;
sys/ufs/ffs/ffs_vfsops.c
2428
bfs = (struct fs *)bp->b_data;
sys/ufs/ffs/ffs_vfsops.c
2430
bfs->fs_flags &= ~FS_INTERNAL;
sys/ufs/ffs/ffs_vfsops.c
2433
KASSERT(bfs->fs_magic == FS_UFS2_MAGIC);
sys/ufs/ffs/ffs_vfsops.c
2434
bfs->fs_magic = FS_UFS2EA_MAGIC;
sys/ufs/ffs/ffs_vfsops.c
2438
ffs_sb_swap(bfs, bfs);
usr.bin/tftp/tftpsubs.c
100
bfs[0].counter = BF_ALLOC; /* pass out the first buffer */
usr.bin/tftp/tftpsubs.c
102
bfs[1].counter = BF_FREE;
usr.bin/tftp/tftpsubs.c
104
return (struct tftphdr *)(void *)bfs[0].buf;
usr.bin/tftp/tftpsubs.c
119
bfs[current].counter = BF_FREE; /* free old one */
usr.bin/tftp/tftpsubs.c
122
b = &bfs[current]; /* look at new buffer */
usr.bin/tftp/tftpsubs.c
146
b = &bfs[nextone]; /* look at "next" buffer */
usr.bin/tftp/tftpsubs.c
187
bfs[current].counter = ct; /* set size of data to write */
usr.bin/tftp/tftpsubs.c
189
if (bfs[current].counter != BF_FREE) /* if not free */
usr.bin/tftp/tftpsubs.c
192
bfs[current].counter = BF_ALLOC; /* mark as alloc'd */
usr.bin/tftp/tftpsubs.c
193
*dpp = (struct tftphdr *)(void *)bfs[current].buf;
usr.bin/tftp/tftpsubs.c
214
b = &bfs[nextone];
usr.bin/tftp/tftpsubs.c
66
} bfs[2];