No functional changes.
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
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
+++ /dev/null
-/* -*- 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 */
#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"
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);
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;
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;
reset_limits(asb, ¶ms);
- 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;
}
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;
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:
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();
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();
* 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
+++ /dev/null
-/* -*- 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);
-}
+++ /dev/null
-/* -*- 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 */
#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 {
/*
* 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)
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;
}
if (copy_from_user(ar->data, buf, size))
return -EFAULT;
-
+
rv = tctxt->write_op(file, ar->data, size);
if (rv>0) {
ar->size = rv;
{
struct argresp *ar;
ssize_t rv = 0;
-
+
if (file->private_data == NULL)
rv = TA_write(file, buf, 0, pos);
if (rv < 0)
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;
* 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"