コード例 #1
0
ファイル: dir.c プロジェクト: Mr-Aloof/wl500g
int coda_rmdir(struct inode *dir, struct dentry *de)
{
	const char *name = de->d_name.name;
	int len = de->d_name.len;
        int error;

	lock_kernel();
	coda_vfs_stat.rmdir++;

	if (!d_unhashed(de)) {
		unlock_kernel();
		return -EBUSY;
	}
	error = venus_rmdir(dir->i_sb, coda_i2f(dir), name, len);

        if ( error ) {
		unlock_kernel();
                return error;
        }

	coda_dir_changed(dir, -1);
	drop_nlink(de->d_inode);
	d_delete(de);
	unlock_kernel();

        return 0;
}
コード例 #2
0
static int coda_rmdir(struct inode *dir, struct dentry *de)
{
	const char *name = de->d_name.name;
	int len = de->d_name.len;
	int error;

	error = venus_rmdir(dir->i_sb, coda_i2f(dir), name, len);
	if (!error) {
		
		if (de->d_inode)
			clear_nlink(de->d_inode);

		
		coda_dir_drop_nlink(dir);
		coda_dir_update_mtime(dir);
	}
	return error;
}
コード例 #3
0
ファイル: dir.c プロジェクト: CSCLOG/beaglebone
static int coda_rmdir(struct inode *dir, struct dentry *de)
{
	const char *name = de->d_name.name;
	int len = de->d_name.len;
	int error;

	error = venus_rmdir(dir->i_sb, coda_i2f(dir), name, len);
	if (!error) {
		/* VFS may delete the child */
		if (de->d_inode)
		    de->d_inode->i_nlink = 0;

		/* fix the link count of the parent */
		coda_dir_drop_nlink(dir);
		coda_dir_update_mtime(dir);
	}
	return error;
}
int coda_rmdir(struct inode *dir, struct dentry *de)
{
	const char *name = de->d_name.name;
	int len = de->d_name.len;
        int error;

	coda_vfs_stat.rmdir++;

	if (!d_unhashed(de))
		return -EBUSY;
	error = venus_rmdir(dir->i_sb, coda_i2f(dir), name, len);

        if ( error ) {
                CDEBUG(D_INODE, "upc returned error %d\n", error);
                return error;
        }

	coda_dir_changed(dir, -1);
	de->d_inode->i_nlink--;
	d_delete(de);

        return 0;
}