Print this page
6659 nvlist_free(NULL) is a no-op


 143         0,                                      /* va_ctime */
 144         0,                                      /* va_rdev */
 145         0,                                      /* va_blksize */
 146         0,                                      /* va_nblocks */
 147         0                                       /* va_vcode */
 148 };
 149 
 150 kmem_cache_t    *sdev_node_cache;       /* sdev_node cache */
 151 int             devtype;                /* fstype */
 152 
 153 /* static */
 154 static struct vnodeops *sdev_get_vop(struct sdev_node *);
 155 static void sdev_set_no_negcache(struct sdev_node *);
 156 static fs_operation_def_t *sdev_merge_vtab(const fs_operation_def_t []);
 157 static void sdev_free_vtab(fs_operation_def_t *);
 158 
 159 static void
 160 sdev_prof_free(struct sdev_node *dv)
 161 {
 162         ASSERT(!SDEV_IS_GLOBAL(dv));
 163         if (dv->sdev_prof.dev_name)
 164                 nvlist_free(dv->sdev_prof.dev_name);
 165         if (dv->sdev_prof.dev_map)
 166                 nvlist_free(dv->sdev_prof.dev_map);
 167         if (dv->sdev_prof.dev_symlink)
 168                 nvlist_free(dv->sdev_prof.dev_symlink);
 169         if (dv->sdev_prof.dev_glob_incdir)
 170                 nvlist_free(dv->sdev_prof.dev_glob_incdir);
 171         if (dv->sdev_prof.dev_glob_excdir)
 172                 nvlist_free(dv->sdev_prof.dev_glob_excdir);
 173         bzero(&dv->sdev_prof, sizeof (dv->sdev_prof));
 174 }
 175 
 176 /* sdev_node cache constructor */
 177 /*ARGSUSED1*/
 178 static int
 179 i_sdev_node_ctor(void *buf, void *cfarg, int flag)
 180 {
 181         struct sdev_node *dv = (struct sdev_node *)buf;
 182         struct vnode *vp;
 183 
 184         bzero(buf, sizeof (struct sdev_node));
 185         vp = dv->sdev_vnode = vn_alloc(flag);
 186         if (vp == NULL) {
 187                 return (-1);
 188         }
 189         vp->v_data = dv;
 190         rw_init(&dv->sdev_contents, NULL, RW_DEFAULT, NULL);
 191         return (0);




 143         0,                                      /* va_ctime */
 144         0,                                      /* va_rdev */
 145         0,                                      /* va_blksize */
 146         0,                                      /* va_nblocks */
 147         0                                       /* va_vcode */
 148 };
 149 
 150 kmem_cache_t    *sdev_node_cache;       /* sdev_node cache */
 151 int             devtype;                /* fstype */
 152 
 153 /* static */
 154 static struct vnodeops *sdev_get_vop(struct sdev_node *);
 155 static void sdev_set_no_negcache(struct sdev_node *);
 156 static fs_operation_def_t *sdev_merge_vtab(const fs_operation_def_t []);
 157 static void sdev_free_vtab(fs_operation_def_t *);
 158 
 159 static void
 160 sdev_prof_free(struct sdev_node *dv)
 161 {
 162         ASSERT(!SDEV_IS_GLOBAL(dv));

 163         nvlist_free(dv->sdev_prof.dev_name);

 164         nvlist_free(dv->sdev_prof.dev_map);

 165         nvlist_free(dv->sdev_prof.dev_symlink);

 166         nvlist_free(dv->sdev_prof.dev_glob_incdir);

 167         nvlist_free(dv->sdev_prof.dev_glob_excdir);
 168         bzero(&dv->sdev_prof, sizeof (dv->sdev_prof));
 169 }
 170 
 171 /* sdev_node cache constructor */
 172 /*ARGSUSED1*/
 173 static int
 174 i_sdev_node_ctor(void *buf, void *cfarg, int flag)
 175 {
 176         struct sdev_node *dv = (struct sdev_node *)buf;
 177         struct vnode *vp;
 178 
 179         bzero(buf, sizeof (struct sdev_node));
 180         vp = dv->sdev_vnode = vn_alloc(flag);
 181         if (vp == NULL) {
 182                 return (-1);
 183         }
 184         vp->v_data = dv;
 185         rw_init(&dv->sdev_contents, NULL, RW_DEFAULT, NULL);
 186         return (0);