diff options
author | Jan Synacek <jsynacek@redhat.com> | 2013-12-17 10:27:15 +0100 |
---|---|---|
committer | Jan Synacek <jsynacek@redhat.com> | 2013-12-17 11:11:03 +0100 |
commit | 67ae76aecfac0b04f22bea07b87bd7a8ce04a711 (patch) | |
tree | 55da46583bc833564ff8a27625dff80565342e9e /src/logicalfile/file.h | |
parent | 9a3adaf677fe49c016774c98e016140055c36afb (diff) | |
download | openlmi-providers-67ae76aecfac0b04f22bea07b87bd7a8ce04a711.tar.gz openlmi-providers-67ae76aecfac0b04f22bea07b87bd7a8ce04a711.tar.xz openlmi-providers-67ae76aecfac0b04f22bea07b87bd7a8ce04a711.zip |
logicalfile: correctly fill FSCreationClassName and FSName
Files residing on nodevice or remote filesystems now correctly set these
properties. FSCreationClassName is set to "LMI_TransientFileSystem" and
FSName is set to "PATH=<path to file>". This behavior is consistent with
how storage providers set those properties. To check for filesystem, the
provider uses udev and checks for ID_FS_UUID_ENC and DEVNAME fields. If
these are not found, filesystem is then considered nodevice or remote.
Additional test for files on transient filesystems has been added.
Diffstat (limited to 'src/logicalfile/file.h')
-rw-r--r-- | src/logicalfile/file.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/logicalfile/file.h b/src/logicalfile/file.h index 09c428a..a95cb46 100644 --- a/src/logicalfile/file.h +++ b/src/logicalfile/file.h @@ -48,7 +48,8 @@ const ConfigEntry *provider_config_defaults; const char *provider_name; -#define FSCREATIONCLASSNAME "LMI_LocalFileSystem" +#define FSCREATIONCLASSNAME_LOCAL "LMI_LocalFileSystem" +#define FSCREATIONCLASSNAME_TRANSIENT "LMI_TransientFileSystem" #define GROUP_COMPONENT "GroupComponent" #define PART_COMPONENT "PartComponent" #define SAME_ELEMENT "SameElement" @@ -77,17 +78,17 @@ const char *provider_name; ) #define stoms(t) ((t)*1000000) -#define fill_logicalfile(type, obj, name, fsname, creation_class) \ +#define fill_logicalfile(type, obj, name, fsclassname, fsname, creation_class) \ type##_Set_Name((obj), (name)); \ type##_Set_CSCreationClassName((obj), get_system_creation_class_name()); \ type##_Set_CSName((obj), get_system_name()); \ - type##_Set_FSCreationClassName((obj), FSCREATIONCLASSNAME); \ + type##_Set_FSCreationClassName((obj), fsclassname); \ type##_Set_FSName((obj), (fsname)); \ type##_Set_CreationClassName((obj), (creation_class)); -#define fill_basic(b, cmpitype, lmi_file, creation_class_name, fsname, sb) \ +#define fill_basic(b, cmpitype, lmi_file, creation_class_name, fsclassname, fsname, sb) \ LMI_##cmpitype##_Set_CreationClassName(lmi_file, creation_class_name); \ - LMI_##cmpitype##_Set_FSCreationClassName(lmi_file, FSCREATIONCLASSNAME); \ + LMI_##cmpitype##_Set_FSCreationClassName(lmi_file, fsclassname); \ LMI_##cmpitype##_Set_FSName(lmi_file, fsname); \ LMI_##cmpitype##_Set_Readable(lmi_file, sb_isreadable(sb)); \ LMI_##cmpitype##_Set_Writeable(lmi_file, sb_iswriteable(sb)); \ @@ -125,8 +126,8 @@ typedef struct { CMPIStatus lmi_check_required(const CMPIBroker *, const CMPIContext *, const CMPIObjectPath *); void get_class_from_stat(const struct stat *, char *); int get_class_from_path(const char *, char *); -CMPIStatus get_fsname_from_stat(const CMPIBroker *, const struct stat *, char **); -CMPIStatus get_fsname_from_path(const CMPIBroker *, const char *, char **); +CMPIStatus get_fsinfo_from_stat(const CMPIBroker *, const struct stat *, const char *, char **, char **); +CMPIStatus get_fsinfo_from_path(const CMPIBroker *, const char *, char **, char **); const char *get_string_property_from_op(const CMPIObjectPath *, const char *); CMPIStatus check_assoc_class(const CMPIBroker *, const char *, const char *, const char *); CMPIStatus stat_logicalfile_and_fill(const CMPIBroker *, logicalfile_t *, mode_t, const char *); |