int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode, dev_t device_number) 
int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode, dev_t device_number) 
int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode, dev_t device_number) {	int rc = -EPERM;	int xid;	struct cifs_sb_info *cifs_sb;	struct cifsTconInfo *pTcon;	char *full_path = NULL;	struct inode * newinode = NULL;	if (!old_valid_dev(device_number))		return -EINVAL;	xid = GetXid();	cifs_sb = CIFS_SB(inode->i_sb);	pTcon = cifs_sb->tcon;	down(&direntry->d_sb->s_vfs_rename_sem);	full_path = build_path_from_dentry(direntry);	up(&direntry->d_sb->s_vfs_rename_sem);	if(full_path == NULL)		rc = -ENOMEM;	else if (pTcon->ses->capabilities & CAP_UNIX) {		if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) {			rc = CIFSSMBUnixSetPerms(xid, pTcon, full_path,				mode,(__u64)current->euid,(__u64)current->egid,				device_number, cifs_sb->local_nls,				cifs_sb->mnt_cifs_flags & 					CIFS_MOUNT_MAP_SPECIAL_CHR);		} else {			rc = CIFSSMBUnixSetPerms(xid, pTcon,				full_path, mode, (__u64)-1, (__u64)-1,				device_number, cifs_sb->local_nls,				cifs_sb->mnt_cifs_flags & 					CIFS_MOUNT_MAP_SPECIAL_CHR);		}		if(!rc) {			rc = cifs_get_inode_info_unix(&newinode, full_path,						inode->i_sb,xid);			if (pTcon->nocase)				direntry->d_op = &cifs_ci_dentry_ops;			else				direntry->d_op = &cifs_dentry_ops;			if(rc == 0)				d_instantiate(direntry, newinode);		}	} else {		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"));			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 */		}	}	kfree(full_path);	FreeXid(xid);	return rc;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/86c96b4bb70dac67d6815e09a0949427d439b280/dir.c/clean/fs/cifs/dir.c