[PATCH][7/7] cifs: dir.c cleanup - long lines 2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux