Skip to contentSkip to conversation

s390: Hypervisor File System

PATCH Michael Holzheu 2 participants 3 messages Apr 28, 2006 – May 2, 2006 s390

lore
Share & tools
lore
#0 lore raw

Hi Andrew,

Here the patch with the bugfixes for your and Pekka's comments:

- move some globals into the superblock
- remove some inlines
- fix some error handling functions
- implement diag204_get_buffer() helper function
- "hypfs" prefix for global functions
- use uid_t and gid_t
- use kstrdup()
- Cosmetics

---

 arch/s390/Kconfig            |    2
 arch/s390/hypfs/hypfs_diag.c |  127 +++++++++++++++++++++++++++----------------
 arch/s390/hypfs/hypfs_diag.h |    6 +-
 arch/s390/hypfs/inode.c      |  107 ++++++++++++++++++++----------------
 4 files changed, 145 insertions(+), 97 deletions(-)
arch/s390/Kconfig +1 -1
diff -urpN linux-2.6.16-hypfs-2006-04-28/arch/s390/Kconfig linux-2.6.16-hypfs-2006-04-28-FIXED/arch/s390/Kconfig
@@ -447,7 +447,7 @@ config HYPFS_FS
 	default y
 	help
 	  This is a virtual file system intended to provide accounting
-	  information in a s390 hypervisor environment.
+	  information in an s390 hypervisor environment.
 
 config KEXEC
 	bool "kexec system call (EXPERIMENTAL)"
arch/s390/hypfs/hypfs_diag.c +80 -47

219 lines not on this page · raw message

arch/s390/hypfs/hypfs_diag.h +3 -3
diff -urpN linux-2.6.16-hypfs-2006-04-28/arch/s390/hypfs/hypfs_diag.h linux-2.6.16-hypfs-2006-04-28-FIXED/arch/s390/hypfs/hypfs_diag.h
@@ -9,8 +9,8 @@
 #ifndef _HYPFS_DIAG_H_
 #define _HYPFS_DIAG_H_
 
-extern int diag_init(void);
-extern void diag_exit(void);
-extern int diag_create_files(struct super_block *sb, struct dentry *root);
+extern int hypfs_diag_init(void);
+extern void hypfs_diag_exit(void);
+extern int hypfs_diag_create_files(struct super_block *sb, struct dentry *root);
 
 #endif /* _HYPFS_DIAG_H_ */
arch/s390/hypfs/inode.c +61 -46

237 lines not on this page · raw message

#1 lore raw

arch/s390/hypfs/hypfs_diag.c static inline int diag204(unsigned long · line 358

Quoted 12 lines · Michael Holzheu
arch/s390/hypfs/hypfs_diag.c +11 -0
+static void *diag204_get_buffer(enum diag204_format fmt, int *pages)
+{
+	void *buf;
+
+	if (fmt == INFO_SIMPLE)
+		*pages = 1;
+	else
+		*pages = diag204(SUBC_RSI | fmt, 0, 0);
+
+	if (*pages <= 0)
+		return ERR_PTR(-ENOSYS);

Is -ENOSYS the right thing here? I thought it was for stuff not implemented by Linux. If the hardware or some hypervisor would return -ENOSYS, it would be -EIO from Linux' perspective. But I may be wrong.

Jörn

Signature · 2 lines
Everything should be made as simple as possible, but not simpler.
-- Albert Einstein
#2 lore raw

Jörn Engel <[email protected]> wrote on 04/28/2006 07:47:54 PM:

Quoted 18 lines · Michael Holzheu

arch/s390/hypfs/hypfs_diag.c static inline int diag204(unsigned long · line 358

Quoted 12 lines
arch/s390/hypfs/hypfs_diag.c +11 -0
+static void *diag204_get_buffer(enum diag204_format fmt, int *pages)
+{
+   void *buf;
+
+   if (fmt == INFO_SIMPLE)
+      *pages = 1;
+   else
+      *pages = diag204(SUBC_RSI | fmt, 0, 0);
+
+   if (*pages <= 0)
+      return ERR_PTR(-ENOSYS);

Is -ENOSYS the right thing here? I thought it was for stuff not implemented by Linux. If the hardware or some hypervisor would return -ENOSYS, it would be -EIO from Linux' perspective. But I may be wrong.

The only case "diag204(SUBC_RSI | fmt, 0, 0)" can fail is, if it is not implemented by the hardware. The means ENOSYS (Function not implemented), doen't it?

Michael