comparison src/impl/fs_impl.cbc @ 338:2cbaa4c74d15

remove_skip
author anatofuz
date Sun, 16 Feb 2020 18:30:06 +0900
parents cb6045bce1d5
children
comparison
equal deleted inserted replaced
337:cb6045bce1d5 338:2cbaa4c74d15
86 fs->nameiparent = C_nameiparentfs_impl; 86 fs->nameiparent = C_nameiparentfs_impl;
87 return fs; 87 return fs;
88 } 88 }
89 89
90 typedef struct superblock superblock; 90 typedef struct superblock superblock;
91 __code readsbfs_impl(struct fs_impl* fs, uint dev, struct superblock* sb, __code next(...)) { //:skip 91 __code readsbfs_impl(struct fs_impl* fs, uint dev, struct superblock* sb, __code next(...)) {
92 92
93 struct buf* bp; 93 struct buf* bp;
94 94
95 bp = bread(dev, 1); 95 bp = bread(dev, 1);
96 memmove(sb, bp->data, sizeof(*sb)); 96 memmove(sb, bp->data, sizeof(*sb));
182 fs->next2 = next; 182 fs->next2 = next;
183 goto iunlockfs_impl(ip, fs->iput, ...); 183 goto iunlockfs_impl(ip, fs->iput, ...);
184 } 184 }
185 185
186 typedef struct stat stat; 186 typedef struct stat stat;
187 __code statifs_impl(struct fs_impl* fs , struct inode* ip, struct stat* st, __code next(...)) { //:skip 187 __code statifs_impl(struct fs_impl* fs , struct inode* ip, struct stat* st, __code next(...)) {
188 st->dev = ip->dev; 188 st->dev = ip->dev;
189 st->ino = ip->inum; 189 st->ino = ip->inum;
190 st->type = ip->type; 190 st->type = ip->type;
191 st->nlink = ip->nlink; 191 st->nlink = ip->nlink;
192 st->size = ip->size; 192 st->size = ip->size;
232 __code namecmpfs_impl(struct fs_impl* fs, const char* s, const char* t, __code next(int strncmp_val, ...)) { 232 __code namecmpfs_impl(struct fs_impl* fs, const char* s, const char* t, __code next(int strncmp_val, ...)) {
233 strncmp_val = strncmp(s, t, DIRSIZ); 233 strncmp_val = strncmp(s, t, DIRSIZ);
234 goto next(strncmp_val, ...); 234 goto next(strncmp_val, ...);
235 } 235 }
236 236
237 __code dirlookupfs_impl(struct fs_impl* fs, struct inode* dp, char* name, uint off, uint* poff, dirent* de, __code next(...)) { //:skip 237 __code dirlookupfs_impl(struct fs_impl* fs, struct inode* dp, char* name, uint off, uint* poff, dirent* de, __code next(...)) {
238 if (dp->type != T_DIR) { 238 if (dp->type != T_DIR) {
239 char* msg = "dirlookup not DIR"; 239 char* msg = "dirlookup not DIR";
240 struct Err* err = createKernelError(&proc->cbc_context); 240 struct Err* err = createKernelError(&proc->cbc_context);
241 Gearef(cbc_context, Err)->msg = msg; 241 Gearef(cbc_context, Err)->msg = msg;
242 goto meta(cbc_context, err->panic); 242 goto meta(cbc_context, err->panic);
243 } 243 }
244 Gearef(cbc_context, fs)->off = 0; 244 Gearef(cbc_context, fs)->off = 0;
245 goto dirlookup_loopcheck(fs, dp, name, off, poff, de, next(...)); 245 goto dirlookup_loopcheck(fs, dp, name, off, poff, de, next(...));
246 } 246 }
247 247
248 __code dirlinkfs_impl(struct fs_impl* fs, struct inode* ip, struct dirent* de, struct inode* dp, char* name, uint off, uint inum, __code next(...)) { //:skip 248 __code dirlinkfs_impl(struct fs_impl* fs, struct inode* ip, struct dirent* de, struct inode* dp, char* name, uint off, uint inum, __code next(...)) {
249 // Check that name is not present. 249 // Check that name is not present.
250 if ((ip = dirlookup(dp, name, 0)) != 0) { 250 if ((ip = dirlookup(dp, name, 0)) != 0) {
251 goto dirlink_namecheck(fs, ip, next(...)); 251 goto dirlink_namecheck(fs, ip, next(...));
252 } 252 }
253 Gearef(cbc_context, fs)->off = 0; 253 Gearef(cbc_context, fs)->off = 0;