Revert "fs/vfs/fs_truncate.c: Use ioctl to truncate on non-mountpoint inode"
This reverts commit dbc163f1b0
.
This commit is contained in:
parent
275b2e70a4
commit
36528eed64
@ -31,7 +31,6 @@
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/fs/fs.h>
|
||||
#include <nuttx/fs/ioctl.h>
|
||||
|
||||
#include "inode/inode.h"
|
||||
|
||||
@ -69,19 +68,7 @@ int file_truncate(FAR struct file *filep, off_t length)
|
||||
*/
|
||||
|
||||
inode = filep->f_inode;
|
||||
if (inode == NULL)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* If inode is not mountpoint try ioctl first */
|
||||
|
||||
if (!INODE_IS_MOUNTPT(inode))
|
||||
{
|
||||
return file_ioctl(filep, FIOC_TRUNCATE, length);
|
||||
}
|
||||
|
||||
if (inode->u.i_mops == NULL)
|
||||
if (inode == NULL || !INODE_IS_MOUNTPT(inode) || inode->u.i_mops == NULL)
|
||||
{
|
||||
fwarn("WARNING: Not a (regular) file on a mounted file system.\n");
|
||||
return -EINVAL;
|
||||
|
@ -187,9 +187,6 @@
|
||||
* configuration
|
||||
* OUT: None
|
||||
*/
|
||||
#define FIOC_TRUNCATE _FIOC(0x0010) /* IN: Length of the file after truncate
|
||||
* OUT: None
|
||||
*/
|
||||
|
||||
/* NuttX file system ioctl definitions **************************************/
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user