use NfsFileSystem objects for nfs mounts
This commit is contained in:
parent
f00916afee
commit
6095ad4e6f
@ -276,7 +276,7 @@ JNIEXPORT jobjectArray SIGAR_JNI(Sigar_getFileSystemList)
|
|||||||
sigar_file_system_list_t fslist;
|
sigar_file_system_list_t fslist;
|
||||||
jobjectArray fsarray;
|
jobjectArray fsarray;
|
||||||
jfieldID ids[FS_FIELD_MAX];
|
jfieldID ids[FS_FIELD_MAX];
|
||||||
jclass cls = SIGAR_FIND_CLASS("FileSystem");
|
jclass nfs_cls=NULL, cls = SIGAR_FIND_CLASS("FileSystem");
|
||||||
dSIGAR(NULL);
|
dSIGAR(NULL);
|
||||||
|
|
||||||
if ((status = sigar_file_system_list_get(sigar, &fslist)) != SIGAR_OK) {
|
if ((status = sigar_file_system_list_get(sigar, &fslist)) != SIGAR_OK) {
|
||||||
@ -303,7 +303,22 @@ JNIEXPORT jobjectArray SIGAR_JNI(Sigar_getFileSystemList)
|
|||||||
|
|
||||||
for (i=0; i<fslist.number; i++) {
|
for (i=0; i<fslist.number; i++) {
|
||||||
sigar_file_system_t *fs = &(fslist.data)[i];
|
sigar_file_system_t *fs = &(fslist.data)[i];
|
||||||
jobject fsobj = JENV->AllocObject(env, cls);
|
jobject fsobj;
|
||||||
|
jclass obj_cls;
|
||||||
|
|
||||||
|
if ((fs->type == SIGAR_FSTYPE_NETWORK) &&
|
||||||
|
(strcmp(fs->sys_type_name, "nfs") == 0))
|
||||||
|
{
|
||||||
|
if (!nfs_cls) {
|
||||||
|
nfs_cls = SIGAR_FIND_CLASS("NfsFileSystem");
|
||||||
|
}
|
||||||
|
obj_cls = nfs_cls;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
obj_cls = cls;
|
||||||
|
}
|
||||||
|
|
||||||
|
fsobj = JENV->AllocObject(env, obj_cls);
|
||||||
|
|
||||||
JENV->SetStringField(env, fsobj,
|
JENV->SetStringField(env, fsobj,
|
||||||
ids[FS_FIELD_DIRNAME],
|
ids[FS_FIELD_DIRNAME],
|
||||||
|
Loading…
Reference in New Issue
Block a user