1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-18 10:04:20 +03:00

Use dmfs_ function name prefix (in line with other file systems).

This commit is contained in:
Alasdair Kergon 2001-09-14 13:27:58 +00:00
parent 1736f166bc
commit df18917b3c
4 changed files with 104 additions and 103 deletions

View File

@ -29,7 +29,7 @@ static struct inode_operations dm_dir_inode_operations;
struct vfsmount *_mnt;
static int _unlink(struct inode *dir, struct dentry *dentry);
static int dmfs_unlink(struct inode *dir, struct dentry *dentry);
#define NOT_A_TABLE ((struct dm_table *) 1)
@ -135,7 +135,7 @@ static void parse_error(const char *message, void *private)
#undef emit
}
static int _release_file(struct inode *inode, struct file *f)
static int dmfs_release(struct inode *inode, struct file *f)
{
/* FIXME: we should lock the inode to
prevent someone else opening it while
@ -176,7 +176,7 @@ static int _release_file(struct inode *inode, struct file *f)
return 0;
}
void _release_inode(struct inode *inode)
void dmfs_put_inode(struct inode *inode)
{
struct mapped_device *md = (struct mapped_device *) inode->u.generic_ip;
struct dm_table *table = (struct dm_table *) inode->u.generic_ip;
@ -195,7 +195,7 @@ void _release_inode(struct inode *inode)
force_delete(inode);
}
static int _statfs(struct super_block *sb, struct statfs *buf)
static int dmfs_statfs(struct super_block *sb, struct statfs *buf)
{
buf->f_type = DM_MAGIC;
buf->f_bsize = PAGE_CACHE_SIZE;
@ -207,7 +207,7 @@ static int _statfs(struct super_block *sb, struct statfs *buf)
* Lookup the data. This is trivial - if the dentry didn't already
* exist, we know it is negative.
*/
static struct dentry * _lookup(struct inode *dir, struct dentry *dentry)
static struct dentry *dmfs_lookup(struct inode *dir, struct dentry *dentry)
{
d_add(dentry, NULL);
return NULL;
@ -217,7 +217,7 @@ static struct dentry * _lookup(struct inode *dir, struct dentry *dentry)
* Read a page. Again trivial. If it didn't already exist
* in the page cache, it is zero-filled.
*/
static int _readpage(struct file *file, struct page * page)
static int dmfs_readpage(struct file *file, struct page *page)
{
if (!Page_Uptodate(page)) {
memset(kmap(page), 0, PAGE_CACHE_SIZE);
@ -233,14 +233,14 @@ static int _readpage(struct file *file, struct page * page)
* Writing: just make sure the page gets marked dirty, so that
* the page stealer won't grab it.
*/
static int _writepage(struct page *page)
static int dmfs_writepage(struct page *page)
{
SetPageDirty(page);
UnlockPage(page);
return 0;
}
static int _prepare_write(struct file *file, struct page *page,
static int dmfs_prepare_write(struct file *file, struct page *page,
unsigned offset, unsigned to)
{
void *addr = kmap(page);
@ -253,7 +253,7 @@ static int _prepare_write(struct file *file, struct page *page,
return 0;
}
static int _commit_write(struct file *file, struct page *page,
static int dmfs_commit_write(struct file *file, struct page *page,
unsigned offset, unsigned to)
{
struct inode *inode = page->mapping->host;
@ -265,7 +265,7 @@ static int _commit_write(struct file *file, struct page *page,
return 0;
}
struct inode *_get_inode(struct super_block *sb, int mode, int dev)
struct inode *dmfs_get_inode(struct super_block *sb, int mode, int dev)
{
struct inode *inode = new_inode(sb);
@ -277,8 +277,7 @@ struct inode *_get_inode(struct super_block *sb, int mode, int dev)
inode->i_blocks = 0;
inode->i_rdev = NODEV;
inode->i_mapping->a_ops = &dm_aops;
inode->i_atime = inode->i_mtime =
inode->i_ctime = CURRENT_TIME;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
switch (mode & S_IFMT) {
case S_IFBLK:
case S_IFCHR:
@ -304,10 +303,10 @@ struct inode *_get_inode(struct super_block *sb, int mode, int dev)
/*
* File creation. Allocate an inode, and we're done..
*/
static int _mknod(struct inode *dir, struct dentry *dentry, int mode)
static int dmfs_mknod(struct inode *dir, struct dentry *dentry, int mode)
{
int error = -ENOSPC;
struct inode *inode = _get_inode(dir->i_sb, mode, 0);
struct inode *inode = dmfs_get_inode(dir->i_sb, mode, 0);
if (inode) {
d_instantiate(dentry, inode);
@ -318,7 +317,7 @@ static int _mknod(struct inode *dir, struct dentry *dentry, int mode)
return error;
}
static int _mkdir(struct inode * dir, struct dentry * dentry, int mode)
static int dmfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
{
int r;
const char *name = (const char *) dentry->d_name.name;
@ -330,7 +329,7 @@ static int _mkdir(struct inode * dir, struct dentry * dentry, int mode)
if (r)
return r;
r = _mknod(dir, dentry, mode | S_IFDIR);
r = dmfs_mknod(dir, dentry, mode | S_IFDIR);
if (r) {
dm_remove(name);
return r;
@ -341,9 +340,9 @@ static int _mkdir(struct inode * dir, struct dentry * dentry, int mode)
return 0;
}
static int _rmdir(struct inode *dir, struct dentry *dentry)
static int dmfs_rmdir(struct inode *dir, struct dentry *dentry)
{
int r = _unlink(dir, dentry);
int r = dmfs_unlink(dir, dentry);
if (r)
return r;
@ -352,11 +351,11 @@ static int _rmdir(struct inode *dir, struct dentry *dentry)
return 0;
}
static int _create(struct inode *dir, struct dentry *dentry, int mode)
static int dmfs_create(struct inode *dir, struct dentry *dentry, int mode)
{
int r;
if ((r = _mknod(dir, dentry, mode | S_IFREG)))
if ((r = dmfs_mknod(dir, dentry, mode | S_IFREG)))
return r;
dentry->d_inode->u.generic_ip = 0;
@ -400,7 +399,7 @@ static int _empty(struct dentry *dentry)
* This works for both directories and regular files.
* (non-directories will always have empty subdirs)
*/
static int _unlink(struct inode *dir, struct dentry *dentry)
static int dmfs_unlink(struct inode *dir, struct dentry *dentry)
{
int retval = -ENOTEMPTY;
@ -420,7 +419,7 @@ static int _unlink(struct inode *dir, struct dentry *dentry)
* it exists so that the VFS layer correctly free's it when it
* gets overwritten.
*/
static int _rename(struct inode * old_dir, struct dentry *old_dentry,
static int dmfs_rename(struct inode *old_dir, struct dentry *old_dentry,
struct inode *new_dir, struct dentry *new_dentry)
{
struct inode *inode = new_dentry->d_inode;
@ -450,53 +449,53 @@ static int _rename(struct inode * old_dir, struct dentry *old_dentry,
return 0;
}
static int _sync_file(struct file * file, struct dentry *dentry,
static int dmfs_sync_file(struct file *file, struct dentry *dentry,
int datasync)
{
return 0;
}
static struct address_space_operations dm_aops = {
readpage: _readpage,
writepage: _writepage,
prepare_write: _prepare_write,
commit_write: _commit_write
readpage: dmfs_readpage,
writepage: dmfs_writepage,
prepare_write: dmfs_prepare_write,
commit_write: dmfs_commit_write
};
static struct file_operations dm_file_operations = {
read: generic_file_read,
write: generic_file_write,
mmap: generic_file_mmap,
fsync: _sync_file,
release: _release_file,
fsync: dmfs_sync_file,
release: dmfs_release,
};
static struct file_operations dm_dir_operations = {
read: generic_read_dir,
readdir: dcache_readdir,
fsync: _sync_file,
fsync: dmfs_sync_file,
};
static struct inode_operations root_dir_inode_operations = {
lookup: _lookup,
mkdir: _mkdir,
rmdir: _rmdir,
rename: _rename,
lookup: dmfs_lookup,
mkdir: dmfs_mkdir,
rmdir: dmfs_rmdir,
rename: dmfs_rename,
};
static struct inode_operations dm_dir_inode_operations = {
create: _create,
lookup: _lookup,
unlink: _unlink,
rename: _rename,
create: dmfs_create,
lookup: dmfs_lookup,
unlink: dmfs_unlink,
rename: dmfs_rename,
};
static struct super_operations dm_ops = {
statfs: _statfs,
put_inode: _release_inode,
statfs: dmfs_statfs,
put_inode: dmfs_put_inode,
};
static struct super_block *_read_super(struct super_block * sb, void * data,
static struct super_block *dmfs_read_super(struct super_block *sb, void *data,
int silent)
{
struct inode *inode;
@ -506,7 +505,7 @@ static struct super_block *_read_super(struct super_block * sb, void * data,
sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
sb->s_magic = DM_MAGIC;
sb->s_op = &dm_ops;
inode = _get_inode(sb, S_IFDIR | 0755, 0);
inode = dmfs_get_inode(sb, S_IFDIR | 0755, 0);
inode->i_op = &root_dir_inode_operations;
if (!inode)
return NULL;
@ -520,9 +519,9 @@ static struct super_block *_read_super(struct super_block * sb, void * data,
return sb;
}
static DECLARE_FSTYPE(_fs_type, "dm-fs", _read_super, FS_SINGLE);
static DECLARE_FSTYPE(_fs_type, "dmfs", dmfs_read_super, FS_SINGLE);
int __init dm_fs_init(void)
int __init dmfs_init(void)
{
int r;
if ((r = register_filesystem(&_fs_type)))
@ -531,14 +530,14 @@ int __init dm_fs_init(void)
_mnt = kern_mount(&_fs_type);
if (IS_ERR(_mnt)) {
dm_fs_exit();
dmfs_exit();
return PTR_ERR(_mnt);
}
return 0;
}
void __exit dm_fs_exit(void)
void __exit dmfs_exit(void)
{
unregister_filesystem(&_fs_type);
}

View File

@ -148,5 +148,7 @@ module_exit(linear_exit);
MODULE_AUTHOR("Joe Thornber <thornber@uk.sistina.com>");
MODULE_DESCRIPTION("Device Mapper: Linear mapping");
#ifdef MODULE_LICENSE
MODULE_LICENSE("GPL");
#endif

View File

@ -79,7 +79,8 @@ static int dm_init(void)
0, 0, NULL, NULL)))
return -ENOMEM;
if ((ret = dm_fs_init()) || (ret = dm_target_init()) || (ret = dm_init_blkdev()))
if ((ret = dmfs_init()) || (ret = dm_target_init())
|| (ret = dm_init_blkdev()))
return ret;
/* set up the arrays */
@ -97,7 +98,6 @@ static int dm_init(void)
_dev_dir = devfs_mk_dir(0, _fs_dir, NULL);
printk(KERN_INFO "%s %d.%d.%d initialised\n", _name,
_version[0], _version[1], _version[2]);
return 0;
@ -108,7 +108,7 @@ static void dm_exit(void)
if (kmem_cache_destroy(_io_hook_cache))
WARN("it looks like there are still some io_hooks allocated");
dm_fs_exit();
dmfs_exit();
dm_cleanup_blkdev();
if (devfs_unregister_blkdev(MAJOR_NR, _name) < 0)
@ -233,7 +233,8 @@ static int dm_blk_ioctl(struct inode *inode, struct file *file,
return 0;
case BLKRAGET:
if (copy_to_user((void *) a, &read_ahead[MAJOR(inode->i_rdev)],
if (copy_to_user
((void *) a, &read_ahead[MAJOR(inode->i_rdev)],
sizeof (long)))
return -EFAULT;
return 0;
@ -754,7 +755,6 @@ void dm_suspend(struct mapped_device *md)
up_write(&_dev_lock);
}
struct block_device_operations dm_blk_dops = {
open: dm_blk_open,
release: dm_blk_close,

View File

@ -249,8 +249,8 @@ int dm_init_blkdev(void);
void dm_cleanup_blkdev(void);
/* dm-fs.c */
int dm_fs_init(void);
void dm_fs_exit(void);
int dmfs_init(void);
void dmfs_exit(void);