[SIGAR-86] Add options field to sigar_file_system_t
This commit is contained in:
parent
109c1a4c69
commit
f51eac00b2
|
@ -700,6 +700,11 @@ our %classes = (
|
||||||
desc => 'File system os specific type name',
|
desc => 'File system os specific type name',
|
||||||
plat => '*'
|
plat => '*'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name => 'options', type => 'String',
|
||||||
|
desc => 'File system mount options',
|
||||||
|
plat => '*'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name => 'type', type => 'Int',
|
name => 'type', type => 'Int',
|
||||||
desc => 'File system type',
|
desc => 'File system type',
|
||||||
|
|
|
@ -353,6 +353,7 @@ enum {
|
||||||
FS_FIELD_DIRNAME,
|
FS_FIELD_DIRNAME,
|
||||||
FS_FIELD_DEVNAME,
|
FS_FIELD_DEVNAME,
|
||||||
FS_FIELD_SYS_TYPENAME,
|
FS_FIELD_SYS_TYPENAME,
|
||||||
|
FS_FIELD_OPTIONS,
|
||||||
FS_FIELD_TYPE,
|
FS_FIELD_TYPE,
|
||||||
FS_FIELD_TYPENAME,
|
FS_FIELD_TYPENAME,
|
||||||
FS_FIELD_MAX
|
FS_FIELD_MAX
|
||||||
|
@ -388,6 +389,9 @@ JNIEXPORT jobjectArray SIGAR_JNIx(getFileSystemListNative)
|
||||||
ids[FS_FIELD_SYS_TYPENAME] =
|
ids[FS_FIELD_SYS_TYPENAME] =
|
||||||
JENV->GetFieldID(env, cls, "sysTypeName", STRING_SIG);
|
JENV->GetFieldID(env, cls, "sysTypeName", STRING_SIG);
|
||||||
|
|
||||||
|
ids[FS_FIELD_OPTIONS] =
|
||||||
|
JENV->GetFieldID(env, cls, "options", STRING_SIG);
|
||||||
|
|
||||||
ids[FS_FIELD_TYPE] =
|
ids[FS_FIELD_TYPE] =
|
||||||
JENV->GetFieldID(env, cls, "type", "I");
|
JENV->GetFieldID(env, cls, "type", "I");
|
||||||
|
|
||||||
|
@ -429,6 +433,10 @@ JNIEXPORT jobjectArray SIGAR_JNIx(getFileSystemListNative)
|
||||||
ids[FS_FIELD_SYS_TYPENAME],
|
ids[FS_FIELD_SYS_TYPENAME],
|
||||||
fs->sys_type_name);
|
fs->sys_type_name);
|
||||||
|
|
||||||
|
JENV->SetStringField(env, fsobj,
|
||||||
|
ids[FS_FIELD_OPTIONS],
|
||||||
|
fs->options);
|
||||||
|
|
||||||
JENV->SetStringField(env, fsobj,
|
JENV->SetStringField(env, fsobj,
|
||||||
ids[FS_FIELD_TYPENAME],
|
ids[FS_FIELD_TYPENAME],
|
||||||
fs->type_name);
|
fs->type_name);
|
||||||
|
|
|
@ -48,6 +48,7 @@ public class TestFileSystem extends SigarTestCase {
|
||||||
assertLengthTrace("DirName", fs.getDirName());
|
assertLengthTrace("DirName", fs.getDirName());
|
||||||
assertLengthTrace("TypeName", fs.getTypeName());
|
assertLengthTrace("TypeName", fs.getTypeName());
|
||||||
assertLengthTrace("SysTypeName", fs.getSysTypeName());
|
assertLengthTrace("SysTypeName", fs.getSysTypeName());
|
||||||
|
traceln("Options=" + fs.getOptions());
|
||||||
|
|
||||||
FileSystemUsage usage;
|
FileSystemUsage usage;
|
||||||
|
|
||||||
|
|
|
@ -430,6 +430,7 @@ typedef struct {
|
||||||
char dev_name[SIGAR_FS_NAME_LEN];
|
char dev_name[SIGAR_FS_NAME_LEN];
|
||||||
char type_name[SIGAR_FS_NAME_LEN]; /* e.g. "local" */
|
char type_name[SIGAR_FS_NAME_LEN]; /* e.g. "local" */
|
||||||
char sys_type_name[SIGAR_FS_NAME_LEN]; /* e.g. "ext3" */
|
char sys_type_name[SIGAR_FS_NAME_LEN]; /* e.g. "ext3" */
|
||||||
|
char options[SIGAR_FS_NAME_LEN];
|
||||||
sigar_file_system_type_e type;
|
sigar_file_system_type_e type;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
} sigar_file_system_t;
|
} sigar_file_system_t;
|
||||||
|
|
|
@ -1205,6 +1205,7 @@ int sigar_file_system_list_get(sigar_t *sigar,
|
||||||
SIGAR_SSTRCPY(fsp->dir_name, ent.mnt_dir);
|
SIGAR_SSTRCPY(fsp->dir_name, ent.mnt_dir);
|
||||||
SIGAR_SSTRCPY(fsp->dev_name, ent.mnt_fsname);
|
SIGAR_SSTRCPY(fsp->dev_name, ent.mnt_fsname);
|
||||||
SIGAR_SSTRCPY(fsp->sys_type_name, ent.mnt_type);
|
SIGAR_SSTRCPY(fsp->sys_type_name, ent.mnt_type);
|
||||||
|
SIGAR_SSTRCPY(fsp->options, ent.mnt_opts);
|
||||||
sigar_fs_type_get(fsp);
|
sigar_fs_type_get(fsp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1348,6 +1348,7 @@ int sigar_file_system_list_get(sigar_t *sigar,
|
||||||
SIGAR_SSTRCPY(fsp->dir_name, ent.mnt_mountp);
|
SIGAR_SSTRCPY(fsp->dir_name, ent.mnt_mountp);
|
||||||
SIGAR_SSTRCPY(fsp->dev_name, ent.mnt_special);
|
SIGAR_SSTRCPY(fsp->dev_name, ent.mnt_special);
|
||||||
SIGAR_SSTRCPY(fsp->sys_type_name, ent.mnt_fstype);
|
SIGAR_SSTRCPY(fsp->sys_type_name, ent.mnt_fstype);
|
||||||
|
SIGAR_SSTRCPY(fsp->options, ent.mnt_mntopts);
|
||||||
sigar_fs_type_init(fsp);
|
sigar_fs_type_init(fsp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue