mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +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)
|
||||
{
|
||||
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)
|
||||
|
@ -73,6 +73,16 @@ struct inode *dmfs_create_symlink(struct inode *dir, int mode)
|
||||
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,
|
||||
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)
|
||||
{
|
||||
struct super_block *sb = inode->i_sb;
|
||||
struct dmfs_i *dmi = DMFS_I(inode);
|
||||
|
||||
switch(inode->i_mode & S_IFMT) {
|
||||
case S_IFDIR:
|
||||
if (inode->u.generic_ip) {
|
||||
dm_remove((struct mapped_device *)inode->u.generic_ip);
|
||||
}
|
||||
break;
|
||||
case S_IFREG:
|
||||
if (inode->u.generic_ip) {
|
||||
dm_put_table((struct dm_table *)inode->u.generic_ip);
|
||||
}
|
||||
break;
|
||||
if (dmi) {
|
||||
if (dmi->md)
|
||||
dm_remove(dmi->md);
|
||||
if (dmi->table)
|
||||
dm_put_table(dmi->table):
|
||||
if (dmi->dentry)
|
||||
dm_unlock_tdir(dmi->dentry);
|
||||
kfree(dmi);
|
||||
}
|
||||
|
||||
inode->u.generic_ip = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user