diff options
Diffstat (limited to 'fs/xfs/xfs_acl.c')
-rw-r--r-- | fs/xfs/xfs_acl.c | 55 |
1 files changed, 22 insertions, 33 deletions
diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c index 92fd1d67f878..cc9c91b9e771 100644 --- a/fs/xfs/xfs_acl.c +++ b/fs/xfs/xfs_acl.c | |||
@@ -1,49 +1,37 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2001-2002 Silicon Graphics, Inc. All Rights Reserved. | 2 | * Copyright (c) 2001-2002,2005 Silicon Graphics, Inc. |
3 | * All Rights Reserved. | ||
3 | * | 4 | * |
4 | * This program is free software; you can redistribute it and/or modify it | 5 | * This program is free software; you can redistribute it and/or |
5 | * under the terms of version 2 of the GNU General Public License as | 6 | * modify it under the terms of the GNU General Public License as |
6 | * published by the Free Software Foundation. | 7 | * published by the Free Software Foundation. |
7 | * | 8 | * |
8 | * This program is distributed in the hope that it would be useful, but | 9 | * This program is distributed in the hope that it would be useful, |
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | * GNU General Public License for more details. | ||
11 | * | 13 | * |
12 | * Further, this software is distributed without any warranty that it is | 14 | * You should have received a copy of the GNU General Public License |
13 | * free of the rightful claim of any third person regarding infringement | 15 | * along with this program; if not, write the Free Software Foundation, |
14 | * or the like. Any license provided herein, whether implied or | 16 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
15 | * otherwise, applies only to this software file. Patent licenses, if | ||
16 | * any, provided herein do not apply to combinations of this program with | ||
17 | * other software, or any other product whatsoever. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License along | ||
20 | * with this program; if not, write the Free Software Foundation, Inc., 59 | ||
21 | * Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
22 | * | ||
23 | * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, | ||
24 | * Mountain View, CA 94043, or: | ||
25 | * | ||
26 | * http://www.sgi.com | ||
27 | * | ||
28 | * For further information regarding this notice, see: | ||
29 | * | ||
30 | * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ | ||
31 | */ | 17 | */ |
32 | |||
33 | #include "xfs.h" | 18 | #include "xfs.h" |
34 | 19 | #include "xfs_fs.h" | |
20 | #include "xfs_types.h" | ||
21 | #include "xfs_bit.h" | ||
35 | #include "xfs_inum.h" | 22 | #include "xfs_inum.h" |
23 | #include "xfs_ag.h" | ||
36 | #include "xfs_dir.h" | 24 | #include "xfs_dir.h" |
37 | #include "xfs_dir2.h" | 25 | #include "xfs_dir2.h" |
38 | #include "xfs_alloc_btree.h" | ||
39 | #include "xfs_bmap_btree.h" | 26 | #include "xfs_bmap_btree.h" |
27 | #include "xfs_alloc_btree.h" | ||
40 | #include "xfs_ialloc_btree.h" | 28 | #include "xfs_ialloc_btree.h" |
41 | #include "xfs_btree.h" | ||
42 | #include "xfs_attr_sf.h" | ||
43 | #include "xfs_dir_sf.h" | 29 | #include "xfs_dir_sf.h" |
44 | #include "xfs_dir2_sf.h" | 30 | #include "xfs_dir2_sf.h" |
31 | #include "xfs_attr_sf.h" | ||
45 | #include "xfs_dinode.h" | 32 | #include "xfs_dinode.h" |
46 | #include "xfs_inode.h" | 33 | #include "xfs_inode.h" |
34 | #include "xfs_btree.h" | ||
47 | #include "xfs_acl.h" | 35 | #include "xfs_acl.h" |
48 | #include "xfs_mac.h" | 36 | #include "xfs_mac.h" |
49 | #include "xfs_attr.h" | 37 | #include "xfs_attr.h" |
@@ -155,7 +143,7 @@ posix_acl_xattr_to_xfs( | |||
155 | } | 143 | } |
156 | 144 | ||
157 | /* | 145 | /* |
158 | * Comparison function called from qsort(). | 146 | * Comparison function called from xfs_sort(). |
159 | * Primary key is ae_tag, secondary key is ae_id. | 147 | * Primary key is ae_tag, secondary key is ae_id. |
160 | */ | 148 | */ |
161 | STATIC int | 149 | STATIC int |
@@ -189,8 +177,8 @@ posix_acl_xfs_to_xattr( | |||
189 | return -ERANGE; | 177 | return -ERANGE; |
190 | 178 | ||
191 | /* Need to sort src XFS ACL by <ae_tag,ae_id> */ | 179 | /* Need to sort src XFS ACL by <ae_tag,ae_id> */ |
192 | qsort(src->acl_entry, src->acl_cnt, sizeof(src->acl_entry[0]), | 180 | xfs_sort(src->acl_entry, src->acl_cnt, sizeof(src->acl_entry[0]), |
193 | xfs_acl_entry_compare); | 181 | xfs_acl_entry_compare); |
194 | 182 | ||
195 | dest->a_version = cpu_to_le32(POSIX_ACL_XATTR_VERSION); | 183 | dest->a_version = cpu_to_le32(POSIX_ACL_XATTR_VERSION); |
196 | dest_entry = &dest->a_entries[0]; | 184 | dest_entry = &dest->a_entries[0]; |
@@ -448,6 +436,7 @@ xfs_acl_access( | |||
448 | int seen_userobj = 0; | 436 | int seen_userobj = 0; |
449 | 437 | ||
450 | matched.ae_tag = 0; /* Invalid type */ | 438 | matched.ae_tag = 0; /* Invalid type */ |
439 | matched.ae_perm = 0; | ||
451 | md >>= 6; /* Normalize the bits for comparison */ | 440 | md >>= 6; /* Normalize the bits for comparison */ |
452 | 441 | ||
453 | for (i = 0; i < fap->acl_cnt; i++) { | 442 | for (i = 0; i < fap->acl_cnt; i++) { |