From 688fcc14db676e72409967e5db05ba9055083891 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 20 Apr 2012 14:37:18 +0200 Subject: score: Fix comment --- cpukit/rtems/src/eventseize.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpukit/rtems/src/eventseize.c b/cpukit/rtems/src/eventseize.c index 54820c7ed5..a65ce19712 100644 --- a/cpukit/rtems/src/eventseize.c +++ b/cpukit/rtems/src/eventseize.c @@ -126,7 +126,8 @@ void _Event_Seize( * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * - * WARNING! Returning with interrupts disabled! + * WARNING! Entering with interrupts disabled and returning with interrupts + * enabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); } -- cgit v1.2.3 From 37f938d7083d43891261abf8a5b6f13ee6f80c1b Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 20 Apr 2012 15:23:44 +0200 Subject: bsps: Avoid rtems_irq_hdl_param type usage Not every clock interrupt service routine is installed with this API. Remove also the prototype to allow drivers to make this routine static. --- c/src/lib/libbsp/shared/clockdrv_shell.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/c/src/lib/libbsp/shared/clockdrv_shell.h b/c/src/lib/libbsp/shared/clockdrv_shell.h index 35b5f8d156..2afd3b2375 100644 --- a/c/src/lib/libbsp/shared/clockdrv_shell.h +++ b/c/src/lib/libbsp/shared/clockdrv_shell.h @@ -57,8 +57,7 @@ void Clock_exit( void ); * Return values: NONE */ #ifdef BSP_FEATURE_IRQ_EXTENSION -void Clock_isr(rtems_irq_hdl_param arg); -void Clock_isr(rtems_irq_hdl_param arg) +void Clock_isr(void *arg) { #else rtems_isr Clock_isr(rtems_vector_number vector); -- cgit v1.2.3 From d2c665b7f2ae62651b136d3341eaa01739f4c2d5 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 20 Apr 2012 15:29:00 +0200 Subject: bsps/arm: Make the Clock_isr() static again --- c/src/lib/libbsp/arm/shared/armv7m/clock/armv7m-clock-config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/src/lib/libbsp/arm/shared/armv7m/clock/armv7m-clock-config.c b/c/src/lib/libbsp/arm/shared/armv7m/clock/armv7m-clock-config.c index 2e1611a85f..5ac709d10b 100644 --- a/c/src/lib/libbsp/arm/shared/armv7m/clock/armv7m-clock-config.c +++ b/c/src/lib/libbsp/arm/shared/armv7m/clock/armv7m-clock-config.c @@ -20,7 +20,7 @@ #ifdef ARM_MULTILIB_ARCH_V7M /* This is defined in clockdrv_shell.h */ -void Clock_isr(rtems_irq_hdl_param arg); +static void Clock_isr(void *arg); #define _ARMV7M_Systick_get_factor(freq) \ ((1000000000ULL << 32) / (freq)) -- cgit v1.2.3 From 4012792168fd4c01de00d3b3ab4f4fa0379f08c9 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 20 Apr 2012 15:31:00 +0200 Subject: score: Documentation --- cpukit/score/include/rtems/score/thread.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h index b43d56a131..4fa361a0df 100644 --- a/cpukit/score/include/rtems/score/thread.h +++ b/cpukit/score/include/rtems/score/thread.h @@ -776,6 +776,9 @@ Thread_Control *_Thread_Get ( * satisfied from an ISR while the thread executing was in the * process of blocking. * + * This method will restore the previous ISR disable level during the cancel + * operation. Thus it is an implicit _ISR_Enable(). + * * @param[in] sync_state is the synchronization state * @param[in] the_thread is the thread whose blocking is canceled * @param[in] level is the previous ISR disable level -- cgit v1.2.3 From fb78f9170f71170a6b2ca3c78bb54ed3c5f6b1ed Mon Sep 17 00:00:00 2001 From: Gedare Bloom Date: Mon, 23 Apr 2012 09:10:04 -0400 Subject: PR1908: consolidate libqos code and fix installed header location --- cpukit/Makefile.am | 4 +- cpukit/configure.ac | 1 - cpukit/libqos/Makefile.am | 12 -- cpukit/libqos/preinstall.am | 28 ----- cpukit/libqos/qreslib.h | 189 +++++++++++++++++++++++++++++- cpukit/libqos/qreslib.inl | 214 ---------------------------------- cpukit/preinstall.am | 4 + testsuites/sptests/spqreslib/system.h | 2 +- 8 files changed, 196 insertions(+), 258 deletions(-) delete mode 100644 cpukit/libqos/Makefile.am delete mode 100644 cpukit/libqos/preinstall.am delete mode 100644 cpukit/libqos/qreslib.inl diff --git a/cpukit/Makefile.am b/cpukit/Makefile.am index 765716627a..542d512153 100644 --- a/cpukit/Makefile.am +++ b/cpukit/Makefile.am @@ -15,7 +15,6 @@ SUBDIRS += libi2c SUBDIRS += libmisc SUBDIRS += libmd SUBDIRS += libgnat -SUBDIRS += libqos SUBDIRS += wrapup SUBDIRS += zlib @@ -166,6 +165,9 @@ include_rtems_HEADERS += libmisc/fb/mw_uid.h include_rtems_HEADERS += libmisc/mouse/mouse_parser.h include_rtems_HEADERS += libmisc/mouse/serial_mouse.h +## libqos +include_rtems_HEADERS += libqos/qreslib.h + ## shell if LIBSHELL include_rtems_HEADERS += libmisc/shell/shell.h diff --git a/cpukit/configure.ac b/cpukit/configure.ac index 1066e41fdd..7c5c731361 100644 --- a/cpukit/configure.ac +++ b/cpukit/configure.ac @@ -380,7 +380,6 @@ librpc/Makefile libmisc/Makefile libi2c/Makefile libmd/Makefile -libqos/Makefile zlib/Makefile ftpd/Makefile telnetd/Makefile diff --git a/cpukit/libqos/Makefile.am b/cpukit/libqos/Makefile.am deleted file mode 100644 index 3223dcddd2..0000000000 --- a/cpukit/libqos/Makefile.am +++ /dev/null @@ -1,12 +0,0 @@ -## -## $Id$ -## - -include $(top_srcdir)/automake/multilib.am -include $(top_srcdir)/automake/compile.am - -include_HEADERS = qreslib.h -include_HEADERS += qreslib.inl - -include $(srcdir)/preinstall.am -include $(top_srcdir)/automake/local.am diff --git a/cpukit/libqos/preinstall.am b/cpukit/libqos/preinstall.am deleted file mode 100644 index 9b48932f2c..0000000000 --- a/cpukit/libqos/preinstall.am +++ /dev/null @@ -1,28 +0,0 @@ -## Automatically generated by ampolish3 - Do not edit - -if AMPOLISH3 -$(srcdir)/preinstall.am: Makefile.am - $(AMPOLISH3) $(srcdir)/Makefile.am > $(srcdir)/preinstall.am -endif - -PREINSTALL_DIRS = -DISTCLEANFILES = $(PREINSTALL_DIRS) - -all-am: $(PREINSTALL_FILES) - -PREINSTALL_FILES = -CLEANFILES = $(PREINSTALL_FILES) - -$(PROJECT_INCLUDE)/$(dirstamp): - @$(MKDIR_P) $(PROJECT_INCLUDE) - @: > $(PROJECT_INCLUDE)/$(dirstamp) -PREINSTALL_DIRS += $(PROJECT_INCLUDE)/$(dirstamp) - -$(PROJECT_INCLUDE)/qreslib.h: qreslib.h $(PROJECT_INCLUDE)/$(dirstamp) - $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/qreslib.h -PREINSTALL_FILES += $(PROJECT_INCLUDE)/qreslib.h - -$(PROJECT_INCLUDE)/qreslib.inl: qreslib.inl $(PROJECT_INCLUDE)/$(dirstamp) - $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/qreslib.inl -PREINSTALL_FILES += $(PROJECT_INCLUDE)/qreslib.inl - diff --git a/cpukit/libqos/qreslib.h b/cpukit/libqos/qreslib.h index 22bbd3ee62..59bbbc3a96 100644 --- a/cpukit/libqos/qreslib.h +++ b/cpukit/libqos/qreslib.h @@ -71,7 +71,194 @@ typedef struct { uint32_t Q; } qres_params_t; -#include +/** + * @brief qres init + * + * Initializes the QoS RES library. + * + * @return status code. + */ +RTEMS_INLINE_ROUTINE qos_rv qres_init ( void ) +{ + return _Scheduler_CBS_Initialize(); +} + +/** + * @brief qres cleanup + * + * Cleanup resources associated to the QoS RES Library. + * + * @return status code. + */ +RTEMS_INLINE_ROUTINE qos_rv qres_cleanup ( void ) +{ + return _Scheduler_CBS_Cleanup(); +} + +/** + * @brief qres create server + * + * Create a new server with specified parameters. + * + * @return status code. + */ +RTEMS_INLINE_ROUTINE qos_rv qres_create_server ( + qres_params_t *params, + qres_sid_t *server_id +) +{ + return _Scheduler_CBS_Create_server( + (Scheduler_CBS_Parameters *) params, + NULL, + server_id + ); +} + +/** + * @brief qres attach thread + * + * Attach a task to an already existing server. + * + * @return status code. + */ +RTEMS_INLINE_ROUTINE qos_rv qres_attach_thread ( + qres_sid_t server_id, + pid_t pid, + tid_t task_id +) +{ + return _Scheduler_CBS_Attach_thread( server_id, task_id ); +} + +/** + * @brief qres detach thread + * + * Detach from the QoS Server. + * + * @return status code. + */ +RTEMS_INLINE_ROUTINE qos_rv qres_detach_thread ( + qres_sid_t server_id, + pid_t pid, + tid_t task_id +) +{ + return _Scheduler_CBS_Detach_thread( server_id, task_id ); +} + +/** + * @brief qres destroy server + * + * Detach all tasks from a server and destroy it. + * + * @return status code. + */ +RTEMS_INLINE_ROUTINE qos_rv qres_destroy_server ( + qres_sid_t server_id +) +{ + return _Scheduler_CBS_Destroy_server( server_id ); +} + +/** + * @brief qres get server id + * + * Get a thread server id, or QOS_E_NOT_FOUND if it is not + * attached to any server. + * + * @return status code. + */ +RTEMS_INLINE_ROUTINE qos_rv qres_get_sid ( + pid_t pid, + tid_t task_id, + qres_sid_t *server_id +) +{ + return _Scheduler_CBS_Get_server_id( task_id, server_id ); +} + +/** + * @brief qres get params + * + * Retrieve QoS scheduling parameters. + * + * @return status code. + */ +RTEMS_INLINE_ROUTINE qos_rv qres_get_params ( + qres_sid_t server_id, + qres_params_t *params +) +{ + return _Scheduler_CBS_Get_parameters( + server_id, + (Scheduler_CBS_Parameters *) params + ); +} + +/** + * @brief qres set params + * + * Change QoS scheduling parameters. + * + * @return status code. + */ +RTEMS_INLINE_ROUTINE qos_rv qres_set_params ( + qres_sid_t server_id, + qres_params_t *params +) +{ + return _Scheduler_CBS_Set_parameters( + server_id, + (Scheduler_CBS_Parameters *) params + ); +} + +/** + * @brief qres get execution time + * + * Retrieve time info relative to the current server. + * + * @return status code. + */ +RTEMS_INLINE_ROUTINE qos_rv qres_get_exec_time ( + qres_sid_t server_id, + qres_time_t *exec_time, + qres_atime_t *abs_time +) +{ + return _Scheduler_CBS_Get_execution_time( server_id, exec_time, abs_time ); +} + +/** + * @brief qres get current budget + * + * Retrieve remaining budget for the current server instance. + * + * @return status code. + */ +RTEMS_INLINE_ROUTINE qos_rv qres_get_curr_budget ( + qres_sid_t server_id, + qres_time_t *current_budget +) +{ + return _Scheduler_CBS_Get_remaining_budget( server_id, current_budget ); +} + +/** + * @brief qres get approved budget + * + * Retrieve the budget that has been approved for the subsequent + * server instances. + * + * @return status code. + */ +RTEMS_INLINE_ROUTINE qos_rv qres_get_appr_budget ( + qres_sid_t server_id, + qres_time_t *appr_budget +) +{ + return _Scheduler_CBS_Get_approved_budget( server_id, appr_budget ); +} #ifdef __cplusplus } diff --git a/cpukit/libqos/qreslib.inl b/cpukit/libqos/qreslib.inl deleted file mode 100644 index 094d1e6cdd..0000000000 --- a/cpukit/libqos/qreslib.inl +++ /dev/null @@ -1,214 +0,0 @@ -/** - * @file qreslib.inl - * - * This include file contains all the constants and structures associated - * with the QoS RES library. - * - * @note The library is available only together with CBS scheduler. - */ - -/* - * Copyright (C) 2011 Petr Benes. - * Copyright (C) 2011 On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.com/license/LICENSE. - * - * $Id$ - */ - -#ifndef _QRESLIB_H -# error "Never use directly; include instead." -#endif - -#include - -/** - * @brief qres init - * - * Initializes the QoS RES library. - * - * @return status code. - */ -RTEMS_INLINE_ROUTINE qos_rv qres_init ( void ) -{ - return _Scheduler_CBS_Initialize(); -} - -/** - * @brief qres cleanup - * - * Cleanup resources associated to the QoS RES Library. - * - * @return status code. - */ -RTEMS_INLINE_ROUTINE qos_rv qres_cleanup ( void ) -{ - return _Scheduler_CBS_Cleanup(); -} - -/** - * @brief qres create server - * - * Create a new server with specified parameters. - * - * @return status code. - */ -RTEMS_INLINE_ROUTINE qos_rv qres_create_server ( - qres_params_t *params, - qres_sid_t *server_id -) -{ - return _Scheduler_CBS_Create_server( - (Scheduler_CBS_Parameters *) params, - NULL, - server_id - ); -} - -/** - * @brief qres attach thread - * - * Attach a task to an already existing server. - * - * @return status code. - */ -RTEMS_INLINE_ROUTINE qos_rv qres_attach_thread ( - qres_sid_t server_id, - pid_t pid, - tid_t task_id -) -{ - return _Scheduler_CBS_Attach_thread( server_id, task_id ); -} - -/** - * @brief qres detach thread - * - * Detach from the QoS Server. - * - * @return status code. - */ -RTEMS_INLINE_ROUTINE qos_rv qres_detach_thread ( - qres_sid_t server_id, - pid_t pid, - tid_t task_id -) -{ - return _Scheduler_CBS_Detach_thread( server_id, task_id ); -} - -/** - * @brief qres destroy server - * - * Detach all tasks from a server and destroy it. - * - * @return status code. - */ -RTEMS_INLINE_ROUTINE qos_rv qres_destroy_server ( - qres_sid_t server_id -) -{ - return _Scheduler_CBS_Destroy_server( server_id ); -} - -/** - * @brief qres get server id - * - * Get a thread server id, or QOS_E_NOT_FOUND if it is not - * attached to any server. - * - * @return status code. - */ -RTEMS_INLINE_ROUTINE qos_rv qres_get_sid ( - pid_t pid, - tid_t task_id, - qres_sid_t *server_id -) -{ - return _Scheduler_CBS_Get_server_id( task_id, server_id ); -} - -/** - * @brief qres get params - * - * Retrieve QoS scheduling parameters. - * - * @return status code. - */ -RTEMS_INLINE_ROUTINE qos_rv qres_get_params ( - qres_sid_t server_id, - qres_params_t *params -) -{ - return _Scheduler_CBS_Get_parameters( - server_id, - (Scheduler_CBS_Parameters *) params - ); -} - -/** - * @brief qres set params - * - * Change QoS scheduling parameters. - * - * @return status code. - */ -RTEMS_INLINE_ROUTINE qos_rv qres_set_params ( - qres_sid_t server_id, - qres_params_t *params -) -{ - return _Scheduler_CBS_Set_parameters( - server_id, - (Scheduler_CBS_Parameters *) params - ); -} - -/** - * @brief qres get execution time - * - * Retrieve time info relative to the current server. - * - * @return status code. - */ -RTEMS_INLINE_ROUTINE qos_rv qres_get_exec_time ( - qres_sid_t server_id, - qres_time_t *exec_time, - qres_atime_t *abs_time -) -{ - return _Scheduler_CBS_Get_execution_time( server_id, exec_time, abs_time ); -} - -/** - * @brief qres get current budget - * - * Retrieve remaining budget for the current server instance. - * - * @return status code. - */ -RTEMS_INLINE_ROUTINE qos_rv qres_get_curr_budget ( - qres_sid_t server_id, - qres_time_t *current_budget -) -{ - return _Scheduler_CBS_Get_remaining_budget( server_id, current_budget ); -} - -/** - * @brief qres get approved budget - * - * Retrieve the budget that has been approved for the subsequent - * server instances. - * - * @return status code. - */ -RTEMS_INLINE_ROUTINE qos_rv qres_get_appr_budget ( - qres_sid_t server_id, - qres_time_t *appr_budget -) -{ - return _Scheduler_CBS_Get_approved_budget( server_id, appr_budget ); -} diff --git a/cpukit/preinstall.am b/cpukit/preinstall.am index 8671a8c5e6..f6d24bb78f 100644 --- a/cpukit/preinstall.am +++ b/cpukit/preinstall.am @@ -337,6 +337,10 @@ $(PROJECT_INCLUDE)/rtems/serial_mouse.h: libmisc/mouse/serial_mouse.h $(PROJECT_ $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/serial_mouse.h PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/serial_mouse.h +$(PROJECT_INCLUDE)/rtems/qreslib.h: libqos/qreslib.h $(PROJECT_INCLUDE)/rtems/$(dirstamp) + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/qreslib.h +PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/qreslib.h + if LIBSHELL $(PROJECT_INCLUDE)/rtems/shell.h: libmisc/shell/shell.h $(PROJECT_INCLUDE)/rtems/$(dirstamp) $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/shell.h diff --git a/testsuites/sptests/spqreslib/system.h b/testsuites/sptests/spqreslib/system.h index f99b5f459d..1f229687c7 100644 --- a/testsuites/sptests/spqreslib/system.h +++ b/testsuites/sptests/spqreslib/system.h @@ -48,7 +48,7 @@ rtems_task Task_Periodic( #include #include #include -#include +#include /* global variables */ -- cgit v1.2.3 From c24d98236f2c032ad434d17c0d28c38725a901db Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 23 Apr 2012 10:44:47 +0200 Subject: bsp/lpc24xx: Fix define name --- c/src/lib/libbsp/arm/lpc24xx/include/io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/src/lib/libbsp/arm/lpc24xx/include/io.h b/c/src/lib/libbsp/arm/lpc24xx/include/io.h index 60670ac460..03ae472790 100644 --- a/c/src/lib/libbsp/arm/lpc24xx/include/io.h +++ b/c/src/lib/libbsp/arm/lpc24xx/include/io.h @@ -1023,7 +1023,7 @@ rtems_status_code lpc24xx_pin_config( #define LPC24XX_PIN_UART_3_RXD_P0_1 \ LPC24XX_PIN(0, 1, LPC24XX_PIN_FUNCTION_10, 2) -#define LPC24XX_PIN_UART_3_RXD_P0_25 \ +#define LPC24XX_PIN_UART_3_RXD_P0_26 \ LPC24XX_PIN(0, 26, LPC24XX_PIN_FUNCTION_11, 3) #define LPC24XX_PIN_UART_3_RXD_P4_29 \ LPC24XX_PIN(4, 29, LPC24XX_PIN_FUNCTION_11, 2) -- cgit v1.2.3 From e384438b9c5dbd7fe0dc5e67b93f2d749b4b3874 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 23 Apr 2012 15:46:07 +0200 Subject: nfsclient: POSIX conformance According to POSIX the read() call should return the maximum number of bytes available for regular files. --- cpukit/libfs/src/nfsclient/src/nfs.c | 46 +++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/cpukit/libfs/src/nfsclient/src/nfs.c b/cpukit/libfs/src/nfsclient/src/nfs.c index ebcdbb3863..da4bae6ac5 100644 --- a/cpukit/libfs/src/nfsclient/src/nfs.c +++ b/cpukit/libfs/src/nfsclient/src/nfs.c @@ -2200,20 +2200,17 @@ static int nfs_dir_close( return 0; } -static ssize_t nfs_file_read( - rtems_libio_t *iop, - void *buffer, - size_t count +static ssize_t nfs_file_read_chunk( + NfsNode node, + uint32_t offset, + void *buffer, + size_t count ) { readres rr; -NfsNode node = iop->pathinfo.node_access; Nfs nfs = node->nfs; - if (count > NFS_MAXDATA) - count = NFS_MAXDATA; - - SERP_ARGS(node).readarg.offset = iop->offset; + SERP_ARGS(node).readarg.offset = offset; SERP_ARGS(node).readarg.count = count; SERP_ARGS(node).readarg.totalcount = UINT32_C(0xdeadbeef); @@ -2244,6 +2241,37 @@ Nfs nfs = node->nfs; return rr.readres_u.reply.data.data_len; } +static ssize_t nfs_file_read( + rtems_libio_t *iop, + void *buffer, + size_t count +) +{ + ssize_t rv = 0; + NfsNode node = iop->pathinfo.node_access; + uint32_t offset = iop->offset; + char *in = buffer; + + do { + size_t chunk = count <= NFS_MAXDATA ? count : NFS_MAXDATA; + ssize_t done = nfs_file_read_chunk(node, offset, in, chunk); + + if (done > 0) { + offset += (uint32_t) done; + in += done; + count -= (size_t) done; + rv += done; + } else { + count = 0; + if (done < 0) { + rv = -1; + } + } + } while (count > 0); + + return rv; +} + /* this is called by readdir() / getdents() */ static ssize_t nfs_dir_read( rtems_libio_t *iop, -- cgit v1.2.3 From bc04436cce02954c0e1016c343d00d0493766c52 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 23 Apr 2012 16:21:42 +0200 Subject: nfsclient: Use UID and GID of NFS handle Use UID and GID of the NFS handle for node and symbolic link creation. --- cpukit/libfs/src/nfsclient/src/nfs.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/cpukit/libfs/src/nfsclient/src/nfs.c b/cpukit/libfs/src/nfsclient/src/nfs.c index da4bae6ac5..71d8c0d6c8 100644 --- a/cpukit/libfs/src/nfsclient/src/nfs.c +++ b/cpukit/libfs/src/nfsclient/src/nfs.c @@ -1188,8 +1188,8 @@ int len; } chpt++; } else { - *puid = RPCIOD_DEFAULT_ID; - *pgid = RPCIOD_DEFAULT_ID; + *puid = geteuid(); + *pgid = getegid(); chpt = *pPath; } if ( pHost ) @@ -1883,6 +1883,7 @@ int rv = 0; struct timeval now; diropres res; NfsNode node = parentloc->node_access; +Nfs nfs = node->nfs; mode_t type = S_IFMT & mode; char *dupname; @@ -1901,16 +1902,15 @@ char *dupname; SERP_ARGS(node).createarg.name = dupname; SERP_ARGS(node).createarg.attributes.mode = mode; - /* TODO: either use our uid or use the Nfs credentials */ - SERP_ARGS(node).createarg.attributes.uid = 0; - SERP_ARGS(node).createarg.attributes.gid = 0; + SERP_ARGS(node).createarg.attributes.uid = nfs->uid; + SERP_ARGS(node).createarg.attributes.gid = nfs->gid; SERP_ARGS(node).createarg.attributes.size = 0; SERP_ARGS(node).createarg.attributes.atime.seconds = now.tv_sec; SERP_ARGS(node).createarg.attributes.atime.useconds = now.tv_usec; SERP_ARGS(node).createarg.attributes.mtime.seconds = now.tv_sec; SERP_ARGS(node).createarg.attributes.mtime.useconds = now.tv_usec; - if ( nfscall( node->nfs->server, + if ( nfscall( nfs->server, (type == S_IFDIR) ? NFSPROC_MKDIR : NFSPROC_CREATE, (xdrproc_t)xdr_createargs, &SERP_FILE(node), (xdrproc_t)xdr_diropres, &res) @@ -1976,6 +1976,7 @@ int rv = 0; struct timeval now; nfsstat status; NfsNode node = parentloc->node_access; +Nfs nfs = node->nfs; char *dupname; dupname = nfs_dupname(name, namelen); @@ -1992,16 +1993,15 @@ char *dupname; SERP_ARGS(node).symlinkarg.to = (nfspath) target; SERP_ARGS(node).symlinkarg.attributes.mode = S_IFLNK | S_IRWXU | S_IRWXG | S_IRWXO; - /* TODO */ - SERP_ARGS(node).symlinkarg.attributes.uid = 0; - SERP_ARGS(node).symlinkarg.attributes.gid = 0; + SERP_ARGS(node).symlinkarg.attributes.uid = nfs->uid; + SERP_ARGS(node).symlinkarg.attributes.gid = nfs->gid; SERP_ARGS(node).symlinkarg.attributes.size = 0; SERP_ARGS(node).symlinkarg.attributes.atime.seconds = now.tv_sec; SERP_ARGS(node).symlinkarg.attributes.atime.useconds = now.tv_usec; SERP_ARGS(node).symlinkarg.attributes.mtime.seconds = now.tv_sec; SERP_ARGS(node).symlinkarg.attributes.mtime.useconds = now.tv_usec; - if ( nfscall( node->nfs->server, + if ( nfscall( nfs->server, NFSPROC_SYMLINK, (xdrproc_t)xdr_symlinkargs, &SERP_FILE(node), (xdrproc_t)xdr_nfsstat, &status) -- cgit v1.2.3