[CIFS] Convert remaining places in fs/cifs from
authorEric Sesterhenn <snakebyte@gmx.de>
Tue, 21 Feb 2006 22:33:09 +0000 (22:33 +0000)
committerSteve French <sfrench@us.ibm.com>
Tue, 21 Feb 2006 22:33:09 +0000 (22:33 +0000)
kmalloc/memset to simpler kzalloc usage

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/cifsfs.c
fs/cifs/dir.c
fs/cifs/inode.c
fs/cifs/misc.c

index 79eeccd0437f08c2a3ac56a51af2de0cadc36f19..8219c02145a7e8f1e619e4e3bf7cdee9d25b9251 100644 (file)
@@ -93,13 +93,10 @@ cifs_read_super(struct super_block *sb, void *data,
        int rc = 0;
 
        sb->s_flags |= MS_NODIRATIME; /* and probably even noatime */
        int rc = 0;
 
        sb->s_flags |= MS_NODIRATIME; /* and probably even noatime */
-       sb->s_fs_info = kmalloc(sizeof(struct cifs_sb_info),GFP_KERNEL);
+       sb->s_fs_info = kzalloc(sizeof(struct cifs_sb_info),GFP_KERNEL);
        cifs_sb = CIFS_SB(sb);
        if(cifs_sb == NULL)
                return -ENOMEM;
        cifs_sb = CIFS_SB(sb);
        if(cifs_sb == NULL)
                return -ENOMEM;
-       else
-               memset(cifs_sb,0,sizeof(struct cifs_sb_info));
-       
 
        rc = cifs_mount(sb, cifs_sb, data, devname);
 
 
        rc = cifs_mount(sb, cifs_sb, data, devname);
 
index fed55e3c53dfab365c72886001ed4f240ddd6cee..77e1fc01d747fd342de2591d2ce0f4d4fbbd095d 100644 (file)
@@ -255,12 +255,10 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
                        CIFSSMBClose(xid, pTcon, fileHandle);
                } else if(newinode) {
                        pCifsFile =
                        CIFSSMBClose(xid, pTcon, fileHandle);
                } else if(newinode) {
                        pCifsFile =
-                          kmalloc(sizeof (struct cifsFileInfo), GFP_KERNEL);
+                          kzalloc(sizeof (struct cifsFileInfo), GFP_KERNEL);
                        
                        if(pCifsFile == NULL)
                                goto cifs_create_out;
                        
                        if(pCifsFile == NULL)
                                goto cifs_create_out;
-                       memset((char *)pCifsFile, 0,
-                              sizeof (struct cifsFileInfo));
                        pCifsFile->netfid = fileHandle;
                        pCifsFile->pid = current->tgid;
                        pCifsFile->pInode = newinode;
                        pCifsFile->netfid = fileHandle;
                        pCifsFile->pid = current->tgid;
                        pCifsFile->pInode = newinode;
index 59359911f4810c601923261c94cd49ffeebf5542..0fb42feff3c7bd70a3a8fce37000f075dc0c5bd0 100644 (file)
@@ -609,9 +609,8 @@ int cifs_unlink(struct inode *inode, struct dentry *direntry)
                }
        } else if (rc == -EACCES) {
                /* try only if r/o attribute set in local lookup data? */
                }
        } else if (rc == -EACCES) {
                /* try only if r/o attribute set in local lookup data? */
-               pinfo_buf = kmalloc(sizeof(FILE_BASIC_INFO), GFP_KERNEL);
+               pinfo_buf = kzalloc(sizeof(FILE_BASIC_INFO), GFP_KERNEL);
                if (pinfo_buf) {
                if (pinfo_buf) {
-                       memset(pinfo_buf, 0, sizeof(FILE_BASIC_INFO));
                        /* ATTRS set to normal clears r/o bit */
                        pinfo_buf->Attributes = cpu_to_le32(ATTR_NORMAL);
                        if (!(pTcon->ses->flags & CIFS_SES_NT4))
                        /* ATTRS set to normal clears r/o bit */
                        pinfo_buf->Attributes = cpu_to_le32(ATTR_NORMAL);
                        if (!(pTcon->ses->flags & CIFS_SES_NT4))
index 812c6bb0fe38adff74cc25c8dc7848cbae3315bd..0f3ebad09d3efa3c5679a64bb59ede2e8c6ede70 100644 (file)
@@ -72,10 +72,9 @@ sesInfoAlloc(void)
        struct cifsSesInfo *ret_buf;
 
        ret_buf =
        struct cifsSesInfo *ret_buf;
 
        ret_buf =
-           (struct cifsSesInfo *) kmalloc(sizeof (struct cifsSesInfo),
+           (struct cifsSesInfo *) kzalloc(sizeof (struct cifsSesInfo),
                                           GFP_KERNEL);
        if (ret_buf) {
                                           GFP_KERNEL);
        if (ret_buf) {
-               memset(ret_buf, 0, sizeof (struct cifsSesInfo));
                write_lock(&GlobalSMBSeslock);
                atomic_inc(&sesInfoAllocCount);
                ret_buf->status = CifsNew;
                write_lock(&GlobalSMBSeslock);
                atomic_inc(&sesInfoAllocCount);
                ret_buf->status = CifsNew;
@@ -110,10 +109,9 @@ tconInfoAlloc(void)
 {
        struct cifsTconInfo *ret_buf;
        ret_buf =
 {
        struct cifsTconInfo *ret_buf;
        ret_buf =
-           (struct cifsTconInfo *) kmalloc(sizeof (struct cifsTconInfo),
+           (struct cifsTconInfo *) kzalloc(sizeof (struct cifsTconInfo),
                                            GFP_KERNEL);
        if (ret_buf) {
                                            GFP_KERNEL);
        if (ret_buf) {
-               memset(ret_buf, 0, sizeof (struct cifsTconInfo));
                write_lock(&GlobalSMBSeslock);
                atomic_inc(&tconInfoAllocCount);
                list_add(&ret_buf->cifsConnectionList,
                write_lock(&GlobalSMBSeslock);
                atomic_inc(&tconInfoAllocCount);
                list_add(&ret_buf->cifsConnectionList,