[CIFS] Add compat with SFU (part 2)

Creating FIFOs to non-Unix servers (with cifs mounts for which sfu option
was specified) now works.

Signed-off-by: Steve French (sfrench@us.ibm.com)

Thanks to Martin Koeppe for his assistance
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 0d5e27f..c0f20fc 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -327,13 +327,39 @@
 				d_instantiate(direntry, newinode);
 		}
 	} else {
-		if((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) && 
-			(special_file(mode))) {
+		if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) {
+			int oplock = 0;
+			u16 fileHandle;
+			FILE_ALL_INFO * buf;
 
 			cFYI(1,("sfu compat create special file"));
-			/*	Attributes = cpu_to_le32(ATTR_SYSTEM); 
-				rc = CIFSSMBOpen(xid, pTcon, full_path, disposition, ...); */
 
+			buf = kmalloc(sizeof(FILE_ALL_INFO),GFP_KERNEL);
+			if(buf == NULL) {
+				kfree(full_path);
+				FreeXid(xid);
+				return -ENOMEM;
+			}
+
+			rc = CIFSSMBOpen(xid, pTcon, full_path,
+					 FILE_CREATE, /* fail if exists */
+					 GENERIC_WRITE /* BB would 
+					  WRITE_OWNER | WRITE_DAC be better? */,
+					 /* Create a file and set the
+					    file attribute to SYSTEM */
+					 CREATE_NOT_DIR | CREATE_OPTION_SPECIAL,
+					 &fileHandle, &oplock, buf,
+					 cifs_sb->local_nls,
+					 cifs_sb->mnt_cifs_flags & 
+					    CIFS_MOUNT_MAP_SPECIAL_CHR);
+
+			if(!rc) {
+				/* BB Do not bother to decode buf since no
+				   local inode yet to put timestamps in */
+				CIFSSMBClose(xid, pTcon, fileHandle);
+				d_drop(direntry);
+			}
+			kfree(buf);
 			/* add code here to set EAs */
 		}
 	}