diff options
Diffstat (limited to 'fs/xfs/xfs_attr.c')
-rw-r--r-- | fs/xfs/xfs_attr.c | 52 |
1 files changed, 29 insertions, 23 deletions
diff --git a/fs/xfs/xfs_attr.c b/fs/xfs/xfs_attr.c index e953b6cfb2a8..b9c196a53c42 100644 --- a/fs/xfs/xfs_attr.c +++ b/fs/xfs/xfs_attr.c | |||
@@ -93,12 +93,12 @@ STATIC int xfs_attr_rmtval_remove(xfs_da_args_t *args); | |||
93 | STATIC int | 93 | STATIC int |
94 | xfs_attr_name_to_xname( | 94 | xfs_attr_name_to_xname( |
95 | struct xfs_name *xname, | 95 | struct xfs_name *xname, |
96 | const char *aname) | 96 | const unsigned char *aname) |
97 | { | 97 | { |
98 | if (!aname) | 98 | if (!aname) |
99 | return EINVAL; | 99 | return EINVAL; |
100 | xname->name = aname; | 100 | xname->name = aname; |
101 | xname->len = strlen(aname); | 101 | xname->len = strlen((char *)aname); |
102 | if (xname->len >= MAXNAMELEN) | 102 | if (xname->len >= MAXNAMELEN) |
103 | return EFAULT; /* match IRIX behaviour */ | 103 | return EFAULT; /* match IRIX behaviour */ |
104 | 104 | ||
@@ -124,7 +124,7 @@ STATIC int | |||
124 | xfs_attr_get_int( | 124 | xfs_attr_get_int( |
125 | struct xfs_inode *ip, | 125 | struct xfs_inode *ip, |
126 | struct xfs_name *name, | 126 | struct xfs_name *name, |
127 | char *value, | 127 | unsigned char *value, |
128 | int *valuelenp, | 128 | int *valuelenp, |
129 | int flags) | 129 | int flags) |
130 | { | 130 | { |
@@ -171,8 +171,8 @@ xfs_attr_get_int( | |||
171 | int | 171 | int |
172 | xfs_attr_get( | 172 | xfs_attr_get( |
173 | xfs_inode_t *ip, | 173 | xfs_inode_t *ip, |
174 | const char *name, | 174 | const unsigned char *name, |
175 | char *value, | 175 | unsigned char *value, |
176 | int *valuelenp, | 176 | int *valuelenp, |
177 | int flags) | 177 | int flags) |
178 | { | 178 | { |
@@ -197,7 +197,7 @@ xfs_attr_get( | |||
197 | /* | 197 | /* |
198 | * Calculate how many blocks we need for the new attribute, | 198 | * Calculate how many blocks we need for the new attribute, |
199 | */ | 199 | */ |
200 | int | 200 | STATIC int |
201 | xfs_attr_calc_size( | 201 | xfs_attr_calc_size( |
202 | struct xfs_inode *ip, | 202 | struct xfs_inode *ip, |
203 | int namelen, | 203 | int namelen, |
@@ -235,8 +235,12 @@ xfs_attr_calc_size( | |||
235 | } | 235 | } |
236 | 236 | ||
237 | STATIC int | 237 | STATIC int |
238 | xfs_attr_set_int(xfs_inode_t *dp, struct xfs_name *name, | 238 | xfs_attr_set_int( |
239 | char *value, int valuelen, int flags) | 239 | struct xfs_inode *dp, |
240 | struct xfs_name *name, | ||
241 | unsigned char *value, | ||
242 | int valuelen, | ||
243 | int flags) | ||
240 | { | 244 | { |
241 | xfs_da_args_t args; | 245 | xfs_da_args_t args; |
242 | xfs_fsblock_t firstblock; | 246 | xfs_fsblock_t firstblock; |
@@ -452,8 +456,8 @@ out: | |||
452 | int | 456 | int |
453 | xfs_attr_set( | 457 | xfs_attr_set( |
454 | xfs_inode_t *dp, | 458 | xfs_inode_t *dp, |
455 | const char *name, | 459 | const unsigned char *name, |
456 | char *value, | 460 | unsigned char *value, |
457 | int valuelen, | 461 | int valuelen, |
458 | int flags) | 462 | int flags) |
459 | { | 463 | { |
@@ -600,7 +604,7 @@ out: | |||
600 | int | 604 | int |
601 | xfs_attr_remove( | 605 | xfs_attr_remove( |
602 | xfs_inode_t *dp, | 606 | xfs_inode_t *dp, |
603 | const char *name, | 607 | const unsigned char *name, |
604 | int flags) | 608 | int flags) |
605 | { | 609 | { |
606 | int error; | 610 | int error; |
@@ -669,9 +673,13 @@ xfs_attr_list_int(xfs_attr_list_context_t *context) | |||
669 | */ | 673 | */ |
670 | /*ARGSUSED*/ | 674 | /*ARGSUSED*/ |
671 | STATIC int | 675 | STATIC int |
672 | xfs_attr_put_listent(xfs_attr_list_context_t *context, int flags, | 676 | xfs_attr_put_listent( |
673 | char *name, int namelen, | 677 | xfs_attr_list_context_t *context, |
674 | int valuelen, char *value) | 678 | int flags, |
679 | unsigned char *name, | ||
680 | int namelen, | ||
681 | int valuelen, | ||
682 | unsigned char *value) | ||
675 | { | 683 | { |
676 | struct attrlist *alist = (struct attrlist *)context->alist; | 684 | struct attrlist *alist = (struct attrlist *)context->alist; |
677 | attrlist_ent_t *aep; | 685 | attrlist_ent_t *aep; |
@@ -1980,7 +1988,7 @@ xfs_attr_rmtval_get(xfs_da_args_t *args) | |||
1980 | xfs_bmbt_irec_t map[ATTR_RMTVALUE_MAPSIZE]; | 1988 | xfs_bmbt_irec_t map[ATTR_RMTVALUE_MAPSIZE]; |
1981 | xfs_mount_t *mp; | 1989 | xfs_mount_t *mp; |
1982 | xfs_daddr_t dblkno; | 1990 | xfs_daddr_t dblkno; |
1983 | xfs_caddr_t dst; | 1991 | void *dst; |
1984 | xfs_buf_t *bp; | 1992 | xfs_buf_t *bp; |
1985 | int nmap, error, tmp, valuelen, blkcnt, i; | 1993 | int nmap, error, tmp, valuelen, blkcnt, i; |
1986 | xfs_dablk_t lblkno; | 1994 | xfs_dablk_t lblkno; |
@@ -2007,15 +2015,14 @@ xfs_attr_rmtval_get(xfs_da_args_t *args) | |||
2007 | dblkno = XFS_FSB_TO_DADDR(mp, map[i].br_startblock); | 2015 | dblkno = XFS_FSB_TO_DADDR(mp, map[i].br_startblock); |
2008 | blkcnt = XFS_FSB_TO_BB(mp, map[i].br_blockcount); | 2016 | blkcnt = XFS_FSB_TO_BB(mp, map[i].br_blockcount); |
2009 | error = xfs_read_buf(mp, mp->m_ddev_targp, dblkno, | 2017 | error = xfs_read_buf(mp, mp->m_ddev_targp, dblkno, |
2010 | blkcnt, | 2018 | blkcnt, XBF_LOCK | XBF_DONT_BLOCK, |
2011 | XFS_BUF_LOCK | XBF_DONT_BLOCK, | ||
2012 | &bp); | 2019 | &bp); |
2013 | if (error) | 2020 | if (error) |
2014 | return(error); | 2021 | return(error); |
2015 | 2022 | ||
2016 | tmp = (valuelen < XFS_BUF_SIZE(bp)) | 2023 | tmp = (valuelen < XFS_BUF_SIZE(bp)) |
2017 | ? valuelen : XFS_BUF_SIZE(bp); | 2024 | ? valuelen : XFS_BUF_SIZE(bp); |
2018 | xfs_biomove(bp, 0, tmp, dst, XFS_B_READ); | 2025 | xfs_biomove(bp, 0, tmp, dst, XBF_READ); |
2019 | xfs_buf_relse(bp); | 2026 | xfs_buf_relse(bp); |
2020 | dst += tmp; | 2027 | dst += tmp; |
2021 | valuelen -= tmp; | 2028 | valuelen -= tmp; |
@@ -2039,7 +2046,7 @@ xfs_attr_rmtval_set(xfs_da_args_t *args) | |||
2039 | xfs_inode_t *dp; | 2046 | xfs_inode_t *dp; |
2040 | xfs_bmbt_irec_t map; | 2047 | xfs_bmbt_irec_t map; |
2041 | xfs_daddr_t dblkno; | 2048 | xfs_daddr_t dblkno; |
2042 | xfs_caddr_t src; | 2049 | void *src; |
2043 | xfs_buf_t *bp; | 2050 | xfs_buf_t *bp; |
2044 | xfs_dablk_t lblkno; | 2051 | xfs_dablk_t lblkno; |
2045 | int blkcnt, valuelen, nmap, error, tmp, committed; | 2052 | int blkcnt, valuelen, nmap, error, tmp, committed; |
@@ -2141,13 +2148,13 @@ xfs_attr_rmtval_set(xfs_da_args_t *args) | |||
2141 | blkcnt = XFS_FSB_TO_BB(mp, map.br_blockcount); | 2148 | blkcnt = XFS_FSB_TO_BB(mp, map.br_blockcount); |
2142 | 2149 | ||
2143 | bp = xfs_buf_get(mp->m_ddev_targp, dblkno, blkcnt, | 2150 | bp = xfs_buf_get(mp->m_ddev_targp, dblkno, blkcnt, |
2144 | XFS_BUF_LOCK | XBF_DONT_BLOCK); | 2151 | XBF_LOCK | XBF_DONT_BLOCK); |
2145 | ASSERT(bp); | 2152 | ASSERT(bp); |
2146 | ASSERT(!XFS_BUF_GETERROR(bp)); | 2153 | ASSERT(!XFS_BUF_GETERROR(bp)); |
2147 | 2154 | ||
2148 | tmp = (valuelen < XFS_BUF_SIZE(bp)) ? valuelen : | 2155 | tmp = (valuelen < XFS_BUF_SIZE(bp)) ? valuelen : |
2149 | XFS_BUF_SIZE(bp); | 2156 | XFS_BUF_SIZE(bp); |
2150 | xfs_biomove(bp, 0, tmp, src, XFS_B_WRITE); | 2157 | xfs_biomove(bp, 0, tmp, src, XBF_WRITE); |
2151 | if (tmp < XFS_BUF_SIZE(bp)) | 2158 | if (tmp < XFS_BUF_SIZE(bp)) |
2152 | xfs_biozero(bp, tmp, XFS_BUF_SIZE(bp) - tmp); | 2159 | xfs_biozero(bp, tmp, XFS_BUF_SIZE(bp) - tmp); |
2153 | if ((error = xfs_bwrite(mp, bp))) {/* GROT: NOTE: synchronous write */ | 2160 | if ((error = xfs_bwrite(mp, bp))) {/* GROT: NOTE: synchronous write */ |
@@ -2208,8 +2215,7 @@ xfs_attr_rmtval_remove(xfs_da_args_t *args) | |||
2208 | /* | 2215 | /* |
2209 | * If the "remote" value is in the cache, remove it. | 2216 | * If the "remote" value is in the cache, remove it. |
2210 | */ | 2217 | */ |
2211 | bp = xfs_incore(mp->m_ddev_targp, dblkno, blkcnt, | 2218 | bp = xfs_incore(mp->m_ddev_targp, dblkno, blkcnt, XBF_TRYLOCK); |
2212 | XFS_INCORE_TRYLOCK); | ||
2213 | if (bp) { | 2219 | if (bp) { |
2214 | XFS_BUF_STALE(bp); | 2220 | XFS_BUF_STALE(bp); |
2215 | XFS_BUF_UNDELAYWRITE(bp); | 2221 | XFS_BUF_UNDELAYWRITE(bp); |