diff options
author | Ralf Corsepius <ralf.corsepius@rtems.org> | 2009-11-29 13:20:53 +0000 |
---|---|---|
committer | Ralf Corsepius <ralf.corsepius@rtems.org> | 2009-11-29 13:20:53 +0000 |
commit | 0a7278e49713596cd0d4b7e2d071e40a6940746f (patch) | |
tree | c1c61b6d608ae574575294eb70bdd15a12362d6a /cpukit/libfs | |
parent | Whitespace removal. (diff) | |
download | rtems-0a7278e49713596cd0d4b7e2d071e40a6940746f.tar.bz2 |
Whitespace removal.
Diffstat (limited to 'cpukit/libfs')
26 files changed, 318 insertions, 318 deletions
diff --git a/cpukit/libfs/src/devfs/devfs.h b/cpukit/libfs/src/devfs/devfs.h index fc4523b7a8..81ac4a2415 100644 --- a/cpukit/libfs/src/devfs/devfs.h +++ b/cpukit/libfs/src/devfs/devfs.h @@ -1,4 +1,4 @@ -/** +/** * @file libfs/devfs/devfs.h * * This include file contains all constants and structures associated @@ -18,7 +18,7 @@ extern "C" { * This structure define the type of device table */ -typedef struct +typedef struct { /** This member points to device name which is a null-terminated string */ char *device_name; @@ -44,7 +44,7 @@ extern int rtems_deviceio_errno(rtems_status_code code); /** * The following defines the device table size. This values - * is configured during application configuration time by + * is configured during application configuration time by * the user. The default value is set to 4. */ @@ -56,20 +56,20 @@ extern uint32_t rtems_device_table_size; * handlers. */ -extern rtems_filesystem_operations_table devFS_ops; +extern rtems_filesystem_operations_table devFS_ops; /** * The following defines the device-only filesystem operating * handlers. */ -extern rtems_filesystem_file_handlers_r devFS_file_handlers; +extern rtems_filesystem_file_handlers_r devFS_file_handlers; /** * This handler maps open operation to rtems_io_open. * @param iop This is the RTEMS's internal representation of file. - * @param pathname a null-terminated string that starts with /dev. + * @param pathname a null-terminated string that starts with /dev. * @param flag access flags * @param mode access mode * @retval the same as open @@ -166,10 +166,10 @@ extern int devFS_stat( /** * This routine is invoked upon determination of a node type. - * Since this is a device-only filesystem, so there is only + * Since this is a device-only filesystem, so there is only * one node type in the system. - * - * @param pathloc contains filesytem access information, this + * + * @param pathloc contains filesytem access information, this * parameter is ignored * @retval always returns RTEMS_FILESYSTEM_DEVICE */ @@ -182,14 +182,14 @@ extern int devFS_node_type( /** * This routine is invoked to determine if 'pathname' exists. - * This routine first check access flags, then it searches + * This routine first check access flags, then it searches * the device table to get the information. - * + * * @param pathname device name to be searched * @param flags access flags * @param pathloc contains filesystem access information - * @retval upon success(pathname exists), this routines - * returns 0; if 'flag' is invalid, it returns -1 and errno + * @retval upon success(pathname exists), this routines + * returns 0; if 'flag' is invalid, it returns -1 and errno * is set to EIO; otherwise, it returns -1 and errno is set to ENOENT */ @@ -202,19 +202,19 @@ extern int devFS_evaluate_path( /** - * This routine is given a path to evaluate and a valid start + * This routine is given a path to evaluate and a valid start * location. It is responsible for finding the parent node for * a requested make command, setting pathloc information to - * identify the parent node, and setting the name pointer to - * the first character of the name of the new node. In device + * identify the parent node, and setting the name pointer to + * the first character of the name of the new node. In device * only filesystem, devices do not has a tree hierarchy, there - * are no parent-child relationship. So this routine is rather + * are no parent-child relationship. So this routine is rather * simple, it just set *name to path and returns * * @param path device path to be evaluated - * @param pathloc contains filesystem access information, this + * @param pathloc contains filesystem access information, this * parameter is ignored - * @param name + * @param name * @retval always returns 0 */ @@ -228,9 +228,9 @@ extern int devFS_evaluate_for_make( /** * This routine is invoked upon registration of a new device - * file. It is responsible for creating a item in the main - * device table. This routine searches the device table in - * sequential order, when found a empty slot, it fills the slot + * file. It is responsible for creating a item in the main + * device table. This routine searches the device table in + * sequential order, when found a empty slot, it fills the slot * with proper values. * * @param path the device file name to be registered @@ -239,15 +239,15 @@ extern int devFS_evaluate_for_make( * @param pathloc contains filesystem access information * @retval upon success, this routine returns 0; if 'path' * already exist, it returns -1 and errno is set to EEXIST; - * if device table is full, it returns -1 and errno is set + * if device table is full, it returns -1 and errno is set * to ENOMEM */ extern int devFS_mknod( const char *path, - mode_t mode, - dev_t dev, - rtems_filesystem_location_info_t *pathloc + mode_t mode, + dev_t dev, + rtems_filesystem_location_info_t *pathloc ); @@ -256,10 +256,10 @@ extern int devFS_mknod( * It is responsible for creating the main device table, * initializing it to a known state, and set device file operation * handlers. After this, the device-only filesytem is ready for use - * + * * @param temp_mt_entry * @retval upon success, this routine returns 0; otherwise it returns - * -1 and errno is set to proper value. The only error is when malloc + * -1 and errno is set to proper value. The only error is when malloc * failed, and errno is set to NOMEM. */ @@ -272,15 +272,15 @@ extern int devFS_initialize( * This routine retrieves all the device registered in system, and * prints out their detail information. For example, on one system, * devFS_show will print out following message: - * + * * /dev/console 0 0 * /dev/clock 1 0 * /dev/tty0 0 0 * /flash 2 0 - * - * This routine is intended for debugging, and can be used by shell + * + * This routine is intended for debugging, and can be used by shell * program to provide user with the system information. - * + * * @param none * @retval 0 */ diff --git a/cpukit/libfs/src/devfs/devfs_init.c b/cpukit/libfs/src/devfs/devfs_init.c index b0ebcf803a..3a64ddc27a 100644 --- a/cpukit/libfs/src/devfs/devfs_init.c +++ b/cpukit/libfs/src/devfs/devfs_init.c @@ -16,7 +16,7 @@ #include <rtems/score/wkspace.h> #include "devfs.h" -rtems_filesystem_operations_table devFS_ops = +rtems_filesystem_operations_table devFS_ops = { devFS_evaluate_path, devFS_evaluate_for_make, @@ -38,7 +38,7 @@ rtems_filesystem_operations_table devFS_ops = }; -rtems_filesystem_file_handlers_r devFS_file_handlers = +rtems_filesystem_file_handlers_r devFS_file_handlers = { devFS_open, devFS_close, @@ -74,7 +74,7 @@ int devFS_initialize( rtems_set_errno_and_return_minus_one( ENOMEM ); memset( - device_name_table, 0, + device_name_table, 0, sizeof( rtems_device_name_t ) * ( rtems_device_table_size ) ); diff --git a/cpukit/libfs/src/devfs/devfs_mknod.c b/cpukit/libfs/src/devfs/devfs_mknod.c index 6757877efc..d8e5a30d5f 100644 --- a/cpukit/libfs/src/devfs/devfs_mknod.c +++ b/cpukit/libfs/src/devfs/devfs_mknod.c @@ -22,9 +22,9 @@ int devFS_mknod( const char *path, - mode_t mode, - dev_t dev, - rtems_filesystem_location_info_t *pathloc + mode_t mode, + dev_t dev, + rtems_filesystem_location_info_t *pathloc ) { int i; @@ -35,14 +35,14 @@ int devFS_mknod( ISR_Level level; /* - * This is a special case. In rtems_filesystem_initialize, - * a special device '/dev' will be created. We check this - * condition and do not create the '/dev' and the 'path' + * This is a special case. In rtems_filesystem_initialize, + * a special device '/dev' will be created. We check this + * condition and do not create the '/dev' and the 'path' * actually passed in is 'dev', not '/dev'. Just return 0 to * indicate we are OK. */ - if ((path[0] == 'd') && (path[1] == 'e') && + if ((path[0] == 'd') && (path[1] == 'e') && (path[2] == 'v') && (path[3] == '\0')) return 0; diff --git a/cpukit/libfs/src/devfs/devfs_node_type.c b/cpukit/libfs/src/devfs/devfs_node_type.c index 37b7052459..8643d2d0a5 100644 --- a/cpukit/libfs/src/devfs/devfs_node_type.c +++ b/cpukit/libfs/src/devfs/devfs_node_type.c @@ -17,7 +17,7 @@ int devFS_node_type( ) { /* - * There is only one type of node: device + * There is only one type of node: device */ return RTEMS_FILESYSTEM_DEVICE; diff --git a/cpukit/libfs/src/devfs/devfs_show.c b/cpukit/libfs/src/devfs/devfs_show.c index 83dcf857fc..e449caf49f 100644 --- a/cpukit/libfs/src/devfs/devfs_show.c +++ b/cpukit/libfs/src/devfs/devfs_show.c @@ -26,7 +26,7 @@ int devFS_Show(void) for (i = 0; i < rtems_device_table_size; i++){ if (device_name_table[i].device_name){ - printk("/%s %d %d\n", device_name_table[i].device_name, + printk("/%s %d %d\n", device_name_table[i].device_name, device_name_table[i].major, device_name_table[i].minor); } } diff --git a/cpukit/libfs/src/dosfs/dosfs.h b/cpukit/libfs/src/dosfs/dosfs.h index cde67e38e3..eb99411993 100644 --- a/cpukit/libfs/src/dosfs/dosfs.h +++ b/cpukit/libfs/src/dosfs/dosfs.h @@ -3,7 +3,7 @@ * * Application interface to MSDOS filesystem. */ - + /* * Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia * Author: Eugeny S. Mints <Eugeny.Mints@oktet.ru> @@ -14,7 +14,7 @@ * * @(#) $Id$ */ - + #ifndef _RTEMS_DOSFS_H #define _RTEMS_DOSFS_H diff --git a/cpukit/libfs/src/dosfs/fat.c b/cpukit/libfs/src/dosfs/fat.c index 0c30053a72..123e86b324 100644 --- a/cpukit/libfs/src/dosfs/fat.c +++ b/cpukit/libfs/src/dosfs/fat.c @@ -281,7 +281,7 @@ _fat_block_release( fat_fs_info_t *fs_info = mt_entry->fs_info; return fat_buf_release(fs_info); } - + /* fat_cluster_read -- * wrapper for reading a whole cluster at once * @@ -398,9 +398,9 @@ fat_init_volume_info(rtems_filesystem_mount_table_entry_t *mt_entry) /* Evaluate boot record */ vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec); - - if ( (vol->bps != 512) && - (vol->bps != 1024) && + + if ( (vol->bps != 512) && + (vol->bps != 1024) && (vol->bps != 2048) && (vol->bps != 4096)) { @@ -443,7 +443,7 @@ fat_init_volume_info(rtems_filesystem_mount_table_entry_t *mt_entry) vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); - + /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / vol->bps; @@ -454,18 +454,18 @@ fat_init_volume_info(rtems_filesystem_mount_table_entry_t *mt_entry) vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); - - vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + + + vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + vol->rdir_secs; /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; - + if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec); else vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec); - + data_secs = vol->tot_secs - vol->data_fsec; vol->data_cls = data_secs / vol->spc; @@ -496,7 +496,7 @@ fat_init_volume_info(rtems_filesystem_mount_table_entry_t *mt_entry) if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); - + vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; if (vol->mirror) vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM; @@ -517,9 +517,9 @@ fat_init_volume_info(rtems_filesystem_mount_table_entry_t *mt_entry) { rtems_disk_release(vol->dd); return -1; - } - - if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != + } + + if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != FAT_FSINFO_LEAD_SIGNATURE_VALUE) { _fat_block_release(mt_entry); @@ -535,11 +535,11 @@ fat_init_volume_info(rtems_filesystem_mount_table_entry_t *mt_entry) _fat_block_release(mt_entry); rtems_disk_release(vol->dd); return -1; - } - + } + vol->free_cls = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); vol->next_cl = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); - rc = fat_fat32_update_fsinfo_sector(mt_entry, 0xFFFFFFFF, + rc = fat_fat32_update_fsinfo_sector(mt_entry, 0xFFFFFFFF, 0xFFFFFFFF); if ( rc != RC_OK ) { diff --git a/cpukit/libfs/src/dosfs/fat.h b/cpukit/libfs/src/dosfs/fat.h index 61eb8c758c..8d62662c10 100644 --- a/cpukit/libfs/src/dosfs/fat.h +++ b/cpukit/libfs/src/dosfs/fat.h @@ -50,7 +50,7 @@ extern "C" { # define CF_LE_L(v) CPU_swap_u32((uint32_t)(v)) # define CT_LE_W(v) CPU_swap_u16((uint16_t)(v)) # define CT_LE_L(v) CPU_swap_u32((uint32_t)(v)) -#else +#else # define CF_LE_W(v) (v) # define CF_LE_L(v) (v) # define CT_LE_W(v) (v) @@ -103,7 +103,7 @@ extern "C" { #define FAT_GET_ADDR(x, ofs) ((uint8_t *)(x) + (ofs)) -#define FAT_GET_VAL8(x, ofs) (uint8_t)(*((uint8_t *)(x) + (ofs))) +#define FAT_GET_VAL8(x, ofs) (uint8_t)(*((uint8_t *)(x) + (ofs))) #define FAT_GET_VAL16(x, ofs) \ (uint16_t)( (*((uint8_t *)(x) + (ofs))) | \ @@ -114,10 +114,10 @@ extern "C" { ((uint32_t)(*((uint8_t *)(x) + (ofs) + 1)) << 8) | \ ((uint32_t)(*((uint8_t *)(x) + (ofs) + 2)) << 16) | \ ((uint32_t)(*((uint8_t *)(x) + (ofs) + 3)) << 24) ) - + #define FAT_SET_VAL8(x, ofs,val) \ (*((uint8_t *)(x)+(ofs))=(uint8_t)(val)) - + #define FAT_SET_VAL16(x, ofs,val) do { \ FAT_SET_VAL8((x),(ofs),(val)); \ FAT_SET_VAL8((x),(ofs)+1,(val)>>8);\ @@ -139,8 +139,8 @@ extern "C" { #define FAT_GET_BR_BYTES_PER_SECTOR(x) FAT_GET_VAL16(x, 11) #define FAT_SET_BR_BYTES_PER_SECTOR(x,val) FAT_SET_VAL16(x, 11,val) -#define FAT_GET_BR_SECTORS_PER_CLUSTER(x) FAT_GET_VAL8( x, 13) -#define FAT_SET_BR_SECTORS_PER_CLUSTER(x,val)FAT_SET_VAL8( x, 13,val) +#define FAT_GET_BR_SECTORS_PER_CLUSTER(x) FAT_GET_VAL8( x, 13) +#define FAT_SET_BR_SECTORS_PER_CLUSTER(x,val)FAT_SET_VAL8( x, 13,val) #define FAT_GET_BR_RESERVED_SECTORS_NUM(x) FAT_GET_VAL16(x, 14) #define FAT_SET_BR_RESERVED_SECTORS_NUM(x,val) FAT_SET_VAL16(x, 14,val) @@ -154,8 +154,8 @@ extern "C" { #define FAT_GET_BR_TOTAL_SECTORS_NUM16(x) FAT_GET_VAL16(x, 19) #define FAT_SET_BR_TOTAL_SECTORS_NUM16(x,val)FAT_SET_VAL16(x, 19,val) -#define FAT_GET_BR_MEDIA(x) FAT_GET_VAL8( x, 21) -#define FAT_SET_BR_MEDIA(x,val) FAT_SET_VAL8( x, 21,val) +#define FAT_GET_BR_MEDIA(x) FAT_GET_VAL8( x, 21) +#define FAT_SET_BR_MEDIA(x,val) FAT_SET_VAL8( x, 21,val) #define FAT_GET_BR_SECTORS_PER_FAT(x) FAT_GET_VAL16(x, 22) #define FAT_SET_BR_SECTORS_PER_FAT(x,val) FAT_SET_VAL16(x, 22,val) @@ -251,8 +251,8 @@ extern "C" { #define FAT_GET_FSINFO_TRAIL_SIGNATURE(x) FAT_GET_VAL32(x,508) #define FAT_SET_FSINFO_TRAIL_SIGNATURE(x,val) FAT_SET_VAL32(x,508,val) #define FAT_FSINFO_TRAIL_SIGNATURE_VALUE (0xAA550000) -/* - * I read FSInfo sector from offset 484 to access the information, so offsets +/* + * I read FSInfo sector from offset 484 to access the information, so offsets * of these fields a relative */ #define FAT_GET_FSINFO_FREE_CLUSTER_COUNT(x) FAT_GET_VAL32(x, 4) diff --git a/cpukit/libfs/src/dosfs/fat_file.c b/cpukit/libfs/src/dosfs/fat_file.c index b1a642f54b..0cd5f286db 100644 --- a/cpukit/libfs/src/dosfs/fat_file.c +++ b/cpukit/libfs/src/dosfs/fat_file.c @@ -115,7 +115,7 @@ fat_file_open( rtems_set_errno_and_return_minus_one( ENOMEM ); memset(lfat_fd, 0, sizeof(fat_file_fd_t)); - + lfat_fd->links_num = 1; lfat_fd->flags &= ~FAT_FILE_REMOVED; lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; @@ -584,7 +584,7 @@ fat_file_extend( } fat_fd->fat_file_size = new_length; - + return RC_OK; } diff --git a/cpukit/libfs/src/dosfs/msdos_conv.c b/cpukit/libfs/src/dosfs/msdos_conv.c index dadc73488c..ce1cf14706 100644 --- a/cpukit/libfs/src/dosfs/msdos_conv.c +++ b/cpukit/libfs/src/dosfs/msdos_conv.c @@ -274,7 +274,7 @@ msdos_filename_unix2dos(const char *un, int unlen, char *dn) un++; unlen--; } - + /* * Copy the unix filename into the dos filename string upto the end * of string, a '.', or 8 characters. Whichever happens first stops diff --git a/cpukit/libfs/src/dosfs/msdos_create.c b/cpukit/libfs/src/dosfs/msdos_create.c index f7bd97196c..a9d8dbaac3 100644 --- a/cpukit/libfs/src/dosfs/msdos_create.c +++ b/cpukit/libfs/src/dosfs/msdos_create.c @@ -80,7 +80,7 @@ msdos_creat_node(rtems_filesystem_location_info_t *parent_loc, uint32_t byte = 0; fat_dir_pos_init(&dir_pos); - + memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2); diff --git a/cpukit/libfs/src/dosfs/msdos_dir.c b/cpukit/libfs/src/dosfs/msdos_dir.c index 43ff65291b..6fa3ddecf1 100644 --- a/cpukit/libfs/src/dosfs/msdos_dir.c +++ b/cpukit/libfs/src/dosfs/msdos_dir.c @@ -14,7 +14,7 @@ #include "config.h" #endif -#include <ctype.h> +#include <ctype.h> #include <stdlib.h> #include <unistd.h> #include <assert.h> @@ -258,7 +258,7 @@ msdos_dir_read(rtems_libio_t *iop, void *buffer, size_t count) for (i = 0; i < ret; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE) { char* entry = (char*) fs_info->cl_buf + i; - + /* * Is this directory from here on empty ? */ @@ -288,7 +288,7 @@ msdos_dir_read(rtems_libio_t *iop, void *buffer, size_t count) int o; char* p; int q; - + /* * Is this is the first entry of a LFN ? */ @@ -306,7 +306,7 @@ msdos_dir_read(rtems_libio_t *iop, void *buffer, size_t count) */ lfn_start = ((j * bts2rd) + i) / MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE; - + /* * Get the number of entries so we can count down and * also the checksum of the short entry. @@ -330,7 +330,7 @@ msdos_dir_read(rtems_libio_t *iop, void *buffer, size_t count) lfn_start = FAT_FILE_SHORT_NAME; continue; } - + /* * Extract the file name into the directory entry. The data is * stored in UNICODE characters (16bit). No translation is @@ -340,16 +340,16 @@ msdos_dir_read(rtems_libio_t *iop, void *buffer, size_t count) * trailing nul character. We need to range check the length to * fit in the directory entry name field. */ - + lfn_entries--; p = entry + 1; o = lfn_entries * MSDOS_LFN_LEN_PER_ENTRY; - + for (q = 0; q < MSDOS_LFN_LEN_PER_ENTRY; q++) { if (o >= (sizeof(tmp_dirent.d_name) - 1)) break; - + tmp_dirent.d_name[o++] = *p; if (*p == '\0') @@ -372,7 +372,7 @@ msdos_dir_read(rtems_libio_t *iop, void *buffer, size_t count) else { fat_dir_pos_t dir_pos; - + /* * Skip active entries until get the entry to start from. */ @@ -446,7 +446,7 @@ msdos_dir_read(rtems_libio_t *iop, void *buffer, size_t count) { tmp_dirent.d_namlen = strlen(tmp_dirent.d_name); } - + memcpy(buffer + cmpltd, &tmp_dirent, sizeof(struct dirent)); iop->offset = iop->offset + sizeof(struct dirent); @@ -461,7 +461,7 @@ msdos_dir_read(rtems_libio_t *iop, void *buffer, size_t count) return rc; } } - + if (count <= 0) break; } diff --git a/cpukit/libfs/src/dosfs/msdos_format.c b/cpukit/libfs/src/dosfs/msdos_format.c index 23beb4d144..98cb334787 100644 --- a/cpukit/libfs/src/dosfs/msdos_format.c +++ b/cpukit/libfs/src/dosfs/msdos_format.c @@ -180,7 +180,7 @@ static int msdos_format_fill_sectors char *fill_buffer = NULL; uint32_t total_sectors = sector_cnt; int last_percent = -1; - + /* * allocate and fill buffer */ @@ -200,7 +200,7 @@ static int msdos_format_fill_sectors /* * write to consecutive sectors */ - while ((ret_val == 0) && + while ((ret_val == 0) && (sector_cnt > 0)) { int percent = (sector_cnt * 100) / total_sectors; if (percent != last_percent) { @@ -212,13 +212,13 @@ static int msdos_format_fill_sectors start_sector++; sector_cnt--; } - + msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL, "\n"); if (ret_val) msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_INFO, "filling error on sector: %d\n", start_sector); - + /* * cleanup */ @@ -301,7 +301,7 @@ static int msdos_format_eval_sectors_per_cluster while (MS_BYTES_PER_CLUSTER_LIMIT / bytes_per_sector < sectors_per_cluster) { sectors_per_cluster /= 2; } - + do { /* * compute number of data clusters for current data: @@ -320,7 +320,7 @@ static int msdos_format_eval_sectors_per_cluster fat_capacity = fatdata_cluster_cnt * 4; } - sectors_per_fat = ((fat_capacity + sectors_per_fat = ((fat_capacity + (bytes_per_sector - 1)) / bytes_per_sector); @@ -341,7 +341,7 @@ static int msdos_format_eval_sectors_per_cluster /* * when maximum cluster size is exceeded, we have invalid data, abort... */ - if ((sectors_per_cluster * bytes_per_sector) + if ((sectors_per_cluster * bytes_per_sector) > MS_BYTES_PER_CLUSTER_LIMIT) { ret_val = EINVAL; finished = true; @@ -384,9 +384,9 @@ static int msdos_format_determine_fmt_params uint32_t onebit; uint32_t sectors_per_cluster_adj = 0; uint64_t total_size = 0; - + memset(fmt_params,0,sizeof(*fmt_params)); - /* + /* * this one is fixed in this implementation. * At least one thing we don't have to magically guess... */ @@ -402,7 +402,7 @@ static int msdos_format_determine_fmt_params * determine number of FATs */ if (ret_val == 0) { - if ((rqdata == NULL) || + if ((rqdata == NULL) || (rqdata->fat_num == 0)) { fmt_params->fat_num = 2; } @@ -413,33 +413,33 @@ static int msdos_format_determine_fmt_params ret_val = EINVAL; } } - + if (ret_val == 0) msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL, "number of fats: %d\n", fmt_params->fat_num); - + /* * Now we get sort of a loop when determining things: - * The FAT type (FAT12/16/32) is determined ONLY from the + * The FAT type (FAT12/16/32) is determined ONLY from the * data cluster count: * Disks with data cluster count < 4085 are FAT12. * Disks with data cluster count < 65525 are FAT16. - * The rest is FAT32 (no FAT128 available yet :-) + * The rest is FAT32 (no FAT128 available yet :-) * - * The number of data clusters is the - * total capacity + * The number of data clusters is the + * total capacity * minus reserved sectors * minus root directory ares * minus storage needed for the FAT (and its copy/copies). - * + * * The last item once again depends on the FAT type and the cluster count. - * + * * So here is what we do in this formatter: * - If a FAT type is requested from the caller, we try to modify * the cluster size, until the data cluster count is in range - * - If no FAT type is given, we estimate a useful FAT type from + * - If no FAT type is given, we estimate a useful FAT type from * the disk capacity and then adapt the cluster size - */ + */ /* * determine characteristic values: @@ -450,19 +450,19 @@ static int msdos_format_determine_fmt_params */ /* * determine FAT type and sectors per cluster - * depends on + * depends on */ if (ret_val == 0) { fmt_params->sectors_per_cluster = 1; - if ((rqdata != NULL) && + if ((rqdata != NULL) && (rqdata->fattype == MSDOS_FMT_FAT12)) { fmt_params->fattype = FAT_FAT12; } - else if ((rqdata != NULL) && + else if ((rqdata != NULL) && (rqdata->fattype == MSDOS_FMT_FAT16)) { fmt_params->fattype = FAT_FAT16; } - else if ((rqdata != NULL) && + else if ((rqdata != NULL) && (rqdata->fattype == MSDOS_FMT_FAT32)) { fmt_params->fattype = FAT_FAT32; } @@ -477,17 +477,17 @@ static int msdos_format_determine_fmt_params * NOTE: maximum sect_per_clust is arbitrarily choosen with values that * are a compromise concerning capacity and efficency */ - if (fmt_params->totl_sector_cnt + if (fmt_params->totl_sector_cnt < ((uint32_t)FAT_FAT12_MAX_CLN)*8) { fmt_params->fattype = FAT_FAT12; /* start trying with small clusters */ - fmt_params->sectors_per_cluster = 2; + fmt_params->sectors_per_cluster = 2; } - else if (fmt_params->totl_sector_cnt + else if (fmt_params->totl_sector_cnt < ((uint32_t)FAT_FAT16_MAX_CLN)*32) { fmt_params->fattype = FAT_FAT16; /* start trying with small clusters */ - fmt_params->sectors_per_cluster = 2; + fmt_params->sectors_per_cluster = 2; } else { #define ONE_GB (1024L * 1024L * 1024L) @@ -504,10 +504,10 @@ static int msdos_format_determine_fmt_params /* * try to use user requested cluster size */ - if ((rqdata != NULL) && + if ((rqdata != NULL) && (rqdata->sectors_per_cluster > 0)) { - fmt_params->sectors_per_cluster = - rqdata->sectors_per_cluster; + fmt_params->sectors_per_cluster = + rqdata->sectors_per_cluster; } /* * check sectors per cluster. @@ -518,7 +518,7 @@ static int msdos_format_determine_fmt_params for (onebit = 128;onebit >= 1;onebit = onebit>>1) { if (fmt_params->sectors_per_cluster >= onebit) { fmt_params->sectors_per_cluster = onebit; - if (fmt_params->sectors_per_cluster + if (fmt_params->sectors_per_cluster <= 32768L/fmt_params->bytes_per_sector) { /* value is small enough so this value is ok */ onebit = 1; @@ -530,7 +530,7 @@ static int msdos_format_determine_fmt_params if (ret_val == 0) { msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL, "sectors per cluster: %d\n", fmt_params->sectors_per_cluster); - + if (fmt_params->fattype == FAT_FAT32) { /* recommended: for FAT32, always set reserved sector count to 32 */ fmt_params->rsvd_sector_cnt = 32; @@ -548,7 +548,7 @@ static int msdos_format_determine_fmt_params /* recommended: for FAT16, set files per root directory to 512 */ /* for FAT12/FAT16, set files per root directory */ /* must fill up an even count of sectors */ - if ((rqdata != NULL) && + if ((rqdata != NULL) && (rqdata->files_per_root_dir > 0)) { fmt_params->files_per_root_dir = rqdata->files_per_root_dir; } @@ -560,23 +560,23 @@ static int msdos_format_determine_fmt_params fmt_params->files_per_root_dir = 64; } } - fmt_params->files_per_root_dir = (fmt_params->files_per_root_dir + + fmt_params->files_per_root_dir = (fmt_params->files_per_root_dir + (2*fmt_params->bytes_per_sector/ FAT_DIRENTRY_SIZE-1)); - fmt_params->files_per_root_dir -= (fmt_params->files_per_root_dir % + fmt_params->files_per_root_dir -= (fmt_params->files_per_root_dir % (2*fmt_params->bytes_per_sector /FAT_DIRENTRY_SIZE)); } - fmt_params->root_dir_sectors = + fmt_params->root_dir_sectors = (((fmt_params->files_per_root_dir * FAT_DIRENTRY_SIZE) - + fmt_params->bytes_per_sector - 1) + + fmt_params->bytes_per_sector - 1) / fmt_params->bytes_per_sector); } if (ret_val == 0) { - fatdata_sect_cnt = (fmt_params->totl_sector_cnt - - fmt_params->rsvd_sector_cnt - + fatdata_sect_cnt = (fmt_params->totl_sector_cnt - + fmt_params->rsvd_sector_cnt - fmt_params->root_dir_sectors); - + /* * check values to get legal arrangement of FAT type and cluster count */ @@ -596,9 +596,9 @@ static int msdos_format_determine_fmt_params * determine media code */ if (ret_val == 0) { - if ((rqdata != NULL) && + if ((rqdata != NULL) && (rqdata->media != 0)) { - const char valid_media_codes[] = + const char valid_media_codes[] = {0xF0,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}; if (NULL==memchr(valid_media_codes, rqdata->media, @@ -619,18 +619,18 @@ static int msdos_format_determine_fmt_params * for formatting */ if (fmt_params->root_dir_sectors > 0) { - fmt_params->root_dir_start_sec = + fmt_params->root_dir_start_sec = fmt_params->rsvd_sector_cnt - + (fmt_params-> fat_num*fmt_params->sectors_per_fat); + + (fmt_params-> fat_num*fmt_params->sectors_per_fat); fmt_params->root_dir_fmt_sec_cnt = fmt_params->root_dir_sectors; } else { /* * for FAT32: root directory is in cluster 2 */ - fmt_params->root_dir_start_sec = + fmt_params->root_dir_start_sec = fmt_params->rsvd_sector_cnt - + (fmt_params-> fat_num*fmt_params->sectors_per_fat); + + (fmt_params-> fat_num*fmt_params->sectors_per_fat); fmt_params->root_dir_fmt_sec_cnt = fmt_params->sectors_per_cluster; } /* @@ -653,8 +653,8 @@ static int msdos_format_determine_fmt_params } else { /* - * non-printable character in given name, so keep stuck - * at that character and replace all following characters + * non-printable character in given name, so keep stuck + * at that character and replace all following characters * with a ' ' */ *to++=' '; @@ -684,8 +684,8 @@ static int msdos_format_determine_fmt_params } else { /* - * non-printable character in given name, so keep stuck - * at that character and replace all following characters + * non-printable character in given name, so keep stuck + * at that character and replace all following characters * with a ' ' */ *to++=' '; @@ -693,7 +693,7 @@ static int msdos_format_determine_fmt_params *to = '\0'; } } - + /* * determine usable Volume ID */ @@ -754,7 +754,7 @@ static int msdos_format_gen_mbr * with 0xEB,.... */ /* - * fill OEMName + * fill OEMName */ memcpy(FAT_GET_ADDR_BR_OEMNAME(mbr), fmt_params->OEMName, @@ -762,7 +762,7 @@ static int msdos_format_gen_mbr FAT_SET_BR_BYTES_PER_SECTOR(mbr , fmt_params->bytes_per_sector); FAT_SET_BR_SECTORS_PER_CLUSTER(mbr , fmt_params->sectors_per_cluster); FAT_SET_BR_RESERVED_SECTORS_NUM(mbr, fmt_params->rsvd_sector_cnt); - + /* number of FATs on medium */ FAT_SET_BR_FAT_NUM(mbr , 2); /* standard/recommended value */ FAT_SET_BR_FILES_PER_ROOT_DIR(mbr , fmt_params->files_per_root_dir); @@ -778,13 +778,13 @@ static int msdos_format_gen_mbr FAT_SET_BR_SECTORS_PER_FAT(mbr ,fmt_params->sectors_per_fat); FAT_SET_BR_DRVNUM(mbr , 0); /* only needed for INT13... */ FAT_SET_BR_RSVD1(mbr , 0); /* fill with zero */ - FAT_SET_BR_BOOTSIG(mbr , FAT_BR_BOOTSIG_VAL); + FAT_SET_BR_BOOTSIG(mbr , FAT_BR_BOOTSIG_VAL); FAT_SET_BR_VOLID(mbr , fmt_params->vol_id); /* volume id */ memcpy(FAT_GET_ADDR_BR_VOLLAB(mbr), fmt_params->VolLabel, FAT_BR_VOLLAB_SIZE); memcpy(FAT_GET_ADDR_BR_FILSYSTYPE(mbr), - (fmt_params->fattype == FAT_FAT12) + (fmt_params->fattype == FAT_FAT12) ? "FAT12 " : "FAT16 ", FAT_BR_FILSYSTYPE_SIZE); @@ -800,7 +800,7 @@ static int msdos_format_gen_mbr FAT_SET_BR_FAT32_DRVNUM(mbr , 0); /* only needed for INT13... */ FAT_SET_BR_FAT32_RSVD1(mbr , 0); /* fill with zero */ - FAT_SET_BR_FAT32_BOOTSIG(mbr ,FAT_BR_FAT32_BOOTSIG_VAL); + FAT_SET_BR_FAT32_BOOTSIG(mbr ,FAT_BR_FAT32_BOOTSIG_VAL); FAT_SET_BR_FAT32_VOLID(mbr , 0); /* not set */ memset(FAT_GET_ADDR_BR_FAT32_VOLLAB(mbr) ,0,FAT_BR_VOLLAB_SIZE); memcpy(FAT_GET_ADDR_BR_FAT32_FILSYSTYPE(mbr), @@ -820,7 +820,7 @@ static int msdos_format_gen_mbr FAT_SET_VAL8(mbr,2,0x90); /* * FIXME: a nice little PC boot loader would be nice here. - * but where can I get one for free? + * but where can I get one for free? */ /* * Phuuu.... That's it. @@ -847,7 +847,7 @@ static int msdos_format_gen_fsinfo \*=========================================================================*/ { /* - * clear fsinfo sector data + * clear fsinfo sector data */ memset(fsinfo,0,FAT_TOTAL_FSINFO_SIZE); /* @@ -856,8 +856,8 @@ static int msdos_format_gen_fsinfo FAT_SET_FSINFO_LEAD_SIGNATURE (fsinfo,FAT_FSINFO_LEAD_SIGNATURE_VALUE ); FAT_SET_FSINFO_STRUC_SIGNATURE(fsinfo,FAT_FSINFO_STRUC_SIGNATURE_VALUE); FAT_SET_FSINFO_TRAIL_SIGNATURE(fsinfo,FAT_FSINFO_TRAIL_SIGNATURE_VALUE); - /* - * write "empty" values for free cluster count and next cluster number + /* + * write "empty" values for free cluster count and next cluster number */ FAT_SET_FSINFO_FREE_CLUSTER_COUNT(fsinfo+FAT_FSI_INFO, 0xffffffff); @@ -889,7 +889,7 @@ int msdos_format { char tmp_sec[FAT_TOTAL_MBR_SIZE]; int rc; - rtems_disk_device *dd = NULL; + rtems_disk_device *dd = NULL; struct stat stat_buf; int ret_val = 0; int fd = -1; @@ -907,14 +907,14 @@ int msdos_format rc = stat(devname, &stat_buf); ret_val = rc; } - - /* rtems feature: no block devices, all are character devices */ + + /* rtems feature: no block devices, all are character devices */ if ((ret_val == 0) && (!S_ISCHR(stat_buf.st_mode))) { errno = ENOTTY; ret_val = -1; } - + /* check that device is registered as block device and lock it */ if (ret_val == 0) { dd = rtems_disk_obtain(stat_buf.st_rdev); @@ -934,8 +934,8 @@ int msdos_format if (fd == -1) { ret_val= -1; - } - } + } + } /* * compute formatting parameters @@ -958,7 +958,7 @@ int msdos_format 0xe5); } /* - * create master boot record + * create master boot record */ if (ret_val == 0) { /* @@ -975,7 +975,7 @@ int msdos_format "generate MRB sector\n"); ret_val = msdos_format_gen_mbr(tmp_sec,&fmt_params); } - + /* * write master boot record to disk * also write copy of MBR to disk @@ -983,20 +983,20 @@ int msdos_format if (ret_val == 0) { msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL, "write MRB sector\n"); - ret_val = msdos_format_write_sec(fd, - 0, + ret_val = msdos_format_write_sec(fd, + 0, fmt_params.bytes_per_sector, tmp_sec); } - if ((ret_val == 0) && + if ((ret_val == 0) && (fmt_params.mbr_copy_sec != 0)) { /* * write copy of MBR */ msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL, "write back up MRB sector\n"); - ret_val = msdos_format_write_sec(fd, - fmt_params.mbr_copy_sec , + ret_val = msdos_format_write_sec(fd, + fmt_params.mbr_copy_sec , fmt_params.bytes_per_sector, tmp_sec); } @@ -1004,7 +1004,7 @@ int msdos_format /* * for FAT32: initialize info sector on disk */ - if ((ret_val == 0) && + if ((ret_val == 0) && (fmt_params.fsinfo_sec != 0)) { ret_val = msdos_format_gen_fsinfo(tmp_sec); } @@ -1013,7 +1013,7 @@ int msdos_format */ if ((ret_val == 0) && (fmt_params.fsinfo_sec != 0)) { - ret_val = msdos_format_write_sec(fd, + ret_val = msdos_format_write_sec(fd, fmt_params.fsinfo_sec, fmt_params.bytes_per_sector, tmp_sec); @@ -1058,7 +1058,7 @@ int msdos_format tmp_sec); } /* - * write FAT entry 0 as (0xffffff00|Media_type)EOC, + * write FAT entry 0 as (0xffffff00|Media_type)EOC, * write FAT entry 1 as EOC * allocate directory in a FAT32 FS */ diff --git a/cpukit/libfs/src/dosfs/msdos_misc.c b/cpukit/libfs/src/dosfs/msdos_misc.c index 67ce4a11e3..003d2f57f4 100644 --- a/cpukit/libfs/src/dosfs/msdos_misc.c +++ b/cpukit/libfs/src/dosfs/msdos_misc.c @@ -68,7 +68,7 @@ msdos_is_valid_name_char(const char ch) if ((ch == '.') || isalnum(ch) || (strchr("$%'-_@~`!(){}^#&", ch) != NULL)) return MSDOS_NAME_SHORT; - + return MSDOS_NAME_INVALID; } @@ -143,19 +143,19 @@ msdos_name_type(const char *name, int name_len) uppercase = true; else if ((*name >= 'a') && (*name <= 'z')) lowercase = true; - + count++; name++; } if (lowercase && uppercase) return MSDOS_NAME_LONG; - + return MSDOS_NAME_SHORT; } /* msdos_long_to_short -- - * Routine to creates a short name from a long. Start the end of the + * Routine to creates a short name from a long. Start the end of the * * PARAMETERS: * name - name to check @@ -183,7 +183,7 @@ msdos_long_to_short(const char *lfn, int lfn_len, char* sfn, int sfn_len) sfn[0] = '.'; return MSDOS_NAME_SHORT; } - + if ((lfn[0] == '.') && (lfn[1] == '.') && (lfn_len == 2)) { sfn[0] = sfn[1] = '.'; @@ -203,14 +203,14 @@ msdos_long_to_short(const char *lfn, int lfn_len, char* sfn, int sfn_len) /* * Is this a short name ? */ - + type = msdos_name_type (lfn, lfn_len); if (type == MSDOS_NAME_INVALID) return MSDOS_NAME_INVALID; - + msdos_filename_unix2dos (lfn, lfn_len, sfn); - + return type; } @@ -251,7 +251,7 @@ msdos_get_token(const char *path, } *ret_token = path; - + /* * If it is just a separator then it is the current dir. */ @@ -350,7 +350,7 @@ msdos_find_name( return rc; fat_fd->dir_pos = dir_pos; - + /* * I don't like this if, but: we should do it, or should write new file * size and first cluster num to the disk after each write operation @@ -824,7 +824,7 @@ msdos_set_first_char4file_name( dir_block_size = fs_info->fat.vol.rdir_size; else dir_block_size = fs_info->fat.vol.bpc; - + if (dir_pos->lname.cln == FAT_FILE_SHORT_NAME) start = dir_pos->sname; @@ -1001,16 +1001,16 @@ int msdos_find_name_in_fat_file( assert(name_len > 0); fat_dir_pos_init(dir_pos); - + lfn_start.cln = lfn_start.ofs = FAT_FILE_SHORT_NAME; - + /* * If the file name is long how many short directory * entries are needed ? */ if (name_type == MSDOS_NAME_LONG) lfn_entries = ((name_len - 1) + MSDOS_LFN_LEN_PER_ENTRY) / MSDOS_LFN_LEN_PER_ENTRY; - + if (FAT_FD_OF_ROOT_DIR(fat_fd) && (fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16))) bts2rd = fat_fd->fat_file_size; @@ -1035,7 +1035,7 @@ int msdos_find_name_in_fat_file( #if MSDOS_FIND_PRINT printf ("MSFS:[2] dir_offset:%li\n", dir_offset); #endif - + if (ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE) rtems_set_errno_and_return_minus_one(EIO); @@ -1111,7 +1111,7 @@ int msdos_find_name_in_fat_file( * Remainder is not empty so is this entry empty ? */ empty_space_count++; - + if (empty_space_count == (lfn_entries + 1)) empty_space_found = true; } @@ -1176,7 +1176,7 @@ int msdos_find_name_in_fat_file( if (lfn_entries != (*MSDOS_DIR_ENTRY_TYPE(entry) & MSDOS_LAST_LONG_ENTRY_MASK)) continue; - + /* * Get the checksum of the short entry. */ @@ -1184,7 +1184,7 @@ int msdos_find_name_in_fat_file( lfn_start.ofs = dir_entry; lfn_entry = lfn_entries; lfn_checksum = *MSDOS_DIR_LFN_CHECKSUM(entry); - + #if MSDOS_FIND_PRINT printf ("MSFS:[4.3] lfn_checksum:%i\n", *MSDOS_DIR_LFN_CHECKSUM(entry)); @@ -1211,7 +1211,7 @@ int msdos_find_name_in_fat_file( lfn_entry--; o = lfn_entry * MSDOS_LFN_LEN_PER_ENTRY; p = entry + 1; - + #if MSDOS_FIND_PRINT printf ("MSFS:[5] lfne:%i\n", lfn_entry); #endif @@ -1233,7 +1233,7 @@ int msdos_find_name_in_fat_file( lfn_start.cln = FAT_FILE_SHORT_NAME; break; } - + if (((o + i) >= name_len) || (*p != name[o + i])) { lfn_start.cln = FAT_FILE_SHORT_NAME; @@ -1256,7 +1256,7 @@ int msdos_find_name_in_fat_file( lfn_matched = ((lfn_entry == 0) && (lfn_start.cln != FAT_FILE_SHORT_NAME)); - + #if MSDOS_FIND_PRINT printf ("MSFS:[8.1] lfn_matched:%i\n", lfn_matched); #endif @@ -1309,7 +1309,7 @@ int msdos_find_name_in_fat_file( return rc; dir_pos->sname.ofs = dir_entry; - + if (lfn_start.cln != FAT_FILE_SHORT_NAME) { rc = fat_file_ioctl(mt_entry, fat_fd, F_CLU_NUM, @@ -1318,7 +1318,7 @@ int msdos_find_name_in_fat_file( if (rc != RC_OK) return rc; } - + dir_pos->lname.cln = lfn_start.cln; dir_pos->lname.ofs = lfn_start.ofs; @@ -1326,7 +1326,7 @@ int msdos_find_name_in_fat_file( MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); return RC_OK; } - + lfn_start.cln = FAT_FILE_SHORT_NAME; lfn_matched = false; } @@ -1363,7 +1363,7 @@ int msdos_find_name_in_fat_file( int i; int slot = (((empty_space_offset * bts2rd) + empty_space_entry) / MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE) + lfn_entries + 1; - + msdos_short_name_hex(MSDOS_DIR_NAME(name_dir_entry), slot); for (i = 0; i < 11; i++, p++) @@ -1408,7 +1408,7 @@ int msdos_find_name_in_fat_file( while (lfn_entry < (lfn_entries + 1)) { int length = 0; - + if (read_cluster) { uint32_t new_length; @@ -1429,7 +1429,7 @@ int msdos_find_name_in_fat_file( #endif ret = fat_file_extend (mt_entry, fat_fd, empty_space_offset * bts2rd, &new_length); - + if (ret != RC_OK) return ret; @@ -1451,11 +1451,11 @@ int msdos_find_name_in_fat_file( rtems_set_errno_and_return_minus_one(EIO); } } - + #if MSDOS_FIND_PRINT printf ("MSFS:[10] eso:%li\n", empty_space_offset); #endif - + for (dir_entry = empty_space_entry; dir_entry < bts2rd; dir_entry += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE) @@ -1467,7 +1467,7 @@ int msdos_find_name_in_fat_file( length += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE; lfn_entry++; - + #if MSDOS_FIND_PRINT printf ("MSFS:[10] de:%li(%li) length:%i lfn_entry:%i\n", dir_entry, (dir_entry / MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE), @@ -1495,7 +1495,7 @@ int msdos_find_name_in_fat_file( if (rc != RC_OK) return rc; } - + dir_pos->lname.cln = lfn_start.cln; dir_pos->lname.ofs = lfn_start.ofs; @@ -1516,23 +1516,23 @@ int msdos_find_name_in_fat_file( lfn_start.cln = empty_space_offset; lfn_start.ofs = dir_entry; } - + /* * Clear the entry before loading the data. */ memset (entry, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); *MSDOS_DIR_LFN_CHECKSUM(entry) = lfn_checksum; - + p = entry + 1; n = name + (lfn_entries - lfn_entry) * MSDOS_LFN_LEN_PER_ENTRY; - + for (i = 0; i < MSDOS_LFN_LEN_PER_ENTRY; i++) { *p = *n; if (*n != 0) n++; - + switch (i) { case 4: @@ -1563,7 +1563,7 @@ int msdos_find_name_in_fat_file( empty_space_entry = 0; read_cluster = true; } - + return 0; } @@ -1616,7 +1616,7 @@ int msdos_find_node_by_cluster_num_in_fat_file( for (i = 0; i < bts2rd; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE) { char* entry = (char*) fs_info->cl_buf + i; - + /* if this and all rest entries are empty - return not-found */ if ((*MSDOS_DIR_ENTRY_TYPE(entry)) == MSDOS_THIS_DIR_ENTRY_AND_REST_EMPTY) @@ -1639,7 +1639,7 @@ int msdos_find_node_by_cluster_num_in_fat_file( dir_pos->sname.ofs = i; dir_pos->lname.cln = FAT_FILE_SHORT_NAME; dir_pos->lname.ofs = FAT_FILE_SHORT_NAME; - + memcpy(dir_entry, entry, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); return RC_OK; diff --git a/cpukit/libfs/src/dosfs/msdos_mknod.c b/cpukit/libfs/src/dosfs/msdos_mknod.c index 421d873136..ad4ad50d00 100644 --- a/cpukit/libfs/src/dosfs/msdos_mknod.c +++ b/cpukit/libfs/src/dosfs/msdos_mknod.c @@ -56,7 +56,7 @@ int msdos_mknod( rtems_status_code sc = RTEMS_SUCCESSFUL; msdos_fs_info_t *fs_info = pathloc->mt_entry->fs_info; msdos_token_types_t type = 0; - + /* * Figure out what type of msdos node this is. */ diff --git a/cpukit/libfs/src/imfs/imfs_eval.c b/cpukit/libfs/src/imfs/imfs_eval.c index 5dcf7576a5..b9b56de205 100644 --- a/cpukit/libfs/src/imfs/imfs_eval.c +++ b/cpukit/libfs/src/imfs/imfs_eval.c @@ -110,7 +110,7 @@ int IMFS_evaluate_permission( else { /* must be other - do nothing */; } - + /* * If all of the flags are set we have permission * to do this. @@ -311,7 +311,7 @@ int IMFS_evaluate_for_make( /* * Evaluate all tokens until we are done or an error occurs. */ - + while( !done ) { type = IMFS_get_token( &path[i], pathlen, token, &len ); diff --git a/cpukit/libfs/src/nfsclient/src/dirutils.c b/cpukit/libfs/src/nfsclient/src/dirutils.c index 73a20c8af7..31af4c6da7 100644 --- a/cpukit/libfs/src/nfsclient/src/dirutils.c +++ b/cpukit/libfs/src/nfsclient/src/dirutils.c @@ -4,19 +4,19 @@ /* Till Straumann, <strauman@slac.stanford.edu>, 10/2002 */ -/* +/* * Authorship * ---------- * This software (NFS-2 client implementation for RTEMS) was created by * Till Straumann <strauman@slac.stanford.edu>, 2002-2007, * Stanford Linear Accelerator Center, Stanford University. - * + * * Acknowledgement of sponsorship * ------------------------------ * The NFS-2 client implementation for RTEMS was produced by * the Stanford Linear Accelerator Center, Stanford University, * under Contract DE-AC03-76SFO0515 with the Department of Energy. - * + * * Government disclaimer of liability * ---------------------------------- * Neither the United States nor the United States Department of Energy, @@ -25,18 +25,18 @@ * completeness, or usefulness of any data, apparatus, product, or process * disclosed, or represents that its use would not infringe privately owned * rights. - * + * * Stanford disclaimer of liability * -------------------------------- * Stanford University makes no representations or warranties, express or * implied, nor assumes any liability for the use of this software. - * + * * Stanford disclaimer of copyright * -------------------------------- * Stanford University, owner of the copyright, hereby disclaims its * copyright and all other rights in this software. Hence, anyone may - * freely use it for any purpose without restriction. - * + * freely use it for any purpose without restriction. + * * Maintenance of notices * ---------------------- * In the interest of clarity regarding the origin and status of this @@ -45,9 +45,9 @@ * or distributed by the recipient and are to be affixed to any copy of * software made or distributed by the recipient that contains a copy or * derivative of this software. - * + * * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03 - */ + */ #ifdef __vxworks #include <vxWorks.h> diff --git a/cpukit/libfs/src/nfsclient/src/librtemsNfs.h b/cpukit/libfs/src/nfsclient/src/librtemsNfs.h index 028beeff80..8afdb6c60f 100644 --- a/cpukit/libfs/src/nfsclient/src/librtemsNfs.h +++ b/cpukit/libfs/src/nfsclient/src/librtemsNfs.h @@ -6,19 +6,19 @@ /* Author: Till Straumann <strauman@slac.stanford.edu> 2002-2003 */ -/* +/* * Authorship * ---------- * This software (NFS-2 client implementation for RTEMS) was created by * Till Straumann <strauman@slac.stanford.edu>, 2002-2007, * Stanford Linear Accelerator Center, Stanford University. - * + * * Acknowledgement of sponsorship * ------------------------------ * The NFS-2 client implementation for RTEMS was produced by * the Stanford Linear Accelerator Center, Stanford University, * under Contract DE-AC03-76SFO0515 with the Department of Energy. - * + * * Government disclaimer of liability * ---------------------------------- * Neither the United States nor the United States Department of Energy, @@ -27,18 +27,18 @@ * completeness, or usefulness of any data, apparatus, product, or process * disclosed, or represents that its use would not infringe privately owned * rights. - * + * * Stanford disclaimer of liability * -------------------------------- * Stanford University makes no representations or warranties, express or * implied, nor assumes any liability for the use of this software. - * + * * Stanford disclaimer of copyright * -------------------------------- * Stanford University, owner of the copyright, hereby disclaims its * copyright and all other rights in this software. Hence, anyone may - * freely use it for any purpose without restriction. - * + * freely use it for any purpose without restriction. + * * Maintenance of notices * ---------------------- * In the interest of clarity regarding the origin and status of this @@ -47,9 +47,9 @@ * or distributed by the recipient and are to be affixed to any copy of * software made or distributed by the recipient that contains a copy or * derivative of this software. - * + * * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03 - */ + */ #ifdef HAVE_CONFIG_H #include <config.h> diff --git a/cpukit/libfs/src/nfsclient/src/nfs.c b/cpukit/libfs/src/nfsclient/src/nfs.c index cce17a5c7c..61e4373ee1 100644 --- a/cpukit/libfs/src/nfsclient/src/nfs.c +++ b/cpukit/libfs/src/nfsclient/src/nfs.c @@ -4,19 +4,19 @@ /* Author: Till Straumann <strauman@slac.stanford.edu> 2002 */ -/* +/* * Authorship * ---------- * This software (NFS-2 client implementation for RTEMS) was created by * Till Straumann <strauman@slac.stanford.edu>, 2002-2007, * Stanford Linear Accelerator Center, Stanford University. - * + * * Acknowledgement of sponsorship * ------------------------------ * The NFS-2 client implementation for RTEMS was produced by * the Stanford Linear Accelerator Center, Stanford University, * under Contract DE-AC03-76SFO0515 with the Department of Energy. - * + * * Government disclaimer of liability * ---------------------------------- * Neither the United States nor the United States Department of Energy, @@ -25,18 +25,18 @@ * completeness, or usefulness of any data, apparatus, product, or process * disclosed, or represents that its use would not infringe privately owned * rights. - * + * * Stanford disclaimer of liability * -------------------------------- * Stanford University makes no representations or warranties, express or * implied, nor assumes any liability for the use of this software. - * + * * Stanford disclaimer of copyright * -------------------------------- * Stanford University, owner of the copyright, hereby disclaims its * copyright and all other rights in this software. Hence, anyone may - * freely use it for any purpose without restriction. - * + * freely use it for any purpose without restriction. + * * Maintenance of notices * ---------------------- * In the interest of clarity regarding the origin and status of this @@ -45,9 +45,9 @@ * or distributed by the recipient and are to be affixed to any copy of * software made or distributed by the recipient that contains a copy or * derivative of this software. - * + * * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03 - */ + */ #ifdef HAVE_CONFIG_H #include <config.h> @@ -105,7 +105,7 @@ * variable 'nfsStBlksize'. * Thanks to Steven Johnson <sjohnson@sakuraindustries.com> for helping * working on this issue. - */ + */ #define DEFAULT_NFS_ST_BLKSIZE NFS_MAXDATA /* dont change this without changing the maximal write size */ @@ -139,7 +139,7 @@ static struct timeval _nfscalltimeout = { 10, 0 }; /* {secs, us } */ * This has an impact on performance, as e.g. getcwd() stats() all * directory entries when it believes it has crossed a mount point * (a.st_dev != b.st_dev). - * + * * OTOH, it also might cause node comparison failure! E.g. 'getcwd()' * assumes that two nodes residing in the same directory must be located * on the same device and hence compares 'st_ino' only. @@ -194,7 +194,7 @@ static struct timeval _nfscalltimeout = { 10, 0 }; /* {secs, us } */ rtems_semaphore_obtain((s), \ RTEMS_WAIT, \ RTEMS_NO_TIMEOUT); \ - } while (0) + } while (0) #define UNLOCK(s) do { rtems_semaphore_release((s)); \ } while (0) @@ -219,7 +219,7 @@ xdr_strbuf(XDR *xdrs, strbuf *obj) } /* Read 'readlink' results into a 'strbuf'. - * This is convenient as it avoids + * This is convenient as it avoids * one extra step of copying / lenght * checking. */ @@ -427,7 +427,7 @@ typedef struct serporid { } serporid_u; } serporid; -/* an XDR routine to encode/decode the inverted diropres +/* an XDR routine to encode/decode the inverted diropres * into an nfsnodestat; * * NOTE: this routine only acts on @@ -435,7 +435,7 @@ typedef struct serporid { * - 'serporid.file' * - 'serporid.attributes' * and leaves the 'arg_u' alone. - * + * * The idea is that a 'diropres' is read into 'serporid' * which can then be used as an argument to subsequent * NFS-RPCs (after filling in the node's arg_u). @@ -448,7 +448,7 @@ xdr_serporidok(XDR *xdrs, serporidok *objp) if (!xdr_fattr (xdrs, &objp->attributes)) return FALSE; return TRUE; -} +} static bool_t xdr_serporid(XDR *xdrs, serporid *objp) @@ -511,10 +511,10 @@ typedef struct NfsRec_ { */ u_short id; /* Our RTEMS filesystem mt_entry - */ + */ rtems_filesystem_mount_table_entry_t *mt_entry; /* Next NfsRec on a linked list who - * is anchored at nfsGlob + * is anchored at nfsGlob */ struct NfsRec_ *next; /* Who we pretend we are @@ -560,7 +560,7 @@ typedef struct NfsNodeRec_ { *****************************************/ static int nfs_readlink( - rtems_filesystem_location_info_t *loc, /* IN */ + rtems_filesystem_location_info_t *loc, /* IN */ char *buf, /* OUT */ size_t len ); @@ -608,7 +608,7 @@ rtems_filesystem_resolve_location(char *buf, int len, rtems_filesystem_location_ /* * * * * * * * * * * * * * * * * * - Trivial Operations on a NfsNode + Trivial Operations on a NfsNode * * * * * * * * * * * * * * * * * */ /* determine if a location 'l' is an NFS root node */ @@ -723,7 +723,7 @@ static struct nfsstats { * Global variable to tune the 'st_blksize' (stat(2)) value this nfs * client should report. * size on the server. - */ + */ #ifndef DEFAULT_NFS_ST_BLKSIZE #define DEFAULT_NFS_ST_BLKSIZE NFS_MAXDATA #endif @@ -1157,7 +1157,7 @@ int rval = -1; /* Check the 'age' of a node's stats * and read the attributes from the server * if necessary. - * + * * ARGS: node node to update * force enforce updating ignoring * the timestamp/age @@ -1188,7 +1188,7 @@ updateAttr(NfsNode node, int force) node->age = nowSeconds(); } - + return 0; } @@ -1352,7 +1352,7 @@ struct rtems_filesystem_location_info_tt * before passing control to the new FS' evalpath_h() * */ - + STATIC int nfs_do_evalpath( const char *pathname, /* IN */ int pathnamelen, /* IN */ @@ -1386,7 +1386,7 @@ unsigned long niu,siu; /* from here on, the NFS is protected from being unmounted * since the node refcount is > 1 */ - + /* clone the node */ if ( !node ) { /* nodeClone sets errno */ @@ -1791,7 +1791,7 @@ sattr arg; arg.gid = group; return nfs_sattr(pathloc->node_access, &arg, SATTR_UID | SATTR_GID); - + } /* Cleanup the FS private info attached to pathloc->node_access */ @@ -1802,7 +1802,7 @@ static int nfs_freenode( Nfs nfs = ((NfsNode)pathloc->node_access)->nfs; #if DEBUG & DEBUG_COUNT_NODES - /* print counts at entry where they are > 0 so 'nfs' is safe from being destroyed + /* print counts at entry where they are > 0 so 'nfs' is safe from being destroyed * and there's no race condition */ fprintf(stderr, @@ -2058,7 +2058,7 @@ LOCK(nfsGlob.llock); status = buildIpAddr(&uid, &gid, 0, &saddr, &path); assert( !status ); - + stat = mntcall( &saddr, MOUNTPROC_UMNT, (xdrproc_t)xdr_dirpath, &path, @@ -2076,7 +2076,7 @@ LOCK(nfsGlob.llock); nfsNodeDestroy(mt_entry->mt_fs_root.node_access); mt_entry->mt_fs_root.node_access = 0; - + nfsDestroy(mt_entry->fs_info); mt_entry->fs_info = 0; @@ -2229,7 +2229,7 @@ NfsNode node = loc->node_access; } static int nfs_do_readlink( - rtems_filesystem_location_info_t *loc, /* IN */ + rtems_filesystem_location_info_t *loc, /* IN */ strbuf *psbuf /* IN/OUT */ ) { @@ -2264,7 +2264,7 @@ int rval; } static int nfs_readlink( - rtems_filesystem_location_info_t *loc, /* IN */ + rtems_filesystem_location_info_t *loc, /* IN */ char *buf, /* OUT */ size_t len ) @@ -2397,7 +2397,7 @@ int rval = RVAL_ERR_AND_DO_FREENODE; } } else { /* link points to an absolute path '/xxx' */ - + /* release this node; filesystem_evaluate_path() will * lookup a new one. */ @@ -2864,7 +2864,7 @@ fattr *fa = &SERP_ATTR(node); return -1; } -/* done by caller +/* done by caller memset(buf, 0, sizeof(*buf)); */ @@ -3007,7 +3007,7 @@ sattr arg; arg.mode = mode; return nfs_sattr(loc->node_access, &arg, SATTR_MODE); - + } /* just set the size attribute to 'length' @@ -3169,7 +3169,7 @@ rtems_device_driver nfs_initialize( * only reason for using this API was getting * a major number, after all). * - * Something must be present, however, to + * Something must be present, however, to * reserve a slot in the driver table. */ return RTEMS_SUCCESSFUL; @@ -3198,7 +3198,7 @@ Nfs nfs; fprintf(stderr,"nfsMountsShow(): no memory\n"); return -1; } - + fprintf(f,"Currently Mounted NFS:\n"); LOCK(nfsGlob.llock); diff --git a/cpukit/libfs/src/nfsclient/src/nfs.modini.c b/cpukit/libfs/src/nfsclient/src/nfs.modini.c index 834102eaae..14eb20da68 100644 --- a/cpukit/libfs/src/nfsclient/src/nfs.modini.c +++ b/cpukit/libfs/src/nfsclient/src/nfs.modini.c @@ -4,7 +4,7 @@ void _cexpModuleInitialize(void *mod) -{ +{ #if defined(DEBUG) /* print load address (in case we crash while initializing) */ unsigned lr; @@ -20,7 +20,7 @@ unsigned lr; int _cexpModuleFinalize(void *mod) -{ +{ return nfsCleanup(); } diff --git a/cpukit/libfs/src/nfsclient/src/nfsTest.c b/cpukit/libfs/src/nfsclient/src/nfsTest.c index 01ef860744..0d78364d72 100644 --- a/cpukit/libfs/src/nfsclient/src/nfsTest.c +++ b/cpukit/libfs/src/nfsclient/src/nfsTest.c @@ -16,7 +16,7 @@ * reply to come back. Performance enhancement can be expected * by requesting multiple blocks in parallel rather than * sequentially. - * + * * rtems_interval * nfsTestRead(char *file_name, int chunk_size, int num_readers); * @@ -50,19 +50,19 @@ * performed at 'big block' boundaries (num_readers * chunk_size). */ -/* +/* * Authorship * ---------- * This software (NFS-2 client implementation for RTEMS) was created by * Till Straumann <strauman@slac.stanford.edu>, 2002-2007, * Stanford Linear Accelerator Center, Stanford University. - * + * * Acknowledgement of sponsorship * ------------------------------ * The NFS-2 client implementation for RTEMS was produced by * the Stanford Linear Accelerator Center, Stanford University, * under Contract DE-AC03-76SFO0515 with the Department of Energy. - * + * * Government disclaimer of liability * ---------------------------------- * Neither the United States nor the United States Department of Energy, @@ -71,18 +71,18 @@ * completeness, or usefulness of any data, apparatus, product, or process * disclosed, or represents that its use would not infringe privately owned * rights. - * + * * Stanford disclaimer of liability * -------------------------------- * Stanford University makes no representations or warranties, express or * implied, nor assumes any liability for the use of this software. - * + * * Stanford disclaimer of copyright * -------------------------------- * Stanford University, owner of the copyright, hereby disclaims its * copyright and all other rights in this software. Hence, anyone may - * freely use it for any purpose without restriction. - * + * freely use it for any purpose without restriction. + * * Maintenance of notices * ---------------------- * In the interest of clarity regarding the origin and status of this @@ -91,9 +91,9 @@ * or distributed by the recipient and are to be affixed to any copy of * software made or distributed by the recipient that contains a copy or * derivative of this software. - * + * * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03 - */ + */ #include <rtems.h> #include <rtems/error.h> @@ -181,7 +181,7 @@ rtems_id tid; rtems_build_name('n','t','t','0'+inst), nfsTestReaderPri, 1400, - RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_MODES, RTEMS_DEFAULT_ATTRIBUTES, &tid); if ( RTEMS_SUCCESSFUL != sc ) { @@ -345,7 +345,7 @@ char *buf=0; if ( i < 0 ) { perror("reading"); goto cleanup; - } + } } now = rtems_clock_get_ticks_since_boot(); diff --git a/cpukit/libfs/src/nfsclient/src/rpcio.c b/cpukit/libfs/src/nfsclient/src/rpcio.c index 71a4161b58..30adaef091 100644 --- a/cpukit/libfs/src/nfsclient/src/rpcio.c +++ b/cpukit/libfs/src/nfsclient/src/rpcio.c @@ -6,7 +6,7 @@ /* This code funnels arbitrary task's UDP/RPC requests * through one socket to arbitrary servers. - * The replies are gathered and dispatched to the + * The replies are gathered and dispatched to the * requestors. * One task handles all the sending and receiving * work including retries. @@ -15,20 +15,20 @@ * of the results (except for the RPC header which * is handled by the daemon). */ - -/* + +/* * Authorship * ---------- * This software (NFS-2 client implementation for RTEMS) was created by * Till Straumann <strauman@slac.stanford.edu>, 2002-2007, * Stanford Linear Accelerator Center, Stanford University. - * + * * Acknowledgement of sponsorship * ------------------------------ * The NFS-2 client implementation for RTEMS was produced by * the Stanford Linear Accelerator Center, Stanford University, * under Contract DE-AC03-76SFO0515 with the Department of Energy. - * + * * Government disclaimer of liability * ---------------------------------- * Neither the United States nor the United States Department of Energy, @@ -37,18 +37,18 @@ * completeness, or usefulness of any data, apparatus, product, or process * disclosed, or represents that its use would not infringe privately owned * rights. - * + * * Stanford disclaimer of liability * -------------------------------- * Stanford University makes no representations or warranties, express or * implied, nor assumes any liability for the use of this software. - * + * * Stanford disclaimer of copyright * -------------------------------- * Stanford University, owner of the copyright, hereby disclaims its * copyright and all other rights in this software. Hence, anyone may - * freely use it for any purpose without restriction. - * + * freely use it for any purpose without restriction. + * * Maintenance of notices * ---------------------- * In the interest of clarity regarding the origin and status of this @@ -57,9 +57,9 @@ * or distributed by the recipient and are to be affixed to any copy of * software made or distributed by the recipient that contains a copy or * derivative of this software. - * + * * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03 - */ + */ #include <rtems.h> #include <rtems/error.h> @@ -100,7 +100,7 @@ * into different areas of the data. * * If undefined, the regular 'sendto()' - * interface is used. + * interface is used. */ #undef REJECT_SERVERIP_MISMATCH @@ -136,7 +136,7 @@ static struct timeval _rpc_default_timeout = { 10 /* secs */, 0 /* usecs */ }; * thread doing RPC IO (e.g. NFS) */ #define RTEMS_RPC_EVENT RTEMS_EVENT_30 /* THE event used by RPCIO. Every task doing - * RPC IO will receive this - hence it is + * RPC IO will receive this - hence it is * RESERVED */ #define RPCIOD_RX_EVENT RTEMS_EVENT_1 /* Events the RPCIOD is using/waiting for */ @@ -347,7 +347,7 @@ typedef struct RpcUdpXactPoolRec_ { * objects are registered. * A number of bits in a transaction's XID maps 1:1 to * an index in this table. Hence, the XACT matching - * an RPC/UDP reply packet can quickly be found + * an RPC/UDP reply packet can quickly be found * The size of this table imposes a hard limit on the * number of all created transactions in the system. */ @@ -542,7 +542,7 @@ struct pmap pmaparg; /* dont use non-reentrant pmap_getport ! */ pmap_err = rpcUdpCallRp( - paddr, + paddr, PMAPPROG, PMAPVERS, PMAPPROC_GETPORT, @@ -564,7 +564,7 @@ struct pmap pmaparg; if (0==paddr->sin_port) { return RPC_PROGNOTREGISTERED; - } + } rval = (RpcUdpServer)MY_MALLOC(sizeof(*rval)); memset(rval, 0, sizeof(*rval)); @@ -576,7 +576,7 @@ struct pmap pmaparg; /* start with a long retransmission interval - it * will be adapted dynamically */ - rval->retry_period = RPCIOD_RETX_CAP_S * ticksPerSec; + rval->retry_period = RPCIOD_RETX_CAP_S * ticksPerSec; rval->auth = auth; @@ -670,7 +670,7 @@ register int i,j; rval = (RpcUdpXact)MY_CALLOC(1,sizeof(*rval) - sizeof(rval->obuf) + size); if (rval) { - + header.rm_xid = 0; header.rm_direction = CALL; header.rm_call.cb_rpcvers = RPC_MSG_VERSION; @@ -688,7 +688,7 @@ register int i,j; rval->obuf.xid = (xidHashSeed++ ^ ((unsigned long)rval>>10)) & XACT_HASH_MSK; i=j=(rval->obuf.xid & XACT_HASH_MSK); if (msgQ) { - /* if there's no message queue, refuse to + /* if there's no message queue, refuse to * give them transactions; we might be in the process to * go away... */ @@ -896,7 +896,7 @@ rtems_event_set gotEvents; #ifndef MBUF_RX xact->ibufsize = 0; #endif - + if (refresh && locked_refresh(xact->server)) { rtems_task_ident(RTEMS_SELF, RTEMS_WHO_AM_I, &xact->requestor); if ( rtems_message_queue_send(msgQ, &xact, sizeof(xact)) ) { @@ -1036,7 +1036,7 @@ enum clnt_stat err; /* TODO: could maintain a server cache */ x->server = s; - + *pclnt = x; return RPC_SUCCESS; @@ -1132,7 +1132,7 @@ nodeAppend(ListNode l, ListNode n) n->next->prev = n; l->next = n; n->prev = l; - + } /* this code does the work */ @@ -1161,7 +1161,7 @@ rtems_status_code status; if ( RTEMS_SUCCESSFUL != (stat = rtems_event_receive( RPCIOD_RX_EVENT | RPCIOD_TX_EVENT | RPCIOD_KILL_EVENT, - RTEMS_WAIT | RTEMS_EVENT_ANY, + RTEMS_WAIT | RTEMS_EVENT_ANY, next_retrans, &events)) ) { ASSERT( RTEMS_TIMEOUT == stat ); @@ -1316,13 +1316,13 @@ rtems_status_code status; __FILE__, __LINE__, xact->requestor); - } + } } else { int len; len = (int)XDR_GETPOS(&xact->xdrs); - + #ifdef MBUF_TX xact->refcnt = 1; /* sendto itself */ #endif @@ -1438,7 +1438,7 @@ rtems_status_code status; * respect to 'then' - hence: * * abs_age == old_age + old_then == new_age + new_then - * + * * ==> new_age = old_age + old_then - new_then == old_age - 'now' */ ((RpcUdpXact)n)->age -= now; @@ -1641,7 +1641,7 @@ int len = (int)XDR_GETPOS(&xact->xdrs); * The semantics of the 'pibuf' pointer are * as follows: * - * MBUF_RX: + * MBUF_RX: * */ diff --git a/cpukit/libfs/src/nfsclient/src/rpcio.h b/cpukit/libfs/src/nfsclient/src/rpcio.h index aad56471aa..6c42a09d0c 100644 --- a/cpukit/libfs/src/nfsclient/src/rpcio.h +++ b/cpukit/libfs/src/nfsclient/src/rpcio.h @@ -6,19 +6,19 @@ /* Author: Till Straumann, <strauman@slac.stanford.edu>, 2002 */ -/* +/* * Authorship * ---------- * This software (NFS-2 client implementation for RTEMS) was created by * Till Straumann <strauman@slac.stanford.edu>, 2002-2007, * Stanford Linear Accelerator Center, Stanford University. - * + * * Acknowledgement of sponsorship * ------------------------------ * The NFS-2 client implementation for RTEMS was produced by * the Stanford Linear Accelerator Center, Stanford University, * under Contract DE-AC03-76SFO0515 with the Department of Energy. - * + * * Government disclaimer of liability * ---------------------------------- * Neither the United States nor the United States Department of Energy, @@ -27,18 +27,18 @@ * completeness, or usefulness of any data, apparatus, product, or process * disclosed, or represents that its use would not infringe privately owned * rights. - * + * * Stanford disclaimer of liability * -------------------------------- * Stanford University makes no representations or warranties, express or * implied, nor assumes any liability for the use of this software. - * + * * Stanford disclaimer of copyright * -------------------------------- * Stanford University, owner of the copyright, hereby disclaims its * copyright and all other rights in this software. Hence, anyone may - * freely use it for any purpose without restriction. - * + * freely use it for any purpose without restriction. + * * Maintenance of notices * ---------------------- * In the interest of clarity regarding the origin and status of this @@ -47,9 +47,9 @@ * or distributed by the recipient and are to be affixed to any copy of * software made or distributed by the recipient that contains a copy or * derivative of this software. - * + * * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03 - */ + */ #ifdef __rtems #include <rtems.h> @@ -142,7 +142,7 @@ rpcUdpSend( caddr_t pres, xdrproc_t xargs, caddr_t pargs, - ... /* 0 terminated xdrproc/pobj additional argument list */ + ... /* 0 terminated xdrproc/pobj additional argument list */ ); /* wait for a transaction to complete */ @@ -175,7 +175,7 @@ rpcUdpCallRp( * The pool is implemented by RTEMS message queues who manage * the required task synchronization. * A requestor has different options if the pool is empty: - * - it can wait (block) for a XACT to become available + * - it can wait (block) for a XACT to become available * - it can get an error status * - or it can malloc an extra XACT from the heap which * will eventually be released. diff --git a/cpukit/libfs/src/nfsclient/src/sock_mbuf.c b/cpukit/libfs/src/nfsclient/src/sock_mbuf.c index d0f5edadf5..33d094f9f8 100644 --- a/cpukit/libfs/src/nfsclient/src/sock_mbuf.c +++ b/cpukit/libfs/src/nfsclient/src/sock_mbuf.c @@ -146,7 +146,7 @@ dummyproc(caddr_t ext_buf, u_int ext_size) * and 'free' procs. (The latter may call the * user back once the networking stack has * released the buffer). - * + * * The callbacks are provided with the 'closure' * pointer and the 'buflen' argument. */ @@ -200,7 +200,7 @@ sendto_nocpy ( if (/*auio.uio_resid != len &&*/ (error == EINTR || error == EWOULDBLOCK)) error = 0; } - if (error) + if (error) errno = error; else ret = buflen; @@ -244,7 +244,7 @@ recv_mbuf_from(int s, struct mbuf **ppm, long len, struct sockaddr *fromaddr, in auio.uio_offset = 0; */ auio.uio_resid = len; - error = soreceive (so, &from, &auio, (struct mbuf **) ppm, + error = soreceive (so, &from, &auio, (struct mbuf **) ppm, (struct mbuf **)NULL, NULL); if (error) { diff --git a/cpukit/libfs/src/nfsclient/src/xdr_mbuf.c b/cpukit/libfs/src/nfsclient/src/xdr_mbuf.c index 773a460762..b30227ab5f 100644 --- a/cpukit/libfs/src/nfsclient/src/xdr_mbuf.c +++ b/cpukit/libfs/src/nfsclient/src/xdr_mbuf.c @@ -41,7 +41,7 @@ static char *rcsid = "$FreeBSD: src/lib/libc/xdr/xdr_mem.c,v 1.8 1999/08/28 00:0 /* * xdr_mbuf, XDR implementation using mbuf buffers - * + * * derived from: * * xdr_mem.h, XDR implementation using memory buffers. @@ -49,7 +49,7 @@ static char *rcsid = "$FreeBSD: src/lib/libc/xdr/xdr_mem.c,v 1.8 1999/08/28 00:0 * Copyright (C) 1984, Sun Microsystems, Inc. * * The MBUF stream is useful for BSDNET kernel (or RTEMS for that matter) - * use. + * use. */ #include <string.h> @@ -168,7 +168,7 @@ MBPrivate mbp = (MBPrivate)xdrs->x_base; fprintf(stderr,"xdrmbuf: end of chain\n"); } #endif - + return rval; } diff --git a/cpukit/libfs/src/pipe/pipe.h b/cpukit/libfs/src/pipe/pipe.h index fe2e99305c..283e036778 100644 --- a/cpukit/libfs/src/pipe/pipe.h +++ b/cpukit/libfs/src/pipe/pipe.h @@ -115,7 +115,7 @@ extern int pipe_lseek( extern void rtems_pipe_initialize (void); #ifdef __cplusplus -} +} #endif #endif |