From eaa34b458a48de2a598e0ac329d9e0f7b4f2f5f1 Mon Sep 17 00:00:00 2001 From: Juha Niskanen Date: Fri, 22 Jan 2021 15:25:03 +0200 Subject: [PATCH] fs/driver: update comments about block_proxy() Signed-off-by: Juha Niskanen --- fs/driver/driver.h | 16 ++++------------ fs/driver/fs_blockproxy.c | 20 +++++--------------- fs/vfs/fs_open.c | 5 ++--- 3 files changed, 11 insertions(+), 30 deletions(-) diff --git a/fs/driver/driver.h b/fs/driver/driver.h index 04a015f25c..990702db01 100644 --- a/fs/driver/driver.h +++ b/fs/driver/driver.h @@ -99,22 +99,14 @@ int find_blockdriver(FAR const char *pathname, int mountflags, * oriented accessed to the block driver. * * Input Parameters: + * filep - The caller provided location in which to return the 'struct + * file' instance. * blkdev - The path to the block driver * oflags - Character driver open flags * * Returned Value: - * If positive, non-zero file descriptor is returned on success. This - * is the file descriptor of the nameless character driver that mediates - * accesses to the block driver. - * - * Errors that may be returned: - * - * ENOMEM - Failed to create a temporary path name. - * - * Plus: - * - * - Errors reported from bchdev_register() - * - Errors reported from open() or unlink() + * Zero (OK) is returned on success. On failure, a negated errno value is + * returned. * ****************************************************************************/ diff --git a/fs/driver/fs_blockproxy.c b/fs/driver/fs_blockproxy.c index a17c7a200c..2d809e5392 100644 --- a/fs/driver/fs_blockproxy.c +++ b/fs/driver/fs_blockproxy.c @@ -128,22 +128,14 @@ static FAR char *unique_chardev(void) * oriented accessed to the block driver. * * Input Parameters: + * filep - The caller provided location in which to return the 'struct + * file' instance. * blkdev - The path to the block driver * oflags - Character driver open flags * * Returned Value: - * If positive, non-zero file descriptor is returned on success. This - * is the file descriptor of the nameless character driver that mediates - * accesses to the block driver. - * - * Errors that may be returned: - * - * ENOMEM - Failed to create a temporary path name. - * - * Plus: - * - * - Errors reported from bchdev_register() - * - Errors reported from open() or unlink() + * Zero (OK) is returned on success. On failure, a negated errno value is + * returned. * ****************************************************************************/ @@ -202,9 +194,7 @@ int block_proxy(FAR struct file *filep, FAR const char *blkdev, int oflags) goto errout_with_chardev; } - /* Free the allocate character driver name and return the open file - * descriptor. - */ + /* Free the allocated character driver name. */ kmm_free(chardev); return OK; diff --git a/fs/vfs/fs_open.c b/fs/vfs/fs_open.c index 7379a4d5e9..d7d7caad93 100644 --- a/fs/vfs/fs_open.c +++ b/fs/vfs/fs_open.c @@ -115,8 +115,7 @@ static int file_vopen(FAR struct file *filep, /* If the inode is block driver, then we may return a character driver * proxy for the block driver. block_proxy() will instantiate a BCH * character driver wrapper around the block driver, open(), then - * unlink() the character driver. On success, block_proxy() will - * return the file descriptor of the opened character driver. + * unlink() the character driver. * * NOTE: This will recurse to open the character driver proxy. */ @@ -128,7 +127,7 @@ static int file_vopen(FAR struct file *filep, inode_release(inode); RELEASE_SEARCH(&desc); - /* Get the file descriptor of the opened character driver proxy */ + /* Get the file structure of the opened character driver proxy */ return block_proxy(filep, path, oflags); }