diff options
Diffstat (limited to 'fs/cifs/xattr.c')
-rw-r--r-- | fs/cifs/xattr.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/fs/cifs/xattr.c b/fs/cifs/xattr.c index 3e2ef0de1209..a1509207bfa6 100644 --- a/fs/cifs/xattr.c +++ b/fs/cifs/xattr.c | |||
@@ -21,6 +21,7 @@ | |||
21 | 21 | ||
22 | #include <linux/fs.h> | 22 | #include <linux/fs.h> |
23 | #include <linux/posix_acl_xattr.h> | 23 | #include <linux/posix_acl_xattr.h> |
24 | #include <linux/slab.h> | ||
24 | #include "cifsfs.h" | 25 | #include "cifsfs.h" |
25 | #include "cifspdu.h" | 26 | #include "cifspdu.h" |
26 | #include "cifsglob.h" | 27 | #include "cifsglob.h" |
@@ -69,12 +70,12 @@ int cifs_removexattr(struct dentry *direntry, const char *ea_name) | |||
69 | return rc; | 70 | return rc; |
70 | } | 71 | } |
71 | if (ea_name == NULL) { | 72 | if (ea_name == NULL) { |
72 | cFYI(1, ("Null xattr names not supported")); | 73 | cFYI(1, "Null xattr names not supported"); |
73 | } else if (strncmp(ea_name, CIFS_XATTR_USER_PREFIX, 5) | 74 | } else if (strncmp(ea_name, CIFS_XATTR_USER_PREFIX, 5) |
74 | && (strncmp(ea_name, CIFS_XATTR_OS2_PREFIX, 4))) { | 75 | && (strncmp(ea_name, CIFS_XATTR_OS2_PREFIX, 4))) { |
75 | cFYI(1, | 76 | cFYI(1, |
76 | ("illegal xattr request %s (only user namespace supported)", | 77 | "illegal xattr request %s (only user namespace supported)", |
77 | ea_name)); | 78 | ea_name); |
78 | /* BB what if no namespace prefix? */ | 79 | /* BB what if no namespace prefix? */ |
79 | /* Should we just pass them to server, except for | 80 | /* Should we just pass them to server, except for |
80 | system and perhaps security prefixes? */ | 81 | system and perhaps security prefixes? */ |
@@ -130,19 +131,19 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name, | |||
130 | search server for EAs or streams to | 131 | search server for EAs or streams to |
131 | returns as xattrs */ | 132 | returns as xattrs */ |
132 | if (value_size > MAX_EA_VALUE_SIZE) { | 133 | if (value_size > MAX_EA_VALUE_SIZE) { |
133 | cFYI(1, ("size of EA value too large")); | 134 | cFYI(1, "size of EA value too large"); |
134 | kfree(full_path); | 135 | kfree(full_path); |
135 | FreeXid(xid); | 136 | FreeXid(xid); |
136 | return -EOPNOTSUPP; | 137 | return -EOPNOTSUPP; |
137 | } | 138 | } |
138 | 139 | ||
139 | if (ea_name == NULL) { | 140 | if (ea_name == NULL) { |
140 | cFYI(1, ("Null xattr names not supported")); | 141 | cFYI(1, "Null xattr names not supported"); |
141 | } else if (strncmp(ea_name, CIFS_XATTR_USER_PREFIX, 5) == 0) { | 142 | } else if (strncmp(ea_name, CIFS_XATTR_USER_PREFIX, 5) == 0) { |
142 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR) | 143 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR) |
143 | goto set_ea_exit; | 144 | goto set_ea_exit; |
144 | if (strncmp(ea_name, CIFS_XATTR_DOS_ATTRIB, 14) == 0) | 145 | if (strncmp(ea_name, CIFS_XATTR_DOS_ATTRIB, 14) == 0) |
145 | cFYI(1, ("attempt to set cifs inode metadata")); | 146 | cFYI(1, "attempt to set cifs inode metadata"); |
146 | 147 | ||
147 | ea_name += 5; /* skip past user. prefix */ | 148 | ea_name += 5; /* skip past user. prefix */ |
148 | rc = CIFSSMBSetEA(xid, pTcon, full_path, ea_name, ea_value, | 149 | rc = CIFSSMBSetEA(xid, pTcon, full_path, ea_name, ea_value, |
@@ -168,9 +169,9 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name, | |||
168 | ACL_TYPE_ACCESS, cifs_sb->local_nls, | 169 | ACL_TYPE_ACCESS, cifs_sb->local_nls, |
169 | cifs_sb->mnt_cifs_flags & | 170 | cifs_sb->mnt_cifs_flags & |
170 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 171 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
171 | cFYI(1, ("set POSIX ACL rc %d", rc)); | 172 | cFYI(1, "set POSIX ACL rc %d", rc); |
172 | #else | 173 | #else |
173 | cFYI(1, ("set POSIX ACL not supported")); | 174 | cFYI(1, "set POSIX ACL not supported"); |
174 | #endif | 175 | #endif |
175 | } else if (strncmp(ea_name, POSIX_ACL_XATTR_DEFAULT, | 176 | } else if (strncmp(ea_name, POSIX_ACL_XATTR_DEFAULT, |
176 | strlen(POSIX_ACL_XATTR_DEFAULT)) == 0) { | 177 | strlen(POSIX_ACL_XATTR_DEFAULT)) == 0) { |
@@ -181,13 +182,13 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name, | |||
181 | ACL_TYPE_DEFAULT, cifs_sb->local_nls, | 182 | ACL_TYPE_DEFAULT, cifs_sb->local_nls, |
182 | cifs_sb->mnt_cifs_flags & | 183 | cifs_sb->mnt_cifs_flags & |
183 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 184 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
184 | cFYI(1, ("set POSIX default ACL rc %d", rc)); | 185 | cFYI(1, "set POSIX default ACL rc %d", rc); |
185 | #else | 186 | #else |
186 | cFYI(1, ("set default POSIX ACL not supported")); | 187 | cFYI(1, "set default POSIX ACL not supported"); |
187 | #endif | 188 | #endif |
188 | } else { | 189 | } else { |
189 | cFYI(1, ("illegal xattr request %s (only user namespace" | 190 | cFYI(1, "illegal xattr request %s (only user namespace" |
190 | " supported)", ea_name)); | 191 | " supported)", ea_name); |
191 | /* BB what if no namespace prefix? */ | 192 | /* BB what if no namespace prefix? */ |
192 | /* Should we just pass them to server, except for | 193 | /* Should we just pass them to server, except for |
193 | system and perhaps security prefixes? */ | 194 | system and perhaps security prefixes? */ |
@@ -234,13 +235,13 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name, | |||
234 | /* return dos attributes as pseudo xattr */ | 235 | /* return dos attributes as pseudo xattr */ |
235 | /* return alt name if available as pseudo attr */ | 236 | /* return alt name if available as pseudo attr */ |
236 | if (ea_name == NULL) { | 237 | if (ea_name == NULL) { |
237 | cFYI(1, ("Null xattr names not supported")); | 238 | cFYI(1, "Null xattr names not supported"); |
238 | } else if (strncmp(ea_name, CIFS_XATTR_USER_PREFIX, 5) == 0) { | 239 | } else if (strncmp(ea_name, CIFS_XATTR_USER_PREFIX, 5) == 0) { |
239 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR) | 240 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR) |
240 | goto get_ea_exit; | 241 | goto get_ea_exit; |
241 | 242 | ||
242 | if (strncmp(ea_name, CIFS_XATTR_DOS_ATTRIB, 14) == 0) { | 243 | if (strncmp(ea_name, CIFS_XATTR_DOS_ATTRIB, 14) == 0) { |
243 | cFYI(1, ("attempt to query cifs inode metadata")); | 244 | cFYI(1, "attempt to query cifs inode metadata"); |
244 | /* revalidate/getattr then populate from inode */ | 245 | /* revalidate/getattr then populate from inode */ |
245 | } /* BB add else when above is implemented */ | 246 | } /* BB add else when above is implemented */ |
246 | ea_name += 5; /* skip past user. prefix */ | 247 | ea_name += 5; /* skip past user. prefix */ |
@@ -286,7 +287,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name, | |||
286 | } | 287 | } |
287 | #endif /* EXPERIMENTAL */ | 288 | #endif /* EXPERIMENTAL */ |
288 | #else | 289 | #else |
289 | cFYI(1, ("query POSIX ACL not supported yet")); | 290 | cFYI(1, "query POSIX ACL not supported yet"); |
290 | #endif /* CONFIG_CIFS_POSIX */ | 291 | #endif /* CONFIG_CIFS_POSIX */ |
291 | } else if (strncmp(ea_name, POSIX_ACL_XATTR_DEFAULT, | 292 | } else if (strncmp(ea_name, POSIX_ACL_XATTR_DEFAULT, |
292 | strlen(POSIX_ACL_XATTR_DEFAULT)) == 0) { | 293 | strlen(POSIX_ACL_XATTR_DEFAULT)) == 0) { |
@@ -298,18 +299,18 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name, | |||
298 | cifs_sb->mnt_cifs_flags & | 299 | cifs_sb->mnt_cifs_flags & |
299 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 300 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
300 | #else | 301 | #else |
301 | cFYI(1, ("query POSIX default ACL not supported yet")); | 302 | cFYI(1, "query POSIX default ACL not supported yet"); |
302 | #endif | 303 | #endif |
303 | } else if (strncmp(ea_name, | 304 | } else if (strncmp(ea_name, |
304 | CIFS_XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN) == 0) { | 305 | CIFS_XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN) == 0) { |
305 | cFYI(1, ("Trusted xattr namespace not supported yet")); | 306 | cFYI(1, "Trusted xattr namespace not supported yet"); |
306 | } else if (strncmp(ea_name, | 307 | } else if (strncmp(ea_name, |
307 | CIFS_XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN) == 0) { | 308 | CIFS_XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN) == 0) { |
308 | cFYI(1, ("Security xattr namespace not supported yet")); | 309 | cFYI(1, "Security xattr namespace not supported yet"); |
309 | } else | 310 | } else |
310 | cFYI(1, | 311 | cFYI(1, |
311 | ("illegal xattr request %s (only user namespace supported)", | 312 | "illegal xattr request %s (only user namespace supported)", |
312 | ea_name)); | 313 | ea_name); |
313 | 314 | ||
314 | /* We could add an additional check for streams ie | 315 | /* We could add an additional check for streams ie |
315 | if proc/fs/cifs/streamstoxattr is set then | 316 | if proc/fs/cifs/streamstoxattr is set then |