Lines should be less than 80chars, rework cifs_create() a bit to fit more easily.
Signed-off-by: Jesper Juhl <[EMAIL PROTECTED]> --- linux-2.6.12-rc1-mm4/fs/cifs/dir.c.with_patch6 2005-04-03 00:17:50.000000000 +0200 +++ linux-2.6.12-rc1-mm4/fs/cifs/dir.c 2005-04-03 00:21:00.000000000 +0200 @@ -283,44 +283,45 @@ int cifs_create(struct inode *inode, str } else if (newinode) { pCifsFile = kmalloc(sizeof(struct cifsFileInfo), GFP_KERNEL); + if (!pCifsFile) + goto no_file; - if (pCifsFile) { - memset((char *)pCifsFile, 0, - sizeof(struct cifsFileInfo)); - pCifsFile->netfid = fileHandle; - pCifsFile->pid = current->tgid; - pCifsFile->pInode = newinode; - pCifsFile->invalidHandle = FALSE; - pCifsFile->closePend = FALSE; - init_MUTEX(&pCifsFile->fh_sem); - /* put the following in at open now */ - /* pCifsFile->pfile = file; */ - write_lock(&GlobalSMBSeslock); - list_add(&pCifsFile->tlist, - &pTcon->openFileList); - pCifsInode = CIFS_I(newinode); - if (pCifsInode) { - /* if readable file instance put first in list - */ - if (write_only == TRUE) { - list_add_tail(&pCifsFile->flist, - &pCifsInode->openFileList); - } else { - list_add(&pCifsFile->flist, - &pCifsInode->openFileList); - } - if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) { - pCifsInode->clientCanCacheAll = TRUE; - pCifsInode->clientCanCacheRead = TRUE; - cFYI(1, ("Exclusive Oplock granted on inode %p", - newinode)); - } else if ((oplock & 0xF) == OPLOCK_READ) - pCifsInode->clientCanCacheRead = TRUE; - } - write_unlock(&GlobalSMBSeslock); + memset((char *)pCifsFile, 0, + sizeof(struct cifsFileInfo)); + pCifsFile->netfid = fileHandle; + pCifsFile->pid = current->tgid; + pCifsFile->pInode = newinode; + pCifsFile->invalidHandle = FALSE; + pCifsFile->closePend = FALSE; + init_MUTEX(&pCifsFile->fh_sem); + /* put the following in at open now */ + /* pCifsFile->pfile = file; */ + write_lock(&GlobalSMBSeslock); + list_add(&pCifsFile->tlist, &pTcon->openFileList); + pCifsInode = CIFS_I(newinode); + if (!pCifsInode) + goto no_inode; + + /* if readable file instance put first in list */ + if (write_only == TRUE) { + list_add_tail(&pCifsFile->flist, + &pCifsInode->openFileList); + } else { + list_add(&pCifsFile->flist, + &pCifsInode->openFileList); } + if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) { + pCifsInode->clientCanCacheAll = TRUE; + pCifsInode->clientCanCacheRead = TRUE; + cFYI(1, ("Exclusive Oplock granted on inode" + " %p", newinode)); + } else if ((oplock & 0xF) == OPLOCK_READ) + pCifsInode->clientCanCacheRead = TRUE; +no_inode: + write_unlock(&GlobalSMBSeslock); } } +no_file: kfree(buf); kfree(full_path); - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/