aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2012-08-14 12:16:00 +0200
committerMiklos Szeredi <mszeredi@suse.cz>2012-08-14 12:16:00 +0200
commitfdff523325bf49dc1cb9b62787dcf4ae22898d0f (patch)
tree0d789a5a94c4c2de2ae4bf991d1878718ccd146c
parent1061a0a2d90148bd2e7f32e1e694399db2dbe087 (diff)
downloadandroid_external_fuse-fdff523325bf49dc1cb9b62787dcf4ae22898d0f.tar.gz
android_external_fuse-fdff523325bf49dc1cb9b62787dcf4ae22898d0f.tar.bz2
android_external_fuse-fdff523325bf49dc1cb9b62787dcf4ae22898d0f.zip
Zero out node when allocating from a slab.
Fix compile warning when not using node slab.
-rw-r--r--lib/fuse.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/fuse.c b/lib/fuse.c
index f801f84..49d69db 100644
--- a/lib/fuse.c
+++ b/lib/fuse.c
@@ -325,12 +325,12 @@ static void list_add(struct list_head *new, struct list_head *prev,
prev->next = new;
}
-static void list_add_head(struct list_head *new, struct list_head *head)
+static inline void list_add_head(struct list_head *new, struct list_head *head)
{
list_add(new, head, head->next);
}
-static void list_add_tail(struct list_head *new, struct list_head *head)
+static inline void list_add_tail(struct list_head *new, struct list_head *head)
{
list_add(new, head->prev, head);
}
@@ -423,6 +423,7 @@ static struct node *alloc_node(struct fuse *f)
list_del(&slab->list);
list_add_tail(&slab->list, &f->full_slabs);
}
+ memset(node, 0, sizeof(struct node));
return (struct node *) node;
}
@@ -838,13 +839,8 @@ static struct node *find_node(struct fuse *f, fuse_ino_t parent,
if (node == NULL)
goto out_err;
- node->refctr = 0;
node->nodeid = next_id(f);
node->generation = f->generation;
- node->open_count = 0;
- node->is_hidden = 0;
- node->treelock = 0;
- node->ticket = 0;
if (f->conf.remember)
inc_nlookup(node);
@@ -4661,9 +4657,7 @@ struct fuse *fuse_new_common(struct fuse_chan *ch, struct fuse_args *args,
root->parent = NULL;
root->nodeid = FUSE_ROOT_ID;
- root->generation = 0;
- root->refctr = 1;
- root->nlookup = 1;
+ inc_nlookup(root);
hash_id(f, root);
return f;