diff options
author | Steve French <sfrench@us.ibm.com> | 2007-10-03 15:43:19 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2007-10-03 15:43:19 -0400 |
commit | d12fd121afd4f87cbc7675f8f6b651d649534f15 (patch) | |
tree | de6516024d6f0070ca5a96e004fdf9a3614ba9b6 | |
parent | d0d66c443aefa51d5dbdd6a1d9b135a2a0e469cc (diff) |
[CIFS] Cleanup formatting
Signed-off-by: Steve French <sfrench@us.ibm.com>
-rw-r--r-- | fs/cifs/cifsacl.c | 78 | ||||
-rw-r--r-- | fs/cifs/xattr.c | 19 |
2 files changed, 51 insertions, 46 deletions
diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c index 23bff0128e2a..52f9cb808fd0 100644 --- a/fs/cifs/cifsacl.c +++ b/fs/cifs/cifsacl.c | |||
@@ -30,12 +30,12 @@ | |||
30 | 30 | ||
31 | /* security id for everyone */ | 31 | /* security id for everyone */ |
32 | static const struct cifs_sid sid_everyone = | 32 | static const struct cifs_sid sid_everyone = |
33 | {1, 1, {0, 0, 0, 0, 0, 0}, {}}; | 33 | {1, 1, {0, 0, 0, 0, 0, 0}, {} }; |
34 | /* group users */ | 34 | /* group users */ |
35 | static const struct cifs_sid sid_user = | 35 | static const struct cifs_sid sid_user = |
36 | {1, 2 , {0, 0, 0, 0, 0, 5}, {}}; | 36 | {1, 2 , {0, 0, 0, 0, 0, 5}, {} }; |
37 | 37 | ||
38 | static void parse_ace(struct cifs_ace * pace, char * end_of_acl) | 38 | static void parse_ace(struct cifs_ace *pace, char *end_of_acl) |
39 | { | 39 | { |
40 | int i; | 40 | int i; |
41 | int num_subauth; | 41 | int num_subauth; |
@@ -50,27 +50,27 @@ static void parse_ace(struct cifs_ace * pace, char * end_of_acl) | |||
50 | num_subauth = cpu_to_le32(pace->num_subauth); | 50 | num_subauth = cpu_to_le32(pace->num_subauth); |
51 | if (num_subauth) { | 51 | if (num_subauth) { |
52 | psub_auth = (__u32 *)((char *)pace + sizeof(struct cifs_ace)); | 52 | psub_auth = (__u32 *)((char *)pace + sizeof(struct cifs_ace)); |
53 | #ifdef CONFIG_CIFS_DEBUG2 | 53 | #ifdef CONFIG_CIFS_DEBUG2 |
54 | cFYI(1, ("ACE revision %d num_subauth %d", | 54 | cFYI(1, ("ACE revision %d num_subauth %d", |
55 | pace->revision, pace->num_subauth)); | 55 | pace->revision, pace->num_subauth)); |
56 | for (i = 0; i < num_subauth; ++i) { | 56 | for (i = 0; i < num_subauth; ++i) { |
57 | cFYI(1, ("ACE sub_auth[%d]: 0x%x", i, | 57 | cFYI(1, ("ACE sub_auth[%d]: 0x%x", i, |
58 | le32_to_cpu(psub_auth[i]))); | 58 | le32_to_cpu(psub_auth[i]))); |
59 | } | 59 | } |
60 | 60 | ||
61 | /* BB add length check to make sure that we do not have huge | 61 | /* BB add length check to make sure that we do not have huge |
62 | num auths and therefore go off the end */ | 62 | num auths and therefore go off the end */ |
63 | 63 | ||
64 | cFYI(1, ("RID %d", le32_to_cpu(psub_auth[num_subauth-1]))); | 64 | cFYI(1, ("RID %d", le32_to_cpu(psub_auth[num_subauth-1]))); |
65 | #endif | 65 | #endif |
66 | } | 66 | } |
67 | 67 | ||
68 | return; | 68 | return; |
69 | } | 69 | } |
70 | 70 | ||
71 | static void parse_ntace(struct cifs_ntace * pntace, char * end_of_acl) | 71 | static void parse_ntace(struct cifs_ntace *pntace, char *end_of_acl) |
72 | { | 72 | { |
73 | /* validate that we do not go past end of acl */ | 73 | /* validate that we do not go past end of acl */ |
74 | if (end_of_acl < (char *)pntace + sizeof(struct cifs_ntace)) { | 74 | if (end_of_acl < (char *)pntace + sizeof(struct cifs_ntace)) { |
75 | cERROR(1, ("ACL too small to parse NT ACE")); | 75 | cERROR(1, ("ACL too small to parse NT ACE")); |
76 | return; | 76 | return; |
@@ -86,7 +86,7 @@ static void parse_ntace(struct cifs_ntace * pntace, char * end_of_acl) | |||
86 | 86 | ||
87 | 87 | ||
88 | 88 | ||
89 | static void parse_dacl(struct cifs_acl * pdacl, char * end_of_acl) | 89 | static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl) |
90 | { | 90 | { |
91 | int i; | 91 | int i; |
92 | int num_aces = 0; | 92 | int num_aces = 0; |
@@ -118,11 +118,11 @@ static void parse_dacl(struct cifs_acl * pdacl, char * end_of_acl) | |||
118 | ppace = kmalloc(num_aces * sizeof(struct cifs_ace *), | 118 | ppace = kmalloc(num_aces * sizeof(struct cifs_ace *), |
119 | GFP_KERNEL); | 119 | GFP_KERNEL); |
120 | 120 | ||
121 | /* cifscred->cecount = pdacl->num_aces; | 121 | /* cifscred->cecount = pdacl->num_aces; |
122 | cifscred->ntaces = kmalloc(num_aces * | 122 | cifscred->ntaces = kmalloc(num_aces * |
123 | sizeof(struct cifs_ntace *), GFP_KERNEL); | 123 | sizeof(struct cifs_ntace *), GFP_KERNEL); |
124 | cifscred->aces = kmalloc(num_aces * | 124 | cifscred->aces = kmalloc(num_aces * |
125 | sizeof(struct cifs_ace *), GFP_KERNEL);*/ | 125 | sizeof(struct cifs_ace *), GFP_KERNEL);*/ |
126 | 126 | ||
127 | 127 | ||
128 | for (i = 0; i < num_aces; ++i) { | 128 | for (i = 0; i < num_aces; ++i) { |
@@ -134,12 +134,12 @@ static void parse_dacl(struct cifs_acl * pdacl, char * end_of_acl) | |||
134 | parse_ntace(ppntace[i], end_of_acl); | 134 | parse_ntace(ppntace[i], end_of_acl); |
135 | parse_ace(ppace[i], end_of_acl); | 135 | parse_ace(ppace[i], end_of_acl); |
136 | 136 | ||
137 | /* memcpy((void *)(&(cifscred->ntaces[i])), | 137 | /* memcpy((void *)(&(cifscred->ntaces[i])), |
138 | (void *)ppntace[i], | 138 | (void *)ppntace[i], |
139 | sizeof(struct cifs_ntace)); | 139 | sizeof(struct cifs_ntace)); |
140 | memcpy((void *)(&(cifscred->aces[i])), | 140 | memcpy((void *)(&(cifscred->aces[i])), |
141 | (void *)ppace[i], | 141 | (void *)ppace[i], |
142 | sizeof(struct cifs_ace)); */ | 142 | sizeof(struct cifs_ace)); */ |
143 | 143 | ||
144 | acl_base = (char *)ppntace[i]; | 144 | acl_base = (char *)ppntace[i]; |
145 | acl_size = cpu_to_le32(ppntace[i]->size); | 145 | acl_size = cpu_to_le32(ppntace[i]->size); |
@@ -176,12 +176,12 @@ static int parse_sid(struct cifs_sid *psid, char *end_of_acl) | |||
176 | 176 | ||
177 | for (i = 0; i < num_subauth; ++i) { | 177 | for (i = 0; i < num_subauth; ++i) { |
178 | cFYI(1, ("SID sub_auth[%d]: 0x%x ", i, | 178 | cFYI(1, ("SID sub_auth[%d]: 0x%x ", i, |
179 | le32_to_cpu(psub_auth[i]))); | 179 | le32_to_cpu(psub_auth[i]))); |
180 | } | 180 | } |
181 | 181 | ||
182 | /* BB add length check to make sure that we do not have huge | 182 | /* BB add length check to make sure that we do not have huge |
183 | num auths and therefore go off the end */ | 183 | num auths and therefore go off the end */ |
184 | cFYI(1, ("RID 0x%x", | 184 | cFYI(1, ("RID 0x%x", |
185 | le32_to_cpu(psid->sub_auth[psid->num_subauth]))); | 185 | le32_to_cpu(psid->sub_auth[psid->num_subauth]))); |
186 | #endif | 186 | #endif |
187 | } | 187 | } |
diff --git a/fs/cifs/xattr.c b/fs/cifs/xattr.c index f61e433d281c..369e838bebd3 100644 --- a/fs/cifs/xattr.c +++ b/fs/cifs/xattr.c | |||
@@ -261,21 +261,26 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name, | |||
261 | cifs_sb->local_nls, | 261 | cifs_sb->local_nls, |
262 | cifs_sb->mnt_cifs_flags & | 262 | cifs_sb->mnt_cifs_flags & |
263 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 263 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
264 | /* else if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { | 264 | #ifdef CONFIG_CIFS_EXPERIMENTAL |
265 | else if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { | ||
265 | __u16 fid; | 266 | __u16 fid; |
266 | int oplock = FALSE; | 267 | int oplock = FALSE; |
267 | rc = CIFSSMBOpen(xid, pTcon, full_path, | 268 | if (experimEnabled) |
268 | FILE_OPEN, GENERIC_READ, 0, &fid, | 269 | rc = CIFSSMBOpen(xid, pTcon, full_path, |
269 | &oplock, NULL, cifs_sb->local_nls, | 270 | FILE_OPEN, GENERIC_READ, 0, &fid, |
270 | cifs_sb->mnt_cifs_flags & | 271 | &oplock, NULL, cifs_sb->local_nls, |
271 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 272 | cifs_sb->mnt_cifs_flags & |
273 | CIFS_MOUNT_MAP_SPECIAL_CHR); | ||
274 | /* else rc is EOPNOTSUPP from above */ | ||
275 | |||
272 | if(rc == 0) { | 276 | if(rc == 0) { |
273 | rc = CIFSSMBGetCIFSACL(xid, pTcon, fid, | 277 | rc = CIFSSMBGetCIFSACL(xid, pTcon, fid, |
274 | ea_value, buf_size, | 278 | ea_value, buf_size, |
275 | ACL_TYPE_ACCESS); | 279 | ACL_TYPE_ACCESS); |
276 | CIFSSMBClose(xid, pTcon, fid); | 280 | CIFSSMBClose(xid, pTcon, fid); |
277 | } | 281 | } |
278 | } */ /* BB enable after fixing up return data */ | 282 | } |
283 | #endif /* EXPERIMENTAL */ | ||
279 | #else | 284 | #else |
280 | cFYI(1, ("query POSIX ACL not supported yet")); | 285 | cFYI(1, ("query POSIX ACL not supported yet")); |
281 | #endif /* CONFIG_CIFS_POSIX */ | 286 | #endif /* CONFIG_CIFS_POSIX */ |