diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
commit | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch) | |
tree | a8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /fs/cifs/ioctl.c | |
parent | 406089d01562f1e2bf9f089fd7637009ebaad589 (diff) |
Patched in Tegra support.
Diffstat (limited to 'fs/cifs/ioctl.c')
-rw-r--r-- | fs/cifs/ioctl.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/fs/cifs/ioctl.c b/fs/cifs/ioctl.c index fd5009d56f9..4221b5e48a4 100644 --- a/fs/cifs/ioctl.c +++ b/fs/cifs/ioctl.c | |||
@@ -28,11 +28,13 @@ | |||
28 | #include "cifs_debug.h" | 28 | #include "cifs_debug.h" |
29 | #include "cifsfs.h" | 29 | #include "cifsfs.h" |
30 | 30 | ||
31 | #define CIFS_IOC_CHECKUMOUNT _IO(0xCF, 2) | ||
32 | |||
31 | long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) | 33 | long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) |
32 | { | 34 | { |
33 | struct inode *inode = filep->f_dentry->d_inode; | 35 | struct inode *inode = filep->f_dentry->d_inode; |
34 | int rc = -ENOTTY; /* strange error - but the precedent */ | 36 | int rc = -ENOTTY; /* strange error - but the precedent */ |
35 | unsigned int xid; | 37 | int xid; |
36 | struct cifs_sb_info *cifs_sb; | 38 | struct cifs_sb_info *cifs_sb; |
37 | #ifdef CONFIG_CIFS_POSIX | 39 | #ifdef CONFIG_CIFS_POSIX |
38 | struct cifsFileInfo *pSMBFile = filep->private_data; | 40 | struct cifsFileInfo *pSMBFile = filep->private_data; |
@@ -42,13 +44,22 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) | |||
42 | __u64 caps; | 44 | __u64 caps; |
43 | #endif /* CONFIG_CIFS_POSIX */ | 45 | #endif /* CONFIG_CIFS_POSIX */ |
44 | 46 | ||
45 | xid = get_xid(); | 47 | xid = GetXid(); |
46 | 48 | ||
47 | cFYI(1, "ioctl file %p cmd %u arg %lu", filep, command, arg); | 49 | cFYI(1, "ioctl file %p cmd %u arg %lu", filep, command, arg); |
48 | 50 | ||
49 | cifs_sb = CIFS_SB(inode->i_sb); | 51 | cifs_sb = CIFS_SB(inode->i_sb); |
50 | 52 | ||
51 | switch (command) { | 53 | switch (command) { |
54 | case CIFS_IOC_CHECKUMOUNT: | ||
55 | cFYI(1, "User unmount attempted"); | ||
56 | if (cifs_sb->mnt_uid == current_uid()) | ||
57 | rc = 0; | ||
58 | else { | ||
59 | rc = -EACCES; | ||
60 | cFYI(1, "uids do not match"); | ||
61 | } | ||
62 | break; | ||
52 | #ifdef CONFIG_CIFS_POSIX | 63 | #ifdef CONFIG_CIFS_POSIX |
53 | case FS_IOC_GETFLAGS: | 64 | case FS_IOC_GETFLAGS: |
54 | if (pSMBFile == NULL) | 65 | if (pSMBFile == NULL) |
@@ -56,9 +67,8 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) | |||
56 | tcon = tlink_tcon(pSMBFile->tlink); | 67 | tcon = tlink_tcon(pSMBFile->tlink); |
57 | caps = le64_to_cpu(tcon->fsUnixInfo.Capability); | 68 | caps = le64_to_cpu(tcon->fsUnixInfo.Capability); |
58 | if (CIFS_UNIX_EXTATTR_CAP & caps) { | 69 | if (CIFS_UNIX_EXTATTR_CAP & caps) { |
59 | rc = CIFSGetExtAttr(xid, tcon, | 70 | rc = CIFSGetExtAttr(xid, tcon, pSMBFile->netfid, |
60 | pSMBFile->fid.netfid, | 71 | &ExtAttrBits, &ExtAttrMask); |
61 | &ExtAttrBits, &ExtAttrMask); | ||
62 | if (rc == 0) | 72 | if (rc == 0) |
63 | rc = put_user(ExtAttrBits & | 73 | rc = put_user(ExtAttrBits & |
64 | FS_FL_USER_VISIBLE, | 74 | FS_FL_USER_VISIBLE, |
@@ -76,12 +86,8 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) | |||
76 | rc = -EFAULT; | 86 | rc = -EFAULT; |
77 | break; | 87 | break; |
78 | } | 88 | } |
79 | /* | 89 | /* rc= CIFSGetExtAttr(xid,tcon,pSMBFile->netfid, |
80 | * rc = CIFSGetExtAttr(xid, tcon, | 90 | extAttrBits, &ExtAttrMask);*/ |
81 | * pSMBFile->fid.netfid, | ||
82 | * extAttrBits, | ||
83 | * &ExtAttrMask); | ||
84 | */ | ||
85 | } | 91 | } |
86 | cFYI(1, "set flags not implemented yet"); | 92 | cFYI(1, "set flags not implemented yet"); |
87 | break; | 93 | break; |
@@ -91,6 +97,6 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) | |||
91 | break; | 97 | break; |
92 | } | 98 | } |
93 | 99 | ||
94 | free_xid(xid); | 100 | FreeXid(xid); |
95 | return rc; | 101 | return rc; |
96 | } | 102 | } |