aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/ioctl.c
diff options
context:
space:
mode:
authorSteve French <smfrench@austin.rr.com>2005-04-29 01:41:07 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-29 01:41:07 -0400
commitf28ac91b0541a49d5bc7bfb9f0efd5289a7dd181 (patch)
tree65b4b2d1f2cef8d7db8a3c907748e1e959bbf1af /fs/cifs/ioctl.c
parent848f3fce45d2ba93e10b5e9d65bcae0d9269ad0d (diff)
[PATCH] cifs: CIFS ioctl needed by umount.cifs utility
Signed-off-by: Steve French (sfrench@us.ibm.com) Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/cifs/ioctl.c')
-rw-r--r--fs/cifs/ioctl.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/fs/cifs/ioctl.c b/fs/cifs/ioctl.c
index a4f1c34a8dc7..711bb7a3a98e 100644
--- a/fs/cifs/ioctl.c
+++ b/fs/cifs/ioctl.c
@@ -29,6 +29,8 @@
29#include "cifs_debug.h" 29#include "cifs_debug.h"
30#include "cifsfs.h" 30#include "cifsfs.h"
31 31
32#define CIFS_IOC_CHECKUMOUNT _IO(0xCF, 2)
33
32int cifs_ioctl (struct inode * inode, struct file * filep, 34int cifs_ioctl (struct inode * inode, struct file * filep,
33 unsigned int command, unsigned long arg) 35 unsigned int command, unsigned long arg)
34{ 36{
@@ -36,8 +38,8 @@ int cifs_ioctl (struct inode * inode, struct file * filep,
36#ifdef CONFIG_CIFS_POSIX 38#ifdef CONFIG_CIFS_POSIX
37 __u64 ExtAttrBits = 0; 39 __u64 ExtAttrBits = 0;
38 __u64 ExtAttrMask = 0; 40 __u64 ExtAttrMask = 0;
39 __u64 caps;
40#endif /* CONFIG_CIFS_POSIX */ 41#endif /* CONFIG_CIFS_POSIX */
42 __u64 caps;
41 int xid; 43 int xid;
42 struct cifs_sb_info *cifs_sb; 44 struct cifs_sb_info *cifs_sb;
43 struct cifsTconInfo *tcon; 45 struct cifsTconInfo *tcon;
@@ -46,12 +48,11 @@ int cifs_ioctl (struct inode * inode, struct file * filep,
46 48
47 xid = GetXid(); 49 xid = GetXid();
48 50
51 cFYI(1,("ioctl file %p cmd %u arg %lu",filep,command,arg));
52
49 cifs_sb = CIFS_SB(inode->i_sb); 53 cifs_sb = CIFS_SB(inode->i_sb);
50 tcon = cifs_sb->tcon; 54 tcon = cifs_sb->tcon;
51 if (pSMBFile == NULL)
52 goto cifs_ioctl_out;
53 55
54#ifdef CONFIG_CIFS_POSIX
55 if(tcon) 56 if(tcon)
56 caps = le64_to_cpu(tcon->fsUnixInfo.Capability); 57 caps = le64_to_cpu(tcon->fsUnixInfo.Capability);
57 else { 58 else {
@@ -59,10 +60,22 @@ int cifs_ioctl (struct inode * inode, struct file * filep,
59 goto cifs_ioctl_out; 60 goto cifs_ioctl_out;
60 } 61 }
61 62
62 cFYI(1,("ioctl file %p cmd %u arg %lu",filep,command,arg));
63 switch(command) { 63 switch(command) {
64 case CIFS_IOC_CHECKUMOUNT:
65 cFYI(1,("User unmount attempted"));
66 /* BB FIXME - add missing code here FIXME */
67 if(cifs_sb->mnt_uid == current->uid)
68 rc = 0;
69 else {
70 rc = -EACCES;
71 cFYI(1,("uids do not match"));
72 }
73 break;
74#ifdef CONFIG_CIFS_POSIX
64 case EXT2_IOC_GETFLAGS: 75 case EXT2_IOC_GETFLAGS:
65 if(CIFS_UNIX_EXTATTR_CAP & caps) { 76 if(CIFS_UNIX_EXTATTR_CAP & caps) {
77 if (pSMBFile == NULL)
78 goto cifs_ioctl_out;
66 rc = CIFSGetExtAttr(xid, tcon, pSMBFile->netfid, 79 rc = CIFSGetExtAttr(xid, tcon, pSMBFile->netfid,
67 &ExtAttrBits, &ExtAttrMask); 80 &ExtAttrBits, &ExtAttrMask);
68 if(rc == 0) 81 if(rc == 0)
@@ -78,17 +91,19 @@ int cifs_ioctl (struct inode * inode, struct file * filep,
78 rc = -EFAULT; 91 rc = -EFAULT;
79 goto cifs_ioctl_out; 92 goto cifs_ioctl_out;
80 } 93 }
81 /* rc = CIFSGetExtAttr(xid, tcon, pSMBFile->netfid, 94 if (pSMBFile == NULL)
95 goto cifs_ioctl_out;
96 /* rc= CIFSGetExtAttr(xid,tcon,pSMBFile->netfid,
82 extAttrBits, &ExtAttrMask);*/ 97 extAttrBits, &ExtAttrMask);*/
83 98
84 } 99 }
85 cFYI(1,("set flags not implemented yet")); 100 cFYI(1,("set flags not implemented yet"));
86 break; 101 break;
102#endif /* CONFIG_CIFS_POSIX */
87 default: 103 default:
88 cFYI(1,("unsupported ioctl")); 104 cFYI(1,("unsupported ioctl"));
89 return rc; 105 break;
90 } 106 }
91#endif /* CONFIG_CIFS_POSIX */
92 107
93cifs_ioctl_out: 108cifs_ioctl_out:
94 FreeXid(xid); 109 FreeXid(xid);