diff options
author | Jeff Layton <jlayton@redhat.com> | 2012-11-25 08:00:36 -0500 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2012-12-05 14:13:10 -0500 |
commit | 852e22950dc47e774bb602b16f55fed42afac5fb (patch) | |
tree | 204bb2d69a3e408567d3ecc8cbdda70f208b8474 | |
parent | fc03d8a5a18172ebdb2402cc355abb8fd3cbb844 (diff) |
cifs: use the NUM_AUTHS and NUM_SUBAUTHS constants in cifsacl code
...instead of hardcoding in '5' and '6' all over the place.
Reviewed-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
-rw-r--r-- | fs/cifs/cifsacl.c | 6 | ||||
-rw-r--r-- | fs/cifs/cifsacl.h | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c index d35579a1640a..18437c5561fe 100644 --- a/fs/cifs/cifsacl.c +++ b/fs/cifs/cifsacl.c | |||
@@ -210,7 +210,7 @@ sid_to_str(struct cifs_sid *sidptr, char *sidstr) | |||
210 | sprintf(strptr, "-%d", sidptr->revision); | 210 | sprintf(strptr, "-%d", sidptr->revision); |
211 | strptr = sidstr + strlen(sidstr); | 211 | strptr = sidstr + strlen(sidstr); |
212 | 212 | ||
213 | for (i = 0; i < 6; ++i) { | 213 | for (i = 0; i < NUM_AUTHS; ++i) { |
214 | if (sidptr->authority[i]) { | 214 | if (sidptr->authority[i]) { |
215 | sprintf(strptr, "-%d", sidptr->authority[i]); | 215 | sprintf(strptr, "-%d", sidptr->authority[i]); |
216 | strptr = sidstr + strlen(sidstr); | 216 | strptr = sidstr + strlen(sidstr); |
@@ -649,7 +649,7 @@ int compare_sids(const struct cifs_sid *ctsid, const struct cifs_sid *cwsid) | |||
649 | } | 649 | } |
650 | 650 | ||
651 | /* compare all of the six auth values */ | 651 | /* compare all of the six auth values */ |
652 | for (i = 0; i < 6; ++i) { | 652 | for (i = 0; i < NUM_AUTHS; ++i) { |
653 | if (ctsid->authority[i] != cwsid->authority[i]) { | 653 | if (ctsid->authority[i] != cwsid->authority[i]) { |
654 | if (ctsid->authority[i] > cwsid->authority[i]) | 654 | if (ctsid->authority[i] > cwsid->authority[i]) |
655 | return 1; | 655 | return 1; |
@@ -811,7 +811,7 @@ static __u16 fill_ace_for_sid(struct cifs_ace *pntace, | |||
811 | 811 | ||
812 | pntace->sid.revision = psid->revision; | 812 | pntace->sid.revision = psid->revision; |
813 | pntace->sid.num_subauth = psid->num_subauth; | 813 | pntace->sid.num_subauth = psid->num_subauth; |
814 | for (i = 0; i < 6; i++) | 814 | for (i = 0; i < NUM_AUTHS; i++) |
815 | pntace->sid.authority[i] = psid->authority[i]; | 815 | pntace->sid.authority[i] = psid->authority[i]; |
816 | for (i = 0; i < psid->num_subauth; i++) | 816 | for (i = 0; i < psid->num_subauth; i++) |
817 | pntace->sid.sub_auth[i] = psid->sub_auth[i]; | 817 | pntace->sid.sub_auth[i] = psid->sub_auth[i]; |
diff --git a/fs/cifs/cifsacl.h b/fs/cifs/cifsacl.h index 5c902c7ce524..80e0d66a403d 100644 --- a/fs/cifs/cifsacl.h +++ b/fs/cifs/cifsacl.h | |||
@@ -60,8 +60,8 @@ struct cifs_ntsd { | |||
60 | struct cifs_sid { | 60 | struct cifs_sid { |
61 | __u8 revision; /* revision level */ | 61 | __u8 revision; /* revision level */ |
62 | __u8 num_subauth; | 62 | __u8 num_subauth; |
63 | __u8 authority[6]; | 63 | __u8 authority[NUM_AUTHS]; |
64 | __le32 sub_auth[5]; /* sub_auth[num_subauth] */ | 64 | __le32 sub_auth[NUM_SUBAUTHS]; /* sub_auth[num_subauth] */ |
65 | } __attribute__((packed)); | 65 | } __attribute__((packed)); |
66 | 66 | ||
67 | struct cifs_acl { | 67 | struct cifs_acl { |