[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 04/21: ext2fs: Use correct type for sizes.
From: |
Samuel Thibault |
Subject: |
[hurd] 04/21: ext2fs: Use correct type for sizes. |
Date: |
Sat, 04 Mar 2017 21:10:58 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 76266d8cd0db429093e144a67ef66a0a6532c799
Author: Justus Winter <address@hidden>
Date: Mon Oct 3 13:26:02 2016 +0200
ext2fs: Use correct type for sizes.
* ext2fs/ext2fs.h (ext2_{list,get,set}_xattr): Use 'size_t'.
* ext2fs/xattr.c (xattr_entry_{list,get,create): Use 'size_t' where
appropriate.
(ext2_{list,get,set}_xattr): Likewise.
---
ext2fs/ext2fs.h | 6 +++---
ext2fs/xattr.c | 38 +++++++++++++++++++-------------------
2 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/ext2fs/ext2fs.h b/ext2fs/ext2fs.h
index 76adf63..2ee97fd 100644
--- a/ext2fs/ext2fs.h
+++ b/ext2fs/ext2fs.h
@@ -582,9 +582,9 @@ extern void ext2_warning (const char *, ...)
/* ---------------------------------------------------------------- */
/* xattr.c */
-error_t ext2_list_xattr (struct node *np, char *buffer, int *len);
-error_t ext2_get_xattr (struct node *np, const char *name, char *value, int
*len);
-error_t ext2_set_xattr (struct node *np, const char *name, const char *value,
int len, int flags);
+error_t ext2_list_xattr (struct node *np, char *buffer, size_t *len);
+error_t ext2_get_xattr (struct node *np, const char *name, char *value, size_t
*len);
+error_t ext2_set_xattr (struct node *np, const char *name, const char *value,
size_t len, int flags);
error_t ext2_free_xattr_block (struct node *np);
#endif
diff --git a/ext2fs/xattr.c b/ext2fs/xattr.c
index 1e298dcb..4592d5e 100644
--- a/ext2fs/xattr.c
+++ b/ext2fs/xattr.c
@@ -156,11 +156,11 @@ xattr_entry_rehash (struct ext2_xattr_header *header,
* length is not enough for name, ERANGE is returned.
*/
static error_t
-xattr_entry_list (struct ext2_xattr_entry *entry, char *buffer, int *len)
+xattr_entry_list (struct ext2_xattr_entry *entry, char *buffer, size_t *len)
{
int i;
- int size;
+ size_t size;
for (i = 0; xattr_prefixes[i].prefix != NULL; i++)
{
@@ -209,7 +209,7 @@ xattr_entry_list (struct ext2_xattr_entry *entry, char
*buffer, int *len)
*/
static error_t
xattr_entry_get (char *block, struct ext2_xattr_entry *entry,
- const char *full_name, char *value, int *len, int *cmp)
+ const char *full_name, char *value, size_t *len, int *cmp)
{
int i;
@@ -261,15 +261,15 @@ xattr_entry_create (struct ext2_xattr_header *header,
struct ext2_xattr_entry *last,
struct ext2_xattr_entry *position,
const char *full_name, const char *value,
- int len, int rest)
+ size_t len, size_t rest)
{
int i;
- int name_len;
+ size_t name_len;
off_t start;
off_t end;
- int entry_size;
- int value_size;
+ size_t entry_size;
+ size_t value_size;
int index;
const char *name;
@@ -316,7 +316,7 @@ xattr_entry_create (struct ext2_xattr_header *header,
static error_t
xattr_entry_remove (struct ext2_xattr_header *header,
struct ext2_xattr_entry *last,
- struct ext2_xattr_entry *position, int rest)
+ struct ext2_xattr_entry *position, size_t rest)
{
size_t size;
@@ -366,11 +366,11 @@ static error_t
xattr_entry_replace (struct ext2_xattr_header *header,
struct ext2_xattr_entry *last,
struct ext2_xattr_entry *position,
- const char *value, int len, int rest)
+ const char *value, size_t len, size_t rest)
{
- ssize_t old_size;
- ssize_t new_size;
+ size_t old_size;
+ size_t new_size;
old_size = EXT2_XATTR_ALIGN (position->e_value_size);
new_size = EXT2_XATTR_ALIGN (len);
@@ -500,7 +500,7 @@ cleanup:
* xattr block is invalid (has no valid h_magic number).
*/
error_t
-ext2_list_xattr (struct node *np, char *buffer, int *len)
+ext2_list_xattr (struct node *np, char *buffer, size_t *len)
{
error_t err;
@@ -519,7 +519,7 @@ ext2_list_xattr (struct node *np, char *buffer, int *len)
if (!len)
return EINVAL;
- int size = *len;
+ size_t size = *len;
ei = dino_ref (np->cache_id);
blkno = ei->i_file_acl;
@@ -575,10 +575,10 @@ cleanup:
* in the block matching the name.
*/
error_t
-ext2_get_xattr (struct node *np, const char *name, char *value, int *len)
+ext2_get_xattr (struct node *np, const char *name, char *value, size_t *len)
{
- int size;
+ size_t size;
int err;
void *block;
struct ext2_inode *ei;
@@ -657,12 +657,12 @@ cleanup:
* the specified entry, free the xattr block.
*/
error_t
-ext2_set_xattr (struct node *np, const char *name, const char *value, int len,
- int flags)
+ext2_set_xattr (struct node *np, const char *name, const char *value,
+ size_t len, int flags)
{
int found;
- int rest;
+ size_t rest;
error_t err;
block_t blkno;
void *block;
@@ -732,7 +732,7 @@ ext2_set_xattr (struct node *np, const char *name, const
char *value, int len,
while (!EXT2_XATTR_ENTRY_LAST (entry))
{
- int size;
+ size_t size;
int cmp;
err = xattr_entry_get (NULL, entry, name, NULL, &size, &cmp);
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 15/21: Fix mig URL, (continued)
- [hurd] 15/21: Fix mig URL, Samuel Thibault, 2017/03/04
- [hurd] 19/21: boot: Fix failing device lookups in unprivileged mode., Samuel Thibault, 2017/03/04
- [hurd] 09/21: ext2fs: Fix potential block leak., Samuel Thibault, 2017/03/04
- [hurd] 14/21: Merge remote-tracking branch 'remotes/darnassus/ext2fs-xattrs', Samuel Thibault, 2017/03/04
- [hurd] 05/21: ext2fs: Fix block leak in xattr code., Samuel Thibault, 2017/03/04
- [hurd] 21/21: Avoid ports_interrupt_rpcs cancel itself, Samuel Thibault, 2017/03/04
- [hurd] 07/21: ext2fs: Require users to opt-in for xattr-based translator records., Samuel Thibault, 2017/03/04
- [hurd] 20/21: boot: Make the halt message nicer., Samuel Thibault, 2017/03/04
- [hurd] 13/21: ext2fs: downgrade warnings about old translator records to debug messages, Samuel Thibault, 2017/03/04
- [hurd] 18/21: boot: Add a verbose option., Samuel Thibault, 2017/03/04
- [hurd] 04/21: ext2fs: Use correct type for sizes.,
Samuel Thibault <=
- [hurd] 02/21: ext2fs: Use xattr to store passive translator, Samuel Thibault, 2017/03/04
- [hurd] 17/21: boot: Cleanup Makefile., Samuel Thibault, 2017/03/04
- [hurd] 01/21: ext2fs: Add support for xattr, Samuel Thibault, 2017/03/04