cifs_sb->local_nls); 
cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); 
static int cifs_reopen_file(struct inode *inode, struct file *file, 	int can_flush){	int rc = -EACCES;	int xid, oplock;	struct cifs_sb_info *cifs_sb;	struct cifsTconInfo *pTcon;	struct cifsFileInfo *pCifsFile;	struct cifsInodeInfo *pCifsInode;	char *full_path = NULL;	int desiredAccess;	int disposition = FILE_OPEN;	__u16 netfid;	if (inode == NULL)		return -EBADF;	if (file->private_data) {		pCifsFile = (struct cifsFileInfo *)file->private_data;	} else		return -EBADF;	xid = GetXid();	down(&pCifsFile->fh_sem);	if (pCifsFile->invalidHandle == FALSE) {		up(&pCifsFile->fh_sem);		FreeXid(xid);		return 0;	}	if (file->f_dentry == NULL) {		up(&pCifsFile->fh_sem);		cFYI(1, ("failed file reopen, no valid name if dentry freed"));		FreeXid(xid);		return -EBADF;	}	cifs_sb = CIFS_SB(inode->i_sb);	pTcon = cifs_sb->tcon;/* can not grab rename sem here because various ops, including   those that already have the rename sem can end up causing writepage   to get called and if the server was down that means we end up here,   and we can never tell if the caller already has the rename_sem */	full_path = build_path_from_dentry(file->f_dentry);	if (full_path == NULL) {		up(&pCifsFile->fh_sem);		FreeXid(xid);		return -ENOMEM;	}	cFYI(1, (" inode = 0x%p file flags are 0x%x for %s",		 inode, file->f_flags,full_path));	desiredAccess = cifs_convert_flags(file->f_flags);	if (oplockEnabled)		oplock = REQ_OPLOCK;	else		oplock = FALSE;	/* Can not refresh inode by passing in file_info buf to be returned	   by SMBOpen and then calling get_inode_info with returned buf 	   since file might have write behind data that needs to be flushed 	   and server version of file size can be stale. If we knew for sure	   that inode was not dirty locally we could do this *//*	buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL);	if (buf == 0) {		up(&pCifsFile->fh_sem);		kfree(full_path);		FreeXid(xid);		return -ENOMEM;	} */	rc = CIFSSMBOpen(xid, pTcon, full_path, disposition, desiredAccess,			 CREATE_NOT_DIR, &netfid, &oplock, NULL,			 cifs_sb->local_nls);	if (rc) {		up(&pCifsFile->fh_sem);		cFYI(1, ("cifs_open returned 0x%x ", rc));		cFYI(1, ("oplock: %d ", oplock));	} else {		pCifsFile->netfid = netfid;		pCifsFile->invalidHandle = FALSE;		up(&pCifsFile->fh_sem);		pCifsInode = CIFS_I(inode);		if (pCifsInode) {			if (can_flush) {				filemap_fdatawrite(inode->i_mapping);				filemap_fdatawait(inode->i_mapping);			/* temporarily disable caching while we			   go to server to get inode info */				pCifsInode->clientCanCacheAll = FALSE;				pCifsInode->clientCanCacheRead = FALSE;				if (pTcon->ses->capabilities & CAP_UNIX)					rc = cifs_get_inode_info_unix(&inode,						full_path, inode->i_sb, xid);				else					rc = cifs_get_inode_info(&inode,						full_path, NULL, inode->i_sb,						xid);			} /* else we are writing out data to server already			     and could deadlock if we tried to flush data, and			     since we do not know if we have data that would			     invalidate the current end of file on the server			     we can not go to the server to get the new inod			     info */			if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) {				pCifsInode->clientCanCacheAll = TRUE;				pCifsInode->clientCanCacheRead = TRUE;				cFYI(1, ("Exclusive Oplock granted on inode %p",					 file->f_dentry->d_inode));			} else if ((oplock & 0xF) == OPLOCK_READ) {				pCifsInode->clientCanCacheRead = TRUE;				pCifsInode->clientCanCacheAll = FALSE;			} else {				pCifsInode->clientCanCacheRead = FALSE;				pCifsInode->clientCanCacheAll = FALSE;			}			cifs_relock_file(pCifsFile);		}	}	kfree(full_path);	FreeXid(xid);	return rc;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/737b758c965a9b223ac1243ab38d9e507ac86c64/file.c/clean/fs/cifs/file.c