-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
meterfs: Implement mount, getAttr, setAttr, stat and readdir #119
base: master
Are you sure you want to change the base?
Conversation
|
if (name[i] == '/') | ||
return -ENOENT; | ||
char *end = strchrnul(name + len, '/'); | ||
const size_t size = end - name + len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably should be:
const size_t size = end - name + len; | |
const size_t size = end - (name + len); |
} | ||
|
||
/* Hack-ish - handle virtual "." and ".." */ | ||
if (offs == 0) { /* "."" */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (offs == 0) { /* "."" */ | |
if (offs == 0) { /* "." */ |
same in line 1476
dent->d_reclen = len; | ||
dent->d_namlen = len; | ||
dent->d_type = DT_REG; | ||
strncpy(dent->d_name, f->header.name, len); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should be faster
strncpy(dent->d_name, f->header.name, len); | |
memcpy(dent->d_name, f->header.name, len); |
if (parent == NULL) { | ||
return -ENOMEM; | ||
} | ||
memcpy(parent, ctx->mountpoint, mntlen + 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a little faster
memcpy(parent, ctx->mountpoint, mntlen + 1); | |
memcpy(parent, ctx->mountpoint, mntlen); |
int meterfs_init(meterfs_ctx_t *ctx) | ||
{ | ||
int err; | ||
ctx->mountpoint = NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move it after checking the condition ctx == NULL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not reviewied code, I just playing with it a little with adapted flashsrv for DEND project.
My findings below:
1.meterfs: Filesystem check done. Found 23 files.
,but ls show 24 files. One file is doubled
2. echo "abc" > /meterfs_mount_point/mfs_file
causes that psh destroys file in unexpected way.
JIRA: RTOS-182
Description
Change is intended as non-breaking, old API should be still functional
Motivation and Context
Allow meterfs to be mounted in a directory and make 'ls' work
Types of changes
How Has This Been Tested?
Checklist:
Special treatment