diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-08-08 01:25:50 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-08-08 02:28:06 +0200 |
commit | 3bc9a699ca7106204ffa97272374313bf04f6cc0 (patch) | |
tree | d4b83df84a6bb65a343f746b1f542df3ac64ae4b /libdiskfs | |
parent | e22f3a3170e5c3028dc83fbdfb0d8705fd00df75 (diff) | |
download | hurd-3bc9a699ca7106204ffa97272374313bf04f6cc0.tar.gz hurd-3bc9a699ca7106204ffa97272374313bf04f6cc0.tar.bz2 hurd-3bc9a699ca7106204ffa97272374313bf04f6cc0.zip |
Homogeneize [gs]et_translator and get_dire[nc]ts into mach_msg_type_number_t
This makes netfs_[gs]et_translator use mach_msg_type_number_t like
the RPC and diskfs. This also makes the fshelp_fetch_root_callback1_t
for fshelp_fetch_root use mach_msg_type_number_t.
This also makes procfs_get_translator and the get_translator proc method
use mach_msg_type_number_t.
This makes diskfs_get_directs use mach_msg_type_number_t like the
dir_readdir RPC
Also get rid of u_int.
This notably fixes _diskfs_translator_callback1_fn's bogus cast of
size_t *argz_len into (u_int *).
Diffstat (limited to 'libdiskfs')
-rw-r--r-- | libdiskfs/dir-readdir.c | 14 | ||||
-rw-r--r-- | libdiskfs/diskfs.h | 6 | ||||
-rw-r--r-- | libdiskfs/file-get-trans.c | 2 | ||||
-rw-r--r-- | libdiskfs/trans-callback.c | 4 |
4 files changed, 9 insertions, 17 deletions
diff --git a/libdiskfs/dir-readdir.c b/libdiskfs/dir-readdir.c index 82a9720f..a314e9d1 100644 --- a/libdiskfs/dir-readdir.c +++ b/libdiskfs/dir-readdir.c @@ -26,7 +26,7 @@ kern_return_t diskfs_S_dir_readdir (struct protid *cred, data_t *data, - mach_msg_type_number_t *datacnt, + mach_msg_type_number_t *datacnt, boolean_t *data_dealloc, int entry, int nentries, @@ -35,7 +35,6 @@ diskfs_S_dir_readdir (struct protid *cred, { error_t err; struct node *np; - size_t data_len = *datacnt; if (!cred) return EOPNOTSUPP; @@ -55,15 +54,8 @@ diskfs_S_dir_readdir (struct protid *cred, return ENOTDIR; } - err = diskfs_get_directs (np, entry, nentries, - data, &data_len, - bufsiz, amt); + err = diskfs_get_directs (np, entry, nentries, data, datacnt, bufsiz, amt); *data_dealloc = 1; /* XXX */ pthread_mutex_unlock (&np->lock); - - if (err) - return err; - - *datacnt = data_len; - return 0; + return err; } diff --git a/libdiskfs/diskfs.h b/libdiskfs/diskfs.h index c8c1ab51..9a6b56fa 100644 --- a/libdiskfs/diskfs.h +++ b/libdiskfs/diskfs.h @@ -401,20 +401,20 @@ error_t diskfs_drop_dirstat (struct node *dp, struct dirstat *ds); then there is no limit on *DATACNT; if N is -1, then there is no limit on AMT. */ error_t diskfs_get_directs (struct node *dp, int entry, int n, - char **data, size_t *datacnt, + char **data, mach_msg_type_number_t *datacnt, vm_size_t bufsiz, int *amt); /* The user must define this function. For locked node NP (for which diskfs_node_translated is true) look up the name of its translator. Store the name into newly malloced storage; set *NAMELEN to the total length. */ -error_t diskfs_get_translator (struct node *np, char **namep, u_int *namelen); +error_t diskfs_get_translator (struct node *np, char **namep, mach_msg_type_number_t *namelen); /* The user must define this function. For locked node NP, set the name of the translating program to be NAME, length NAMELEN. CRED identifies the user responsible for the call. */ error_t diskfs_set_translator (struct node *np, - const char *name, u_int namelen, + const char *name, mach_msg_type_number_t namelen, struct protid *cred); /* The user must define this function. Truncate locked node NP to be SIZE diff --git a/libdiskfs/file-get-trans.c b/libdiskfs/file-get-trans.c index 9cec73ae..b1ca6c00 100644 --- a/libdiskfs/file-get-trans.c +++ b/libdiskfs/file-get-trans.c @@ -119,7 +119,7 @@ diskfs_S_file_get_translator (struct protid *cred, else { char *string; - u_int len; + mach_msg_type_number_t len; err = diskfs_get_translator (np, &string, &len); if (!err) { diff --git a/libdiskfs/trans-callback.c b/libdiskfs/trans-callback.c index d08f91c6..19e99743 100644 --- a/libdiskfs/trans-callback.c +++ b/libdiskfs/trans-callback.c @@ -27,7 +27,7 @@ static error_t _diskfs_translator_callback1_fn (void *cookie1, void *cookie2, uid_t *uid, gid_t *gid, - char **argz, size_t *argz_len) + char **argz, mach_msg_type_number_t *argz_len) { error_t err; struct node *np = cookie1; @@ -35,7 +35,7 @@ _diskfs_translator_callback1_fn (void *cookie1, void *cookie2, if (! (np->dn_stat.st_mode & S_IPTRANS)) return ENOENT; - err = diskfs_get_translator (np, argz, (u_int *) argz_len); + err = diskfs_get_translator (np, argz, argz_len); if (err) { assert_backtrace (err != EOPNOTSUPP); |