diff options
author | Steve French <sfrench@us.ibm.com> | 2005-07-21 18:20:28 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2005-07-21 18:20:28 -0400 |
commit | eda3c029899cbf435d76fea43b7e1404439ccec9 (patch) | |
tree | 334ad2504575c4c22247e62c4add3bb2cb54f502 /fs/cifs/dir.c | |
parent | 076fb01e8238b7e5d68ba0d729c0ff7716d1d8ec (diff) |
[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 0d5e27fec92b..c0f20fc09290 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 | |||
327 | d_instantiate(direntry, newinode); | 327 | d_instantiate(direntry, newinode); |
328 | } | 328 | } |
329 | } else { | 329 | } else { |
330 | if((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) && | 330 | if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) { |
331 | (special_file(mode))) { | 331 | int oplock = 0; |
332 | u16 fileHandle; | ||
333 | FILE_ALL_INFO * buf; | ||
332 | 334 | ||
333 | cFYI(1,("sfu compat create special file")); | 335 | cFYI(1,("sfu compat create special file")); |
334 | /* Attributes = cpu_to_le32(ATTR_SYSTEM); | ||
335 | rc = CIFSSMBOpen(xid, pTcon, full_path, disposition, ...); */ | ||
336 | 336 | ||
337 | buf = kmalloc(sizeof(FILE_ALL_INFO),GFP_KERNEL); | ||
338 | if(buf == NULL) { | ||
339 | kfree(full_path); | ||
340 | FreeXid(xid); | ||
341 | return -ENOMEM; | ||
342 | } | ||
343 | |||
344 | rc = CIFSSMBOpen(xid, pTcon, full_path, | ||
345 | FILE_CREATE, /* fail if exists */ | ||
346 | GENERIC_WRITE /* BB would | ||
347 | WRITE_OWNER | WRITE_DAC be better? */, | ||
348 | /* Create a file and set the | ||
349 | file attribute to SYSTEM */ | ||
350 | CREATE_NOT_DIR | CREATE_OPTION_SPECIAL, | ||
351 | &fileHandle, &oplock, buf, | ||
352 | cifs_sb->local_nls, | ||
353 | cifs_sb->mnt_cifs_flags & | ||
354 | CIFS_MOUNT_MAP_SPECIAL_CHR); | ||
355 | |||
356 | if(!rc) { | ||
357 | /* BB Do not bother to decode buf since no | ||
358 | local inode yet to put timestamps in */ | ||
359 | CIFSSMBClose(xid, pTcon, fileHandle); | ||
360 | d_drop(direntry); | ||
361 | } | ||
362 | kfree(buf); | ||
337 | /* add code here to set EAs */ | 363 | /* add code here to set EAs */ |
338 | } | 364 | } |
339 | } | 365 | } |