Ê×ÏÈÒªµ¼ÈëÕâЩͷÎļþ
#include
#include
#include
#include
#include
#include
È»ºó¿´Ò»ÏÂʵ¼ÊµÄ²Ù×÷
1¡¢²é¿´ÎļþϵͳÐÅÏ¢
asmlinkage long get_files_info(char * filesystem_type)//È¡µÃµ±Ç°Ä¿Â¼µÄÎļþϵͳÐÅÏ¢
{
struct fs_struct *fs ;
struct vfsmount *mnt ;
struct super_block *mnt_sb ;
struct file_system_type *s_type;
read_lock(¤t->fs->lock);
fs = current->fs;
mnt = fs->pwdmnt;
mnt_sb = mnt-> mnt_sb ;
s_type = mnt_sb -> s_type;
printk("PWD Filesystem Type is : %s\n",s_type->name);
copy_to_user(filesystem_type,s_type->name,strlen(s_type->name));
printk("PWD= %ld\n",mnt_sb->s_blocksize);
read_unlock(¤t->fs->lock);
return 0;
}
2¡¢²é¿´fat_boot_sector ÐÅÏ¢
asmlinkage long get_FAT_boot(char * filesystem_type)//È¡µÃfatÎļþϵͳµÄÐÅÏ¢
{
struct fs_struct *fs ;
struct vfsmount *mnt ;
struct super_block *mnt_sb ;
struct buffer_head * bh=NULL;
struct fat_boot_sector *fat_sector;
char c[512];
int len;
read_lock(¤t->fs->lock);
fs = current->fs;
mnt = fs->pwdmnt;
mnt_sb = mnt-> mnt_sb ;
char *fsname=mnt_sb -> s_type->name;
char *sfs="vfat";
if(strcmp(fsname,sfs)==0)//´ËʱÎļþϵͳÊÇvfat
{
sb_min_blocksize(mnt_sb, 512);
bh = sb_bread(mnt_sb, 0);
if(bh!=NULL)
{
fat_sector=(struct fat_boot_sector *)bh->b_data;
len=sprintf(c,"FATÎļþϵͳ¾ßÌå²ÎÊýÈçÏÂ:\n");
len=sprintf(c,"%sbackup boot sector= %d\n",c,fat_sector->backup_boot);
len=sprintf(c,"%ssectors/cluster= %d\n",c,fat_sector->sec_per_clus);
len=sprintf(c,"%snumber of heads= %d\n",c,fat_sector->heads);
len=sprintf(c,"%shidden sectors (unused)= %d\n",c,fat_sector->hidden);
len=sprintf(c,"%smedia code= %d\n",c,fat_sector->media);
len=sprintf(c,"%sbytes per logic
1. #vi /etc/profile£¬Ôö¼Óulimit -HSn 65536
2. #vi /etc/security/limits.conf£¬ÎªÄãµÄÓû§Ôö¼Ó
user soft nofile 38192
user hard nofile 65536
3. ÖØÆôShell¼´¿É
4. ulimit -a ²é¿´ÉèÖÃÊÇ·ñ³É¹¦¡£
5. ²é¿´ÏµÍ³×ÜÏÞÖÆµÄÃüÁ
#cat /proc/sys/fs/file-max
6 ......