diff options
author | Pavel Shilovsky <pshilovsky@samba.org> | 2012-07-13 05:58:14 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2012-07-24 15:12:03 -0400 |
commit | 29e20f9c65fae245d6fd4fce31cc5d01cde3d93f (patch) | |
tree | 3e8410588672f7f0947c4c9bffd2455f855d0b02 /fs/cifs/cifsglob.h | |
parent | d60622eb5a23904facf4a4efac60f5bfa810d7d4 (diff) |
CIFS: Make CAP_* checks protocol independent
Since both CIFS and SMB2 use ses->capabilities (server->capabilities)
field but flags are different we should make such checks protocol
independent.
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/cifsglob.h')
-rw-r--r-- | fs/cifs/cifsglob.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 12b1176b87b0..bcdf4d4420f1 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h | |||
@@ -258,6 +258,9 @@ struct smb_version_values { | |||
258 | size_t max_header_size; | 258 | size_t max_header_size; |
259 | size_t read_rsp_size; | 259 | size_t read_rsp_size; |
260 | __le16 lock_cmd; | 260 | __le16 lock_cmd; |
261 | unsigned int cap_unix; | ||
262 | unsigned int cap_nt_find; | ||
263 | unsigned int cap_large_files; | ||
261 | }; | 264 | }; |
262 | 265 | ||
263 | #define HEADER_SIZE(server) (server->vals->header_size) | 266 | #define HEADER_SIZE(server) (server->vals->header_size) |
@@ -408,7 +411,7 @@ struct TCP_Server_Info { | |||
408 | unsigned int max_vcs; /* maximum number of smb sessions, at least | 411 | unsigned int max_vcs; /* maximum number of smb sessions, at least |
409 | those that can be specified uniquely with | 412 | those that can be specified uniquely with |
410 | vcnumbers */ | 413 | vcnumbers */ |
411 | int capabilities; /* allow selective disabling of caps by smb sess */ | 414 | unsigned int capabilities; /* selective disabling of caps by smb sess */ |
412 | int timeAdj; /* Adjust for difference in server time zone in sec */ | 415 | int timeAdj; /* Adjust for difference in server time zone in sec */ |
413 | __u64 CurrentMid; /* multiplex id - rotating counter */ | 416 | __u64 CurrentMid; /* multiplex id - rotating counter */ |
414 | char cryptkey[CIFS_CRYPTO_KEY_SIZE]; /* used by ntlm, ntlmv2 etc */ | 417 | char cryptkey[CIFS_CRYPTO_KEY_SIZE]; /* used by ntlm, ntlmv2 etc */ |
@@ -532,7 +535,7 @@ struct cifs_ses { | |||
532 | __u64 Suid; /* remote smb uid */ | 535 | __u64 Suid; /* remote smb uid */ |
533 | uid_t linux_uid; /* overriding owner of files on the mount */ | 536 | uid_t linux_uid; /* overriding owner of files on the mount */ |
534 | uid_t cred_uid; /* owner of credentials */ | 537 | uid_t cred_uid; /* owner of credentials */ |
535 | int capabilities; | 538 | unsigned int capabilities; |
536 | char serverName[SERVER_NAME_LEN_WITH_NULL * 2]; /* BB make bigger for | 539 | char serverName[SERVER_NAME_LEN_WITH_NULL * 2]; /* BB make bigger for |
537 | TCP names - will ipv6 and sctp addresses fit? */ | 540 | TCP names - will ipv6 and sctp addresses fit? */ |
538 | char *user_name; /* must not be null except during init of sess | 541 | char *user_name; /* must not be null except during init of sess |
@@ -554,6 +557,13 @@ struct cifs_ses { | |||
554 | which do not negotiate NTLM or POSIX dialects, but instead | 557 | which do not negotiate NTLM or POSIX dialects, but instead |
555 | negotiate one of the older LANMAN dialects */ | 558 | negotiate one of the older LANMAN dialects */ |
556 | #define CIFS_SES_LANMAN 8 | 559 | #define CIFS_SES_LANMAN 8 |
560 | |||
561 | static inline bool | ||
562 | cap_unix(struct cifs_ses *ses) | ||
563 | { | ||
564 | return ses->server->vals->cap_unix & ses->capabilities; | ||
565 | } | ||
566 | |||
557 | /* | 567 | /* |
558 | * there is one of these for each connection to a resource on a particular | 568 | * there is one of these for each connection to a resource on a particular |
559 | * session | 569 | * session |