aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/dir.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2005-11-18 23:25:31 -0500
committerSteve French <sfrench@us.ibm.com>2005-11-18 23:25:31 -0500
commit86c96b4bb70dac67d6815e09a0949427d439b280 (patch)
treef36ac16583ea9f935fcbed006a8edd99cf83852f /fs/cifs/dir.c
parentc119b87d596cdd99ac20095ae2ae90b525418605 (diff)
[CIFS] Fix mknod of block and chardev over SFU mounts
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/dir.c')
-rw-r--r--fs/cifs/dir.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 8dfe717a332a..16b21522e8fe 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -292,7 +292,8 @@ cifs_create_out:
292 return rc; 292 return rc;
293} 293}
294 294
295int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode, dev_t device_number) 295int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode,
296 dev_t device_number)
296{ 297{
297 int rc = -EPERM; 298 int rc = -EPERM;
298 int xid; 299 int xid;
@@ -368,7 +369,34 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode, dev_t dev
368 369
369 if(!rc) { 370 if(!rc) {
370 /* BB Do not bother to decode buf since no 371 /* BB Do not bother to decode buf since no
371 local inode yet to put timestamps in */ 372 local inode yet to put timestamps in,
373 but we can reuse it safely */
374 int bytes_written;
375 struct win_dev *pdev;
376 pdev = (struct win_dev *)buf;
377 if(S_ISCHR(mode)) {
378 memcpy(pdev->type, "IntxCHR", 8);
379 pdev->major =
380 cpu_to_le64(MAJOR(device_number));
381 pdev->minor =
382 cpu_to_le64(MINOR(device_number));
383 rc = CIFSSMBWrite(xid, pTcon,
384 fileHandle,
385 sizeof(struct win_dev),
386 0, &bytes_written, (char *)pdev,
387 NULL, 0);
388 } else if(S_ISBLK(mode)) {
389 memcpy(pdev->type, "IntxBLK", 8);
390 pdev->major =
391 cpu_to_le64(MAJOR(device_number));
392 pdev->minor =
393 cpu_to_le64(MINOR(device_number));
394 rc = CIFSSMBWrite(xid, pTcon,
395 fileHandle,
396 sizeof(struct win_dev),
397 0, &bytes_written, (char *)pdev,
398 NULL, 0);
399 } /* else if(S_ISFIFO */
372 CIFSSMBClose(xid, pTcon, fileHandle); 400 CIFSSMBClose(xid, pTcon, fileHandle);
373 d_drop(direntry); 401 d_drop(direntry);
374 } 402 }