source: rtems/cpukit/libcsupport/src/statvfs.c @ da154e14

4.11
Last change on this file since da154e14 was da154e14, checked in by Sebastian Huber <sebastian.huber@…>, on May 14, 2012 at 2:55:41 PM

Filesystem: Move operations to mount table entry

The scope of the file system operations is the file system instance.
The scope of the file system node handlers is the file location. The
benefit of moving the operations to the mount table entry is a size
reduction of the file location (rtems_filesystem_location_info_t). The
code size is slightly increased due to additional load instructions.

Restructure rtems_filesystem_mount_table_entry_t to improve cache
efficiency.

  • Property mode set to 100644
File size: 911 bytes
Line 
1/*
2 *  COPYRIGHT (c) 2009 Chris Johns <chrisj@rtems.org>
3 *
4 *  The license and distribution terms for this file may be
5 *  found in the file LICENSE in this distribution or at
6 *  http://www.rtems.com/license/LICENSE.
7 */
8/*
9 * The statvfs as defined by the SUS:
10 *    http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/statvfs.h.html
11 */
12
13#if HAVE_CONFIG_H
14  #include "config.h"
15#endif
16
17#include <sys/statvfs.h>
18#include <string.h>
19
20#include <rtems/libio_.h>
21
22int statvfs( const char *path, struct statvfs *buf )
23{
24  int rv = 0;
25  rtems_filesystem_eval_path_context_t ctx;
26  int eval_flags = RTEMS_FS_FOLLOW_LINK;
27  const rtems_filesystem_location_info_t *currentloc =
28    rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
29
30  memset( buf, 0, sizeof( *buf ) );
31
32  rv = (*currentloc->mt_entry->ops->statvfs_h)( currentloc, buf );
33
34  rtems_filesystem_eval_path_cleanup( &ctx );
35
36  return rv;
37}
Note: See TracBrowser for help on using the repository browser.