diff options
author | Steve French <sfrench@us.ibm.com> | 2005-07-21 15:20:28 -0700 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2005-07-21 15:20:28 -0700 |
commit | eda3c029899cbf435d76fea43b7e1404439ccec9 (patch) | |
tree | 334ad2504575c4c22247e62c4add3bb2cb54f502 /fs/cifs/dir.c | |
parent | 076fb01e8238b7e5d68ba0d729c0ff7716d1d8ec (diff) | |
download | op-kernel-dev-eda3c029899cbf435d76fea43b7e1404439ccec9.zip op-kernel-dev-eda3c029899cbf435d76fea43b7e1404439ccec9.tar.gz |
[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
Diffstat (limited to 'fs/cifs/dir.c')
-rw-r--r-- | fs/cifs/dir.c | 34 |
1 files changed, 30 insertions, 4 deletions
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 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode, dev_t dev 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 */ } } |