Lines Matching refs:fs
19 int O2FS_Unmount(VFS *fs);
20 int O2FS_GetRoot(VFS *fs, VNode **dn);
45 VFS *fs = VFS_Alloc();
51 if (!fs)
84 BufCache_Release(fs->bitmap[i]);
89 fs->bitmap[i] = bentry;
95 fs->fsptr = entry;
96 fs->fsval = sb->root.offset;
97 fs->blksize = sb->blockSize;
100 fs->op = &O2FSOperations;
101 fs->disk = disk;
102 Spinlock_Init(&fs->lock, "O2FS Lock", SPINLOCK_TYPE_NORMAL);
103 fs->refCount = 1;
104 fs->root = NULL;
106 status = O2FS_GetRoot(fs, &fs->root);
113 return fs;
117 O2FS_Unmount(VFS *fs)
133 O2FSBAlloc(VFS *fs)
137 BufCacheEntry *bentry = fs->bitmap[i];
139 if (fs->bitmap[i] == NULL)
145 for (int b = 0; b < fs->blksize; b++) {
160 uint64_t blk = fs->blksize*8*i + 8*b + bi;
181 O2FSBFree(VFS *fs, uint64_t block)
184 uint64_t bytoff = (block >> 8) % fs->blksize;
185 uint64_t bufoff = block / (fs->blksize*8);
189 BufCacheEntry *bentry = fs->bitmap[bufoff];
210 O2FSLoadVNode(VFS *fs, ObjID *objid)
217 status = BufCache_Read(fs->disk, objid->offset, &entry);
242 vn->disk = fs->disk;
246 vn->vfs = fs;
347 * @param [in] fs VFS Instance.
353 O2FS_GetRoot(VFS *fs, VNode **dn)
360 if (fs->root) {
361 fs->root->refCount++;
362 *dn = fs->root;
366 status = BufCache_Read(fs->disk, fs->fsval, &entry);
387 vn->disk = fs->disk;
391 vn->vfs = fs;