Files
u-boot/include/fs_cmd.h
Simon Glass a6b1cd23a7 cmd: Add fsinfo command
Add the fsinfo command to display filesystem statistics including block
size, total blocks, used blocks, and free blocks. Both raw byte counts
and human-readable sizes are shown.

Example output:
  => fsinfo mmc 0:1
  Block size: 4096 bytes
  Total blocks: 16384 (67108864 bytes, 64 MiB)
  Used blocks: 2065 (8458240 bytes, 8.1 MiB)
  Free blocks: 14319 (58650624 bytes, 55.9 MiB)

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-27 13:35:43 -07:00

95 lines
2.8 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
*/
#ifndef _FS_CMD_H
#define _FS_CMD_H
#include <fs_common.h>
struct cmd_tbl;
/**
* do_fat_fsload - Run the fatload command
*
* @cmdtp: Command information for fatload
* @flag: Command flags (CMD_FLAG\_...)
* @argc: Number of arguments
* @argv: List of arguments
* Return: result (see enum command_ret_t)
*/
int do_fat_fsload(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[]);
/**
* do_ext2load - Run the ext2load command
*
* @cmdtp: Command information for ext2load
* @flag: Command flags (CMD_FLAG\_...)
* @argc: Number of arguments
* @argv: List of arguments
* Return: result (see enum command_ret_t)
*/
int do_ext2load(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
/*
* Common implementation for various filesystem commands, optionally limited
* to a specific filesystem type via the fstype parameter.
*/
int do_size(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[],
int fstype);
int do_load(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[],
int fstype);
int do_ls(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[],
int fstype);
int file_exists(const char *dev_type, const char *dev_part, const char *file,
int fstype);
int do_save(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[],
int fstype);
int do_rm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[],
int fstype);
int do_mkdir(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[],
int fstype);
int do_ln(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[],
int fstype);
int do_mv(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[],
int fstype);
/*
* Determine the UUID of the specified filesystem and print it. Optionally it is
* possible to store the UUID directly in env.
*/
int do_fs_uuid(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[],
int fstype);
/*
* Determine the type of the specified filesystem and print it. Optionally it is
* possible to store the type directly in env.
*/
int do_fs_type(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
/**
* do_fs_types - List supported filesystems.
*
* @cmdtp: Command information for fstypes
* @flag: Command flags (CMD_FLAG\_...)
* @argc: Number of arguments
* @argv: List of arguments
* Return: result (see enum command_ret_t)
*/
int do_fs_types(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]);
/**
* do_fs_statfs - Get filesystem statistics.
*
* @cmdtp: Command information for fsinfo
* @flag: Command flags (CMD_FLAG\_...)
* @argc: Number of arguments
* @argv: List of arguments
* Return: result (see enum command_ret_t)
*/
int do_fs_statfs(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
#endif