dir.c (b22364c8eec89e6b0c081a237f3b6348df87796f) dir.c (c376222960ae91d5ffb9197ee36771aaed1d9f90)
1/* -*- mode: c; c-basic-offset: 8; -*-
2 * vim: noexpandtab sw=8 ts=8 sts=0:
3 *
4 * dir.c - Operations for configfs directories.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public
8 * License as published by the Free Software Foundation; either

--- 58 unchanged lines hidden (view full) ---

67/*
68 * Allocates a new configfs_dirent and links it to the parent configfs_dirent
69 */
70static struct configfs_dirent *configfs_new_dirent(struct configfs_dirent * parent_sd,
71 void * element)
72{
73 struct configfs_dirent * sd;
74
1/* -*- mode: c; c-basic-offset: 8; -*-
2 * vim: noexpandtab sw=8 ts=8 sts=0:
3 *
4 * dir.c - Operations for configfs directories.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public
8 * License as published by the Free Software Foundation; either

--- 58 unchanged lines hidden (view full) ---

67/*
68 * Allocates a new configfs_dirent and links it to the parent configfs_dirent
69 */
70static struct configfs_dirent *configfs_new_dirent(struct configfs_dirent * parent_sd,
71 void * element)
72{
73 struct configfs_dirent * sd;
74
75 sd = kmem_cache_alloc(configfs_dir_cachep, GFP_KERNEL);
75 sd = kmem_cache_zalloc(configfs_dir_cachep, GFP_KERNEL);
76 if (!sd)
77 return NULL;
78
76 if (!sd)
77 return NULL;
78
79 memset(sd, 0, sizeof(*sd));
80 atomic_set(&sd->s_count, 1);
81 INIT_LIST_HEAD(&sd->s_links);
82 INIT_LIST_HEAD(&sd->s_children);
83 list_add(&sd->s_sibling, &parent_sd->s_children);
84 sd->s_element = element;
85
86 return sd;
87}

--- 1113 unchanged lines hidden ---
79 atomic_set(&sd->s_count, 1);
80 INIT_LIST_HEAD(&sd->s_links);
81 INIT_LIST_HEAD(&sd->s_children);
82 list_add(&sd->s_sibling, &parent_sd->s_children);
83 sd->s_element = element;
84
85 return sd;
86}

--- 1113 unchanged lines hidden ---