]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
oracleasm: Various code and whitespace cleanups.
authorMartin K. Petersen <martin.petersen@oracle.com>
Wed, 22 Apr 2015 13:35:26 +0000 (09:35 -0400)
committerSantosh Shilimkar <santosh.shilimkar@oracle.com>
Mon, 29 Jun 2015 15:34:53 +0000 (08:34 -0700)
No functional changes.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/block/oracleasm/Makefile
drivers/block/oracleasm/compat.h [deleted file]
drivers/block/oracleasm/driver.c
drivers/block/oracleasm/integrity.c
drivers/block/oracleasm/proc.c [deleted file]
drivers/block/oracleasm/proc.h [deleted file]
drivers/block/oracleasm/transaction_file.c
include/linux/oracleasm/manager.h

index edac43fe191cd1bd4cc24bcbb8bd2182548da1bd..f37ee5978f20d9cfefe13dde9ab37ae313a81a75 100644 (file)
@@ -1,5 +1,5 @@
 
 obj-$(CONFIG_ORACLEASM) := oracleasm.o
-oracleasm-y += driver.o  masklog.o  proc.o  transaction_file.o
+oracleasm-y += driver.o  masklog.o  transaction_file.o
 oracleasm-$(CONFIG_BLK_DEV_INTEGRITY) += integrity.o
 
diff --git a/drivers/block/oracleasm/compat.h b/drivers/block/oracleasm/compat.h
deleted file mode 100644 (file)
index 1c3a2a4..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; -*-
- * vim: noexpandtab sw=8 ts=8 sts=0:
- *
- * compat.h
- *
- * Copyright (c) 2004-2009 Oracle Corporation.  All rights reserved.
- */
-
-
-#ifndef _COMPAT_H
-#define _COMPAT_H
-
-/*
- * Modern kernels don't need this.  Older kernels will have it defined
- * by the compat code.
- */
-#ifndef set_i_blksize
-# define set_i_blksize(i, bs) do { /* Nothing */ } while (0)
-#endif
-
-#endif  /* _COMPAT_H */
index af26fbb2eafe72fd8ec6961eaf4f2ba18a9fbb02..f12b9c93d7b4d632e9ae58d69629e33eb6de942b 100644 (file)
@@ -83,9 +83,7 @@
 
 #include "linux/oracleasm/module_version.h"
 
-#include "compat.h"
 #include "masklog.h"
-#include "proc.h"
 #include "transaction_file.h"
 #include "request.h"
 #include "integrity.h"
@@ -127,6 +125,7 @@ static struct inode_operations asmfs_iid_dir_inode_operations;
 static struct kmem_cache       *asm_request_cachep;
 static struct kmem_cache       *asmfs_inode_cachep;
 static struct kmem_cache       *asmdisk_cachep;
+static struct proc_dir_entry   *asm_proc;
 
 static bool use_logical_block_size = false;
 module_param(use_logical_block_size, bool, 0644);
@@ -516,7 +515,6 @@ static int asmfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, d
        inode->i_mode = mode;
        inode->i_uid = current_fsuid();
        inode->i_gid = current_fsgid();
-       set_i_blksize(inode, PAGE_CACHE_SIZE);
        inode->i_blocks = 0;
        inode->i_rdev = 0;
        inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
@@ -550,7 +548,6 @@ static int asmfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
        inode->i_mode = mode;
        inode->i_uid = current_fsuid();
        inode->i_gid = current_fsgid();
-       set_i_blksize(inode, PAGE_CACHE_SIZE);
        inode->i_blocks = 0;
        inode->i_rdev = 0;
        inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
@@ -656,11 +653,9 @@ static int asmfs_remount(struct super_block * sb, int * flags, char * data)
 
        reset_limits(asb, &params);
 
-       printk(KERN_DEBUG
-              "ASM: oracleasmfs remounted with options: %s\n",
-              data ? (char *)data : "<defaults>" );
-       printk(KERN_DEBUG "ASM: maxinstances=%ld\n",
-              asb->max_inodes);
+       pr_debug("ASM: oracleasmfs remounted with options: %s\n",
+                data ? (char *)data : "<defaults>" );
+       pr_debug("ASM:  maxinstances=%ld\n", asb->max_inodes);
 
        return 0;
 }
@@ -2746,7 +2741,6 @@ static int asmfs_fill_super(struct super_block *sb,
        inode->i_mode = S_IFDIR | 0755;
        inode->i_uid = GLOBAL_ROOT_UID;
        inode->i_gid = GLOBAL_ROOT_GID;
-       set_i_blksize(inode, PAGE_CACHE_SIZE);
        inode->i_blocks = 0;
        inode->i_rdev = 0;
        inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
@@ -2849,9 +2843,9 @@ static int asmfs_fill_super(struct super_block *sb,
        sb->s_root = root;
 
 
-       printk(KERN_DEBUG "ASM: oracleasmfs mounted with options: %s\n",
-              data ? (char *)data : "<defaults>" );
-       printk(KERN_DEBUG "ASM: maxinstances=%ld\n", asb->max_inodes);
+       pr_debug("ASM: oracleasmfs mounted with options: %s\n",
+                data ? (char *)data : "<defaults>" );
+       pr_debug("ASM: maxinstances=%ld\n", asb->max_inodes);
        return 0;
 
 out_genocide:
@@ -2899,39 +2893,48 @@ static int __init init_asmfs_fs(void)
 
        ret = init_inodecache();
        if (ret) {
-               printk("oracleasmfs: Unable to create asmfs_inode_cache\n");
+               pr_err("oracleasmfs: Unable to create asmfs_inode_cache\n");
                goto out_inodecache;
        }
 
        ret = init_requestcache();
        if (ret) {
-               printk("oracleasmfs: Unable to create asm_request cache\n");
+               pr_err("oracleasmfs: Unable to create asm_request cache\n");
                goto out_requestcache;
        }
 
        ret = init_asmdiskcache();
        if (ret) {
-               printk("oracleasmfs: Unable to initialize the disk cache\n");
+               pr_err("oracleasmfs: Unable to initialize the disk cache\n");
                goto out_diskcache;
        }
 
-       ret = init_oracleasm_proc();
-       if (ret) {
-               printk("oracleasmfs: Unable to register proc entries\n");
+       asm_proc = proc_mkdir(ASM_PROC_PATH, NULL);
+       if (asm_proc == NULL) {
+               pr_err("oracleasmfs: Unable to register proc directory\n");
                goto out_proc;
        }
 
+       ret = mlog_init_proc(asm_proc);
+       if (ret) {
+               pr_err("oracleasmfs: Unable to register proc mlog\n");
+               goto out_mlog;
+       }
+
        init_asmfs_dir_operations();
        ret = register_filesystem(&asmfs_fs_type);
        if (ret) {
-               printk("oracleasmfs: Unable to register filesystem\n");
+               pr_err("oracleasmfs: Unable to register filesystem\n");
                goto out_register;
        }
 
        return 0;
 
 out_register:
-       exit_oracleasm_proc();
+       mlog_remove_proc(asm_proc);
+
+out_mlog:
+       remove_proc_entry(ASM_PROC_PATH, NULL);
 
 out_proc:
        destroy_asmdiskcache();
@@ -2949,7 +2952,8 @@ out_inodecache:
 static void __exit exit_asmfs_fs(void)
 {
        unregister_filesystem(&asmfs_fs_type);
-       exit_oracleasm_proc();
+       mlog_remove_proc(asm_proc);
+       remove_proc_entry(ASM_PROC_PATH, NULL);
        destroy_asmdiskcache();
        destroy_requestcache();
        destroy_inodecache();
index 059f5ad237ee5e626f061960d66bca8dce5ff13e..c92b96104ed81c22d26c76fc15453da0de1c2ea2 100644 (file)
@@ -23,7 +23,7 @@
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public
  * License, version 2 as published by the Free Software Foundation.
- * 
+ *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
diff --git a/drivers/block/oracleasm/proc.c b/drivers/block/oracleasm/proc.c
deleted file mode 100644 (file)
index d79e0c6..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; -*-
- * vim: noexpandtab sw=8 ts=8 sts=0:
- *
- * Copyright (C) 2006 Oracle.  All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation, version 2.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
- */
-
-#include <linux/module.h>
-#include <linux/proc_fs.h>
-
-#include "proc.h"
-#include "masklog.h"
-
-static struct proc_dir_entry *asm_proc;
-#define ASM_PROC_PATH "fs/oracleasm"
-
-int init_oracleasm_proc(void)
-{
-       int rc;
-
-       asm_proc = proc_mkdir(ASM_PROC_PATH, NULL);
-       if (asm_proc == NULL) {
-               rc = -ENOMEM; /* shrug */
-               goto out;
-       }
-
-       rc = mlog_init_proc(asm_proc);
-       if (rc)
-               remove_proc_entry(ASM_PROC_PATH, NULL);
-
-out:
-       return rc;
-}
-
-void exit_oracleasm_proc(void)
-{
-       mlog_remove_proc(asm_proc);
-       remove_proc_entry(ASM_PROC_PATH, NULL);
-}
diff --git a/drivers/block/oracleasm/proc.h b/drivers/block/oracleasm/proc.h
deleted file mode 100644 (file)
index 38aedfd..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; -*-
- * vim: noexpandtab sw=8 ts=8 sts=0:
- *
- * Copyright (C) 2006 Oracle.  All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation, version 2.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
- */
-
-#ifndef __ASM_PROC_H
-#define __ASM_PROC_H
-
-int init_oracleasm_proc(void);
-void exit_oracleasm_proc(void);
-
-#endif  /* _ASM_PROC_H */
index dd368f369b2de59bbf7e94cca05d3b49164e7afa..bdb809d4bfd3f5e89a658b3afcb1efa3c9eb25a4 100644 (file)
 #include <asm/uaccess.h>
 
 #include "transaction_file.h"
-#include "compat.h"
 
 #define TRANSACTION_CONTEXT(i) ((i)->i_private)
 
-/* an argresp is stored in an allocated page and holds the 
+/* an argresp is stored in an allocated page and holds the
  * size of the argument or response, along with its content
  */
 struct argresp {
@@ -34,7 +33,7 @@ struct argresp {
 /*
  * transaction based IO methods.
  * The file expects a single write which triggers the transaction, and then
- * possibly a read which collects the result - which is stored in a 
+ * possibly a read which collects the result - which is stored in a
  * file-local buffer.
  */
 static ssize_t TA_write(struct file *file, const char *buf, size_t size, loff_t *pos)
@@ -46,7 +45,7 @@ static ssize_t TA_write(struct file *file, const char *buf, size_t size, loff_t
 
        if (!tctxt || !tctxt->write_op)
                return -EINVAL;
-       if (file->private_data) 
+       if (file->private_data)
                return -EINVAL; /* only one write allowed per open */
        if (size > PAGE_SIZE - sizeof(struct argresp))
                return -EFBIG;
@@ -67,7 +66,7 @@ static ssize_t TA_write(struct file *file, const char *buf, size_t size, loff_t
        }
        if (copy_from_user(ar->data, buf, size))
                return -EFAULT;
-       
+
        rv =  tctxt->write_op(file, ar->data, size);
        if (rv>0) {
                ar->size = rv;
@@ -81,7 +80,7 @@ static ssize_t TA_read(struct file *file, char *buf, size_t size, loff_t *pos)
 {
        struct argresp *ar;
        ssize_t rv = 0;
-       
+
        if (file->private_data == NULL)
                rv = TA_write(file, buf, 0, pos);
        if (rv < 0)
@@ -153,7 +152,6 @@ struct inode *new_transaction_inode(struct super_block *sb, int mode, struct tra
        inode->i_mode = S_IFREG | mode;
        inode->i_uid = current_fsuid();
        inode->i_gid = current_fsgid();
-       set_i_blksize(inode, PAGE_CACHE_SIZE);
        inode->i_blocks = 0;
        inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
        inode->i_fop = &transaction_ops;
index b83807f5ca1b04b822953ed7fc3bab8413fd225f..0e0d63c7b25150a9c48de3ccd90b0668e4575d35 100644 (file)
@@ -77,6 +77,7 @@
  * oracleasmfs is mounted.  Default is ASM_MANAGER_DEFAULT
  */
 #define ASM_MANAGER_DEFAULT            "/dev/oracleasm"
+#define ASM_PROC_PATH                  "fs/oracleasm"
 
 /* Subdirectories of the manager device */
 #define ASM_MANAGER_DISKS              "disks"