]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/sysfs/dir.c
[PATCH] mark struct inode_operations const 3
[mirror_ubuntu-bionic-kernel.git] / fs / sysfs / dir.c
index 9dcdf556c99c1d2b68f9bde966f2b4d393b05555..8813990304fe58f8b12449b6f99471887f1920ee 100644 (file)
@@ -37,11 +37,10 @@ static struct sysfs_dirent * __sysfs_new_dirent(void * element)
 {
        struct sysfs_dirent * sd;
 
-       sd = kmem_cache_alloc(sysfs_dir_cachep, GFP_KERNEL);
+       sd = kmem_cache_zalloc(sysfs_dir_cachep, GFP_KERNEL);
        if (!sd)
                return NULL;
 
-       memset(sd, 0, sizeof(*sd));
        atomic_set(&sd->s_count, 1);
        atomic_set(&sd->s_event, 1);
        INIT_LIST_HEAD(&sd->s_children);
@@ -297,7 +296,7 @@ static struct dentry * sysfs_lookup(struct inode *dir, struct dentry *dentry,
        return ERR_PTR(err);
 }
 
-struct inode_operations sysfs_dir_inode_operations = {
+const struct inode_operations sysfs_dir_inode_operations = {
        .lookup         = sysfs_lookup,
        .setattr        = sysfs_setattr,
 };