mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-04 09:18:36 +03:00
Just a small sync of pending changes before I start looking at this again
more seriously. o Odds and ends
This commit is contained in:
parent
ee1f91bf27
commit
b82172a98a
@ -24,8 +24,14 @@
|
|||||||
|
|
||||||
static ssize_t dmfs_error_read(struct file *file, char *buf, size_t size, loff_t *pos)
|
static ssize_t dmfs_error_read(struct file *file, char *buf, size_t size, loff_t *pos)
|
||||||
{
|
{
|
||||||
|
struct dmfs_i *dmi = DMFS_I(file->f_dentry->d_parent->d_inode);
|
||||||
|
struct dm_table *t = dmi->table;
|
||||||
|
int copied = 0;
|
||||||
|
|
||||||
return size;
|
if (!access_ok(VERIFY_WRITE, buf, count))
|
||||||
|
return -EFAULT;
|
||||||
|
|
||||||
|
return copied;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dmfs_error_sync(struct file *file, struct dentry *dentry, int datasync)
|
static int dmfs_error_sync(struct file *file, struct dentry *dentry, int datasync)
|
||||||
|
@ -73,6 +73,16 @@ struct inode *dmfs_create_symlink(struct inode *dir, int mode)
|
|||||||
return inode;
|
return inode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int dmfs_lv_unlink(struct inode *inode, struct dentry *dentry)
|
||||||
|
{
|
||||||
|
if (!(inode->i_mode & S_IFLNK))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
inode->n_link--;
|
||||||
|
dput(dentry);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int dmfs_lv_symlink(struct inode *dir, struct dentry *dentry,
|
static int dmfs_lv_symlink(struct inode *dir, struct dentry *dentry,
|
||||||
const char *symname)
|
const char *symname)
|
||||||
{
|
{
|
||||||
|
@ -38,18 +38,16 @@ static int dmfs_statfs(struct super_block *sb, struct statfs *buf)
|
|||||||
static void dmfs_delete_inode(struct inode *inode)
|
static void dmfs_delete_inode(struct inode *inode)
|
||||||
{
|
{
|
||||||
struct super_block *sb = inode->i_sb;
|
struct super_block *sb = inode->i_sb;
|
||||||
|
struct dmfs_i *dmi = DMFS_I(inode);
|
||||||
|
|
||||||
switch(inode->i_mode & S_IFMT) {
|
if (dmi) {
|
||||||
case S_IFDIR:
|
if (dmi->md)
|
||||||
if (inode->u.generic_ip) {
|
dm_remove(dmi->md);
|
||||||
dm_remove((struct mapped_device *)inode->u.generic_ip);
|
if (dmi->table)
|
||||||
}
|
dm_put_table(dmi->table):
|
||||||
break;
|
if (dmi->dentry)
|
||||||
case S_IFREG:
|
dm_unlock_tdir(dmi->dentry);
|
||||||
if (inode->u.generic_ip) {
|
kfree(dmi);
|
||||||
dm_put_table((struct dm_table *)inode->u.generic_ip);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inode->u.generic_ip = NULL;
|
inode->u.generic_ip = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user