smbd/statvfs.c

説明を見る。
00001 /* 
00002    Unix SMB/CIFS implementation.
00003    VFS API's statvfs abstraction
00004    Copyright (C) Alexander Bokovoy                      2005
00005    Copyright (C) Steve French                           2005
00006    
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 2 of the License, or
00010    (at your option) any later version.
00011    
00012    This program is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016    
00017    You should have received a copy of the GNU General Public License
00018    along with this program; if not, write to the Free Software
00019    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00020 */
00021 
00022 #include "includes.h"
00023 
00024 #if defined(LINUX) && defined(HAVE_FSID_INT)
00025 static int linux_statvfs(const char *path, vfs_statvfs_struct *statbuf)
00026 {
00027         struct statvfs statvfs_buf;
00028         int result;
00029 
00030         result = statvfs(path, &statvfs_buf);
00031 
00032         if (!result) {
00033                 statbuf->OptimalTransferSize = statvfs_buf.f_frsize;
00034                 statbuf->BlockSize = statvfs_buf.f_bsize;
00035                 statbuf->TotalBlocks = statvfs_buf.f_blocks;
00036                 statbuf->BlocksAvail = statvfs_buf.f_bfree;
00037                 statbuf->UserBlocksAvail = statvfs_buf.f_bavail;
00038                 statbuf->TotalFileNodes = statvfs_buf.f_files;
00039                 statbuf->FreeFileNodes = statvfs_buf.f_ffree;
00040                 statbuf->FsIdentifier = statvfs_buf.f_fsid;
00041         }
00042         return result;
00043 }
00044 #endif
00045 
00046 /* 
00047  sys_statvfs() is an abstraction layer over system-dependent statvfs()/statfs()
00048  for particular POSIX systems. Due to controversy of what is considered more important
00049  between LSB and FreeBSD/POSIX.1 (IEEE Std 1003.1-2001) we need to abstract the interface
00050  so that particular OS would use its preffered interface.
00051 */
00052 int sys_statvfs(const char *path, vfs_statvfs_struct *statbuf)
00053 {
00054 #if defined(LINUX) && defined(HAVE_FSID_INT)
00055         return linux_statvfs(path, statbuf);
00056 #else
00057         /* BB change this to return invalid level */
00058 #ifdef EOPNOTSUPP
00059         return EOPNOTSUPP;
00060 #else
00061         return -1;
00062 #endif /* EOPNOTSUPP */
00063 #endif /* LINUX */
00064 
00065 }

Sambaに対してSat Aug 29 21:23:26 2009に生成されました。  doxygen 1.4.7