cifsConvertToUCS((__u16 *) (pSMB->fileName + 1), 
cifsConvertToUCS((__le16 *) (pSMB->fileName + 1), 
CIFSSMBOpen(const int xid, struct cifsTconInfo *tcon,	    const char *fileName, const int openDisposition,	    const int access_flags, const int create_options, __u16 * netfid,	    int *pOplock, FILE_ALL_INFO * pfile_info, 	    const struct nls_table *nls_codepage, int remap){	int rc = -EACCES;	OPEN_REQ *pSMB = NULL;	OPEN_RSP *pSMBr = NULL;	int bytes_returned;	int name_len;	__u16 count;openRetry:	rc = smb_init(SMB_COM_NT_CREATE_ANDX, 24, tcon, (void **) &pSMB,		      (void **) &pSMBr);	if (rc)		return rc;	pSMB->AndXCommand = 0xFF;	/* none */	if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) {		count = 1;	/* account for one byte pad to word boundary */		name_len =		    cifsConvertToUCS((__u16 *) (pSMB->fileName + 1),				     fileName, PATH_MAX, nls_codepage, remap);		name_len++;	/* trailing null */		name_len *= 2;		pSMB->NameLength = cpu_to_le16(name_len);	} else {		/* BB improve check for buffer overruns BB */		count = 0;	/* no pad */		name_len = strnlen(fileName, PATH_MAX);		name_len++;	/* trailing null */		pSMB->NameLength = cpu_to_le16(name_len);		strncpy(pSMB->fileName, fileName, name_len);	}	if (*pOplock & REQ_OPLOCK)		pSMB->OpenFlags = cpu_to_le32(REQ_OPLOCK);	else if (*pOplock & REQ_BATCHOPLOCK) {		pSMB->OpenFlags = cpu_to_le32(REQ_BATCHOPLOCK);	}	pSMB->DesiredAccess = cpu_to_le32(access_flags);	pSMB->AllocationSize = 0;	pSMB->FileAttributes = cpu_to_le32(ATTR_NORMAL);	/* XP does not handle ATTR_POSIX_SEMANTICS */	/* but it helps speed up case sensitive checks for other	servers such as Samba */	if (tcon->ses->capabilities & CAP_UNIX)		pSMB->FileAttributes |= cpu_to_le32(ATTR_POSIX_SEMANTICS);	/* if ((omode & S_IWUGO) == 0)		pSMB->FileAttributes |= cpu_to_le32(ATTR_READONLY);*/	/*  Above line causes problems due to vfs splitting create into two		pieces - need to set mode after file created not while it is		being created */	pSMB->ShareAccess = cpu_to_le32(FILE_SHARE_ALL);	pSMB->CreateDisposition = cpu_to_le32(openDisposition);	pSMB->CreateOptions = cpu_to_le32(create_options);	/* BB Expirement with various impersonation levels and verify */	pSMB->ImpersonationLevel = cpu_to_le32(SECURITY_IMPERSONATION);	pSMB->SecurityFlags =	    SECURITY_CONTEXT_TRACKING | SECURITY_EFFECTIVE_ONLY;	count += name_len;	pSMB->hdr.smb_buf_length += count;	pSMB->ByteCount = cpu_to_le16(count);	/* long_op set to 1 to allow for oplock break timeouts */	rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,			 (struct smb_hdr *) pSMBr, &bytes_returned, 1);	if (rc) {		cFYI(1, ("Error in Open = %d", rc));	} else {		*pOplock = pSMBr->OplockLevel; /* 1 byte no need to le_to_cpu */		*netfid = pSMBr->Fid;	/* cifs fid stays in le */		/* Let caller know file was created so we can set the mode. */		/* Do we care about the CreateAction in any other cases? */		if(cpu_to_le32(FILE_CREATE) == pSMBr->CreateAction)			*pOplock |= CIFS_CREATE_ACTION; 		if(pfile_info) {		    memcpy((char *)pfile_info,(char *)&pSMBr->CreationTime,			36 /* CreationTime to Attributes */);		    /* the file_info buf is endian converted by caller */		    pfile_info->AllocationSize = pSMBr->AllocationSize;		    pfile_info->EndOfFile = pSMBr->EndOfFile;		    pfile_info->NumberOfLinks = cpu_to_le32(1);		}#ifdef CONFIG_CIFS_STATS		atomic_inc(&tcon->num_opens);#endif	}	cifs_buf_release(pSMB);	if (rc == -EAGAIN)		goto openRetry;	return rc;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b1a45695bde0204597957e448923f09ce271ca80/cifssmb.c/clean/fs/cifs/cifssmb.c