Esempio n. 1
0
static int sysv_symlink(struct inode * dir, struct dentry * dentry,
                        const char * symname)
{
    int err = -ENAMETOOLONG;
    int l = strlen(symname)+1;
    struct inode * inode;

    if (l > dir->i_sb->s_blocksize)
        goto out;

    inode = sysv_new_inode(dir, S_IFLNK|0777);
    err = PTR_ERR(inode);
    if (IS_ERR(inode))
        goto out;

    sysv_set_inode(inode, 0);
    err = page_symlink(inode, symname, l);
    if (err)
        goto out_fail;

    mark_inode_dirty(inode);
    err = add_nondir(dentry, inode);
out:
    return err;

out_fail:
    inode_dec_link_count(inode);
    iput(inode);
    goto out;
}
Esempio n. 2
0
static int minix_symlink(struct inode * dir, struct dentry *dentry,
	  const char * symname)
{
	int err = -ENAMETOOLONG;
	int i = strlen(symname)+1;
	struct inode * inode;

	if (i > dir->i_sb->s_blocksize)
		goto out;

	inode = minix_new_inode(dir, &err);
	if (!inode)
		goto out;

	inode->i_mode = S_IFLNK | 0777;
	minix_set_inode(inode, 0);
	err = page_symlink(inode, symname, i);
	if (err)
		goto out_fail;

	err = add_nondir(dentry, inode);
out:
	return err;

out_fail:
	dec_count(inode);
	iput(inode);
	goto out;
}
Esempio n. 3
0
File: namei.c Progetto: mhei/linux
static int minix_link(struct dentry * old_dentry, struct inode * dir,
                      struct dentry *dentry)
{
    struct inode *inode = d_inode(old_dentry);

    inode->i_ctime = current_time(inode);
    inode_inc_link_count(inode);
    ihold(inode);
    return add_nondir(dentry, inode);
}
Esempio n. 4
0
static int minix_link(struct dentry * old_dentry, struct inode * dir,
	struct dentry *dentry)
{
	struct inode *inode = old_dentry->d_inode;

	inode->i_ctime = CURRENT_TIME_SEC;
	inode_inc_link_count(inode);
	ihold(inode);
	return add_nondir(dentry, inode);
}
Esempio n. 5
0
static int sysv_mknod(struct inode * dir, struct dentry * dentry, int mode, int rdev)
{
	struct inode * inode = sysv_new_inode(dir, mode);
	int err = PTR_ERR(inode);

	if (!IS_ERR(inode)) {
		sysv_set_inode(inode, rdev);
		mark_inode_dirty(inode);
		err = add_nondir(dentry, inode);
	}
	return err;
}
Esempio n. 6
0
static int minix_link(struct dentry * old_dentry, struct inode * dir,
	struct dentry *dentry)
{
	struct inode *inode = old_dentry->d_inode;

	if (inode->i_nlink >= minix_sb(inode->i_sb)->s_link_max)
		return -EMLINK;

	inode->i_ctime = CURRENT_TIME_SEC;
	inc_count(inode);
	atomic_inc(&inode->i_count);
	return add_nondir(dentry, inode);
}
Esempio n. 7
0
static int sysv_link(struct dentry * old_dentry, struct inode * dir, 
	struct dentry * dentry)
{
	struct inode *inode = old_dentry->d_inode;

	if (inode->i_nlink >= SYSV_SB(inode->i_sb)->s_link_max)
		return -EMLINK;

	inode->i_ctime = CURRENT_TIME_SEC;
	inode_inc_link_count(inode);
	ihold(inode);

	return add_nondir(dentry, inode);
}
Esempio n. 8
0
static int minix_mknod(struct inode * dir, struct dentry *dentry, int mode, dev_t rdev)
{
	int error;
	struct inode *inode;

	if (!old_valid_dev(rdev))
		return -EINVAL;

	inode = minix_new_inode(dir, mode, &error);

	if (inode) {
		minix_set_inode(inode, rdev);
		mark_inode_dirty(inode);
		error = add_nondir(dentry, inode);
	}
	return error;
}
Esempio n. 9
0
static int sysv_link(struct dentry * old_dentry, struct inode * dir, 
	struct dentry * dentry)
{
	struct inode *inode = old_dentry->d_inode;

	if (S_ISDIR(inode->i_mode))
		return -EPERM;

	if (inode->i_nlink >= inode->i_sb->sv_link_max)
		return -EMLINK;

	inode->i_ctime = CURRENT_TIME;
	inc_count(inode);
	atomic_inc(&inode->i_count);

	return add_nondir(dentry, inode);
}
Esempio n. 10
0
static int sysv_mknod(struct inode * dir, struct dentry * dentry, umode_t mode, dev_t rdev)
{
	struct inode * inode;
	int err;

	if (!old_valid_dev(rdev))
		return -EINVAL;

	inode = sysv_new_inode(dir, mode);
	err = PTR_ERR(inode);

	if (!IS_ERR(inode)) {
		sysv_set_inode(inode, rdev);
		mark_inode_dirty(inode);
		err = add_nondir(dentry, inode);
	}
	return err;
}