ucore_networking's People
ucore_networking's Issues
请问这里的tcp/ip用的是哪个开源的源码
mksfs.c add_entry问题
static void
add_entry(struct sfs_fs *sfs, struct cache_inode *current, struct cache_inode *file, const char *name) {
//sfs_disk_entry
static struct sfs_entry __entry, *entry = &__entry;
//current必须是目录类型的inode
assert(current->inode.type == SFS_TYPE_DIR && strlen(name) <= SFS_MAX_FNAME_LEN);
//设置block number id和文件名称
entry->ino = file->ino, strcpy(entry->name, name);
// 下一个 block ino
uint32_t entry_ino = sfs_alloc_ino(sfs);
// 都是从 entry_no * blocksize开始写,这个意思是 一个entry占有一个disk block 了
// data , len=256 , block number id
write_block(sfs, entry, sizeof(entry->name), entry_ino);
// printf("entry->name: %s entry_ino: %d len:%d \n", entry->name, entry_ino ,sizeof(entry->name));
// 在sfs->blocks中添加一个cache_block和相应的ino
// 就是将entry_ino 记录到current->inode->direct 或则 current->inode->indirect 或者 current->inode->db_indirect
//current->inode->direct[current->nblks] = entry_ino
// 给目录 current 添加一个表示 文件或者目录的sfs_entry数据
append_block_slot(sfs, current, entry_ino, name);
//append_block(sfs, current, sizeof(entry->name), entry_ino, name);
file->inode.nlinks ++;
}
write_block(sfs, entry, sizeof(entry->name), entry_ino);
这里为什么是sizeof(entry->name),而不是sizeof(sfs_entry)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.