Skip to content
Snippets Groups Projects
Commit cabd6f1e authored by Avi Kivity's avatar Avi Kivity
Browse files

file: don't initialize with memset()


If we're going to have a vtable in there, the memset() will kill it.

Instead, add initializers for those members not already initialized by
make_file().

Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
parent 69daf614
No related branches found
No related tags found
No related merge requests found
......@@ -162,7 +162,6 @@ static int falloc_noinstall(struct file **resultfp)
fp = new file;
if (!fp)
return ENOMEM;
memset(fp, 0, sizeof(*fp));
fp->f_ops = &badfileops;
fp->f_count = 1;
......
......@@ -78,10 +78,10 @@ struct file {
void operator delete(void *p) { osv::rcu_dispose(p); }
int f_flags; /* open flags */
int f_count; /* reference count, see below */
off_t f_offset; /* current position in file */
struct dentry *f_dentry; /* dentry */
off_t f_offset = 0; /* current position in file */
struct dentry *f_dentry = nullptr; /* dentry */
struct fileops *f_ops; /* file ops abstraction */
void *f_data; /* file descriptor specific data */
void *f_data; /* file descriptor specific data */
filetype_t f_type; /* descriptor type */
TAILQ_HEAD(, poll_link) f_poll_list; /* poll request list */
mutex_t f_lock; /* lock */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment