Fix a few typos and wrap some long lines.

This commit is contained in:
Gregory Nutt 2019-02-09 10:00:37 -06:00
parent 411057b59c
commit 7ec13a3b4f
4 changed files with 19 additions and 14 deletions

View File

@ -62,9 +62,9 @@
/* Implements a re-entrant mutex for inode access. This must be re-entrant /* Implements a re-entrant mutex for inode access. This must be re-entrant
* because there can be cycles. For example, it may be necessary to destroy * because there can be cycles. For example, it may be necessary to destroy
* a block driver inode on umount() after a removable block device has been * a block driver inode on umount() after a removable block device has been
* removed. In that case umount() hold the inode semaphore, but the block * removed. In that case umount() holds the inode semaphore, but the block
* driver may callback to unregister_blockdriver() after the un-mount, * driver may callback to unregister_blockdriver() after the un-mount,
* requiring the seamphore again. * requiring the semaphore again.
*/ */
struct inode_sem_s struct inode_sem_s

View File

@ -1,7 +1,8 @@
/**************************************************************************** /****************************************************************************
* fs/inode/fs_registerreserve.c * fs/inode/fs_registerreserve.c
* *
* Copyright (C) 2007-2009, 2011-2012, 2015, 2017 Gregory Nutt. All rights reserved. * Copyright (C) 2007-2009, 2011-2012, 2015, 2017 Gregory Nutt. All
* rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -86,8 +87,11 @@ static void inode_namecpy(char *dest, const char *src)
static FAR struct inode *inode_alloc(FAR const char *name) static FAR struct inode *inode_alloc(FAR const char *name)
{ {
int namelen = inode_namelen(name); FAR struct inode *node;
FAR struct inode *node = (FAR struct inode *)kmm_zalloc(FSNODE_SIZE(namelen)); int namelen;
namelen = inode_namelen(name);
node = (FAR struct inode *)kmm_zalloc(FSNODE_SIZE(namelen));
if (node) if (node)
{ {
inode_namecpy(node->i_name, name); inode_namecpy(node->i_name, name);

View File

@ -94,11 +94,11 @@ static int _inode_compare(FAR const char *fname, FAR struct inode *node)
for (; ; ) for (; ; )
{ {
/* At end of node name? */ /* At the end of the node name? */
if (!*nname) if (!*nname)
{ {
/* Yes.. also end of find name? */ /* Yes.. also at the end of find name? */
if (!*fname || *fname == '/') if (!*fname || *fname == '/')
{ {
@ -114,7 +114,7 @@ static int _inode_compare(FAR const char *fname, FAR struct inode *node)
} }
} }
/* At end of find name? */ /* At end of the find name? */
else if (!*fname || *fname == '/') else if (!*fname || *fname == '/')
{ {
@ -285,7 +285,7 @@ static int _inode_search(FAR struct inode_search_s *desc)
/* Case 1: The name is less than the name of the node. /* Case 1: The name is less than the name of the node.
* Since the names are ordered, these means that there * Since the names are ordered, these means that there
* is no peer node with this name and that there can be * is no peer node with this name and that there can be
* no match in the fileystem. * no match in the filesystem.
*/ */
if (result < 0) if (result < 0)
@ -314,16 +314,17 @@ static int _inode_search(FAR struct inode_search_s *desc)
/* Now there are three remaining possibilities: /* Now there are three remaining possibilities:
* (1) This is the node that we are looking for. * (1) This is the node that we are looking for.
* (2) The node we are looking for is "below" this one. * (2) The node we are looking for is "below" this one.
* (3) This node is a mountpoint and will absorb all request * (3) This node is a mountpoint and will absorb all requests
* below this one * below this one
*/ */
name = inode_nextname(name); name = inode_nextname(name);
if (*name == '\0' || INODE_IS_MOUNTPT(node)) if (*name == '\0' || INODE_IS_MOUNTPT(node))
{ {
/* Either (1) we are at the end of the path, so this must be the /* Either (1) we are at the end of the path, so this must be
* node we are looking for or else (2) this node is a mountpoint * the node we are looking for or else (2) this node is a
* and will handle the remaining part of the pathname * mountpoint and will handle the remaining part of the
* pathname
*/ */
relpath = name; relpath = name;

View File

@ -248,7 +248,7 @@ struct smartfs_entry_s
uint32_t datlen; /* Length of inode data */ uint32_t datlen; /* Length of inode data */
}; };
/* This is an on-device representation of the SMART inode it esists on /* This is an on-device representation of the SMART inode as it exists on
* the FLASH. * the FLASH.
*/ */