Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e213e26a authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6: (33 commits)
  quota: stop using QUOTA_OK / NO_QUOTA
  dquot: cleanup dquot initialize routine
  dquot: move dquot initialization responsibility into the filesystem
  dquot: cleanup dquot drop routine
  dquot: move dquot drop responsibility into the filesystem
  dquot: cleanup dquot transfer routine
  dquot: move dquot transfer responsibility into the filesystem
  dquot: cleanup inode allocation / freeing routines
  dquot: cleanup space allocation / freeing routines
  ext3: add writepage sanity checks
  ext3: Truncate allocated blocks if direct IO write fails to update i_size
  quota: Properly invalidate caches even for filesystems with blocksize < pagesize
  quota: generalize quota transfer interface
  quota: sb_quota state flags cleanup
  jbd: Delay discarding buffers in journal_unmap_buffer
  ext3: quota_write cross block boundary behaviour
  quota: drop permission checks from xfs_fs_set_xstate/xfs_fs_set_xquota
  quota: split out compat_sys_quotactl support from quota.c
  quota: split out netlink notification support from quota.c
  quota: remove invalid optimization from quota_sync_all
  ...

Fixed trivial conflicts in fs/namei.c and fs/ufs/inode.c
parents c812a51d efd8f0e6
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -460,13 +460,6 @@ in sys_read() and friends.

--------------------------- dquot_operations -------------------------------
prototypes:
	int (*initialize) (struct inode *, int);
	int (*drop) (struct inode *);
	int (*alloc_space) (struct inode *, qsize_t, int);
	int (*alloc_inode) (const struct inode *, unsigned long);
	int (*free_space) (struct inode *, qsize_t);
	int (*free_inode) (const struct inode *, unsigned long);
	int (*transfer) (struct inode *, struct iattr *);
	int (*write_dquot) (struct dquot *);
	int (*acquire_dquot) (struct dquot *);
	int (*release_dquot) (struct dquot *);
@@ -479,13 +472,6 @@ a proper locking wrt the filesystem and call the generic quota operations.
What filesystem should expect from the generic quota functions:

		FS recursion	Held locks when called
initialize:	yes		maybe dqonoff_sem
drop:		yes		-
alloc_space:	->mark_dirty()	-
alloc_inode:	->mark_dirty()	-
free_space:	->mark_dirty()	-
free_inode:	->mark_dirty()	-
transfer:	yes		-
write_dquot:	yes		dqonoff_sem or dqptr_sem
acquire_dquot:	yes		dqonoff_sem or dqptr_sem
release_dquot:	yes		dqonoff_sem or dqptr_sem
@@ -495,10 +481,6 @@ write_info: yes dqonoff_sem
FS recursion means calling ->quota_read() and ->quota_write() from superblock
operations.

->alloc_space(), ->alloc_inode(), ->free_space(), ->free_inode() are called
only directly by the filesystem and do not call any fs functions only
the ->mark_dirty() operation.

More details about quota locking can be found in fs/dquot.c.

--------------------------- vm_operations_struct -----------------------------
+1 −1
Original line number Diff line number Diff line
@@ -969,7 +969,7 @@ int pohmelfs_setattr_raw(struct inode *inode, struct iattr *attr)

	if ((attr->ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) ||
	    (attr->ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid)) {
		err = vfs_dq_transfer(inode, attr) ? -EDQUOT : 0;
		err = dquot_transfer(inode, attr);
		if (err)
			goto err_out_exit;
	}
+2 −9
Original line number Diff line number Diff line
@@ -12,7 +12,6 @@
#include <linux/capability.h>
#include <linux/fsnotify.h>
#include <linux/fcntl.h>
#include <linux/quotaops.h>
#include <linux/security.h>

/* Taken over from the old code... */
@@ -212,15 +211,9 @@ int notify_change(struct dentry * dentry, struct iattr * attr)
		error = inode->i_op->setattr(dentry, attr);
	} else {
		error = inode_change_ok(inode, attr);
		if (!error) {
			if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) ||
			    (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid))
				error = vfs_dq_transfer(inode, attr) ?
					-EDQUOT : 0;
		if (!error)
			error = inode_setattr(inode, attr);
	}
	}

	if (ia_valid & ATTR_SIZE)
		up_write(&dentry->d_inode->i_alloc_sem);
+7 −5
Original line number Diff line number Diff line
@@ -570,7 +570,7 @@ do_more:
error_return:
	brelse(bitmap_bh);
	release_blocks(sb, freed);
	vfs_dq_free_block(inode, freed);
	dquot_free_block(inode, freed);
}

/**
@@ -1236,6 +1236,7 @@ ext2_fsblk_t ext2_new_blocks(struct inode *inode, ext2_fsblk_t goal,
	unsigned short windowsz = 0;
	unsigned long ngroups;
	unsigned long num = *count;
	int ret;

	*errp = -ENOSPC;
	sb = inode->i_sb;
@@ -1247,8 +1248,9 @@ ext2_fsblk_t ext2_new_blocks(struct inode *inode, ext2_fsblk_t goal,
	/*
	 * Check quota for allocation of this block.
	 */
	if (vfs_dq_alloc_block(inode, num)) {
		*errp = -EDQUOT;
	ret = dquot_alloc_block(inode, num);
	if (ret) {
		*errp = ret;
		return 0;
	}

@@ -1409,7 +1411,7 @@ allocated:

	*errp = 0;
	brelse(bitmap_bh);
	vfs_dq_free_block(inode, *count-num);
	dquot_free_block(inode, *count-num);
	*count = num;
	return ret_block;

@@ -1420,7 +1422,7 @@ out:
	 * Undo the block allocation
	 */
	if (!performed_allocation)
		vfs_dq_free_block(inode, *count);
		dquot_free_block(inode, *count);
	brelse(bitmap_bh);
	return 0;
}
+3 −2
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@

#include <linux/time.h>
#include <linux/pagemap.h>
#include <linux/quotaops.h>
#include "ext2.h"
#include "xattr.h"
#include "acl.h"
@@ -70,7 +71,7 @@ const struct file_operations ext2_file_operations = {
	.compat_ioctl	= ext2_compat_ioctl,
#endif
	.mmap		= generic_file_mmap,
	.open		= generic_file_open,
	.open		= dquot_file_open,
	.release	= ext2_release_file,
	.fsync		= ext2_fsync,
	.splice_read	= generic_file_splice_read,
@@ -87,7 +88,7 @@ const struct file_operations ext2_xip_file_operations = {
	.compat_ioctl	= ext2_compat_ioctl,
#endif
	.mmap		= xip_file_mmap,
	.open		= generic_file_open,
	.open		= dquot_file_open,
	.release	= ext2_release_file,
	.fsync		= ext2_fsync,
};
Loading