Skip to content

Commit

Permalink
ufs: Remove dead quota code
Browse files Browse the repository at this point in the history
UFS quota is non-functional at least since 2.6.12 because dq_op was set
to NULL. Since the filesystem exists mainly to allow cooperation with Solaris
and quota format isn't standard, just remove the dead code.

CC: Evgeniy Dushistov <[email protected]>
Signed-off-by: Jan Kara <[email protected]>
  • Loading branch information
jankara committed May 24, 2010
1 parent 3635046 commit 8f45c33
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 195 deletions.
24 changes: 0 additions & 24 deletions fs/ufs/balloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <linux/stat.h>
#include <linux/time.h>
#include <linux/string.h>
#include <linux/quotaops.h>
#include <linux/buffer_head.h>
#include <linux/capability.h>
#include <linux/bitops.h>
Expand Down Expand Up @@ -85,9 +84,6 @@ void ufs_free_fragments(struct inode *inode, u64 fragment, unsigned count)
"bit already cleared for fragment %u", i);
}

dquot_free_block(inode, count);


fs32_add(sb, &ucg->cg_cs.cs_nffree, count);
uspi->cs_total.cs_nffree += count;
fs32_add(sb, &UFS_SB(sb)->fs_cs(cgno).cs_nffree, count);
Expand Down Expand Up @@ -195,7 +191,6 @@ void ufs_free_blocks(struct inode *inode, u64 fragment, unsigned count)
ubh_setblock(UCPI_UBH(ucpi), ucpi->c_freeoff, blkno);
if ((UFS_SB(sb)->s_flags & UFS_CG_MASK) == UFS_CG_44BSD)
ufs_clusteracct (sb, ucpi, blkno, 1);
dquot_free_block(inode, uspi->s_fpb);

fs32_add(sb, &ucg->cg_cs.cs_nbfree, 1);
uspi->cs_total.cs_nbfree++;
Expand Down Expand Up @@ -511,7 +506,6 @@ static u64 ufs_add_fragments(struct inode *inode, u64 fragment,
struct ufs_cg_private_info * ucpi;
struct ufs_cylinder_group * ucg;
unsigned cgno, fragno, fragoff, count, fragsize, i;
int ret;

UFSD("ENTER, fragment %llu, oldcount %u, newcount %u\n",
(unsigned long long)fragment, oldcount, newcount);
Expand Down Expand Up @@ -557,11 +551,6 @@ static u64 ufs_add_fragments(struct inode *inode, u64 fragment,
fs32_add(sb, &ucg->cg_frsum[fragsize - count], 1);
for (i = oldcount; i < newcount; i++)
ubh_clrbit (UCPI_UBH(ucpi), ucpi->c_freeoff, fragno + i);
ret = dquot_alloc_block(inode, count);
if (ret) {
*err = ret;
return 0;
}

fs32_sub(sb, &ucg->cg_cs.cs_nffree, count);
fs32_sub(sb, &UFS_SB(sb)->fs_cs(cgno).cs_nffree, count);
Expand Down Expand Up @@ -598,7 +587,6 @@ static u64 ufs_alloc_fragments(struct inode *inode, unsigned cgno,
struct ufs_cylinder_group * ucg;
unsigned oldcg, i, j, k, allocsize;
u64 result;
int ret;

UFSD("ENTER, ino %lu, cgno %u, goal %llu, count %u\n",
inode->i_ino, cgno, (unsigned long long)goal, count);
Expand Down Expand Up @@ -667,7 +655,6 @@ static u64 ufs_alloc_fragments(struct inode *inode, unsigned cgno,
for (i = count; i < uspi->s_fpb; i++)
ubh_setbit (UCPI_UBH(ucpi), ucpi->c_freeoff, goal + i);
i = uspi->s_fpb - count;
dquot_free_block(inode, i);

fs32_add(sb, &ucg->cg_cs.cs_nffree, i);
uspi->cs_total.cs_nffree += i;
Expand All @@ -679,11 +666,6 @@ static u64 ufs_alloc_fragments(struct inode *inode, unsigned cgno,
result = ufs_bitmap_search (sb, ucpi, goal, allocsize);
if (result == INVBLOCK)
return 0;
ret = dquot_alloc_block(inode, count);
if (ret) {
*err = ret;
return 0;
}
for (i = 0; i < count; i++)
ubh_clrbit (UCPI_UBH(ucpi), ucpi->c_freeoff, result + i);

Expand Down Expand Up @@ -718,7 +700,6 @@ static u64 ufs_alloccg_block(struct inode *inode,
struct ufs_super_block_first * usb1;
struct ufs_cylinder_group * ucg;
u64 result, blkno;
int ret;

UFSD("ENTER, goal %llu\n", (unsigned long long)goal);

Expand Down Expand Up @@ -752,11 +733,6 @@ static u64 ufs_alloccg_block(struct inode *inode,
ubh_clrblock (UCPI_UBH(ucpi), ucpi->c_freeoff, blkno);
if ((UFS_SB(sb)->s_flags & UFS_CG_MASK) == UFS_CG_44BSD)
ufs_clusteracct (sb, ucpi, blkno, -1);
ret = dquot_alloc_block(inode, uspi->s_fpb);
if (ret) {
*err = ret;
return INVBLOCK;
}

fs32_sub(sb, &ucg->cg_cs.cs_nbfree, 1);
uspi->cs_total.cs_nbfree--;
Expand Down
3 changes: 1 addition & 2 deletions fs/ufs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
*/

#include <linux/fs.h>
#include <linux/quotaops.h>

#include "ufs_fs.h"
#include "ufs.h"
Expand All @@ -41,7 +40,7 @@ const struct file_operations ufs_file_operations = {
.write = do_sync_write,
.aio_write = generic_file_aio_write,
.mmap = generic_file_mmap,
.open = dquot_file_open,
.open = generic_file_open,
.fsync = simple_fsync,
.splice_read = generic_file_splice_read,
};
13 changes: 0 additions & 13 deletions fs/ufs/ialloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <linux/time.h>
#include <linux/stat.h>
#include <linux/string.h>
#include <linux/quotaops.h>
#include <linux/buffer_head.h>
#include <linux/sched.h>
#include <linux/bitops.h>
Expand Down Expand Up @@ -95,9 +94,6 @@ void ufs_free_inode (struct inode * inode)

is_directory = S_ISDIR(inode->i_mode);

dquot_free_inode(inode);
dquot_drop(inode);

clear_inode (inode);

if (ubh_isclr (UCPI_UBH(ucpi), ucpi->c_iusedoff, bit))
Expand Down Expand Up @@ -347,21 +343,12 @@ struct inode * ufs_new_inode(struct inode * dir, int mode)

unlock_super (sb);

dquot_initialize(inode);
err = dquot_alloc_inode(inode);
if (err) {
dquot_drop(inode);
goto fail_without_unlock;
}

UFSD("allocating inode %lu\n", inode->i_ino);
UFSD("EXIT\n");
return inode;

fail_remove_inode:
unlock_super(sb);
fail_without_unlock:
inode->i_flags |= S_NOQUOTA;
inode->i_nlink = 0;
iput(inode);
UFSD("EXIT (FAILED): err %d\n", err);
Expand Down
4 changes: 0 additions & 4 deletions fs/ufs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include <linux/smp_lock.h>
#include <linux/buffer_head.h>
#include <linux/writeback.h>
#include <linux/quotaops.h>

#include "ufs_fs.h"
#include "ufs.h"
Expand Down Expand Up @@ -910,9 +909,6 @@ void ufs_delete_inode (struct inode * inode)
{
loff_t old_i_size;

if (!is_bad_inode(inode))
dquot_initialize(inode);

truncate_inode_pages(&inode->i_data, 0);
if (is_bad_inode(inode))
goto no_delete;
Expand Down
16 changes: 0 additions & 16 deletions fs/ufs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include <linux/time.h>
#include <linux/fs.h>
#include <linux/smp_lock.h>
#include <linux/quotaops.h>

#include "ufs_fs.h"
#include "ufs.h"
Expand Down Expand Up @@ -86,8 +85,6 @@ static int ufs_create (struct inode * dir, struct dentry * dentry, int mode,

UFSD("BEGIN\n");

dquot_initialize(dir);

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

Expand All @@ -112,8 +109,6 @@ static int ufs_mknod (struct inode * dir, struct dentry *dentry, int mode, dev_t
if (!old_valid_dev(rdev))
return -EINVAL;

dquot_initialize(dir);

inode = ufs_new_inode(dir, mode);
err = PTR_ERR(inode);
if (!IS_ERR(inode)) {
Expand All @@ -138,8 +133,6 @@ static int ufs_symlink (struct inode * dir, struct dentry * dentry,
if (l > sb->s_blocksize)
goto out_notlocked;

dquot_initialize(dir);

lock_kernel();
inode = ufs_new_inode(dir, S_IFLNK | S_IRWXUGO);
err = PTR_ERR(inode);
Expand Down Expand Up @@ -185,8 +178,6 @@ static int ufs_link (struct dentry * old_dentry, struct inode * dir,
return -EMLINK;
}

dquot_initialize(dir);

inode->i_ctime = CURRENT_TIME_SEC;
inode_inc_link_count(inode);
atomic_inc(&inode->i_count);
Expand All @@ -204,8 +195,6 @@ static int ufs_mkdir(struct inode * dir, struct dentry * dentry, int mode)
if (dir->i_nlink >= UFS_LINK_MAX)
goto out;

dquot_initialize(dir);

lock_kernel();
inode_inc_link_count(dir);

Expand Down Expand Up @@ -250,8 +239,6 @@ static int ufs_unlink(struct inode *dir, struct dentry *dentry)
struct page *page;
int err = -ENOENT;

dquot_initialize(dir);

de = ufs_find_entry(dir, &dentry->d_name, &page);
if (!de)
goto out;
Expand Down Expand Up @@ -296,9 +283,6 @@ static int ufs_rename(struct inode *old_dir, struct dentry *old_dentry,
struct ufs_dir_entry *old_de;
int err = -ENOENT;

dquot_initialize(old_dir);
dquot_initialize(new_dir);

old_de = ufs_find_entry(old_dir, &old_dentry->d_name, &old_page);
if (!old_de)
goto out;
Expand Down
Loading

0 comments on commit 8f45c33

Please sign in to comment.