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

Commit 8e9d2089 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'bkl-removal' of git://git.lwn.net/linux-2.6

* 'bkl-removal' of git://git.lwn.net/linux-2.6:
  Rationalize fasync return values
  Move FASYNC bit handling to f_op->fasync()
  Use f_lock to protect f_flags
  Rename struct file->f_ep_lock
parents ba1eb95c 60aa4924
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -437,8 +437,11 @@ grab BKL for cases when we close a file that had been opened r/w, but that
can and should be done using the internal locking with smaller critical areas).
can and should be done using the internal locking with smaller critical areas).
Current worst offender is ext2_get_block()...
Current worst offender is ext2_get_block()...


->fasync() is a mess. This area needs a big cleanup and that will probably
->fasync() is called without BKL protection, and is responsible for
affect locking.
maintaining the FASYNC bit in filp->f_flags.  Most instances call
fasync_helper(), which does that maintenance, so it's not normally
something one needs to worry about.  Return values > 0 will be mapped to
zero in the VFS layer.


->readdir() and ->ioctl() on directories must be changed. Ideally we would
->readdir() and ->ioctl() on directories must be changed. Ideally we would
move ->readdir() to inode_operations and use a separate method for directory
move ->readdir() to inode_operations and use a separate method for directory
+1 −6
Original line number Original line Diff line number Diff line
@@ -888,12 +888,7 @@ static irqreturn_t sonypi_irq(int irq, void *dev_id)


static int sonypi_misc_fasync(int fd, struct file *filp, int on)
static int sonypi_misc_fasync(int fd, struct file *filp, int on)
{
{
	int retval;
	return fasync_helper(fd, filp, on, &sonypi_device.fifo_async);

	retval = fasync_helper(fd, filp, on, &sonypi_device.fifo_async);
	if (retval < 0)
		return retval;
	return 0;
}
}


static int sonypi_misc_release(struct inode *inode, struct file *file)
static int sonypi_misc_release(struct inode *inode, struct file *file)
+2 −3
Original line number Original line Diff line number Diff line
@@ -2162,13 +2162,12 @@ static int fionbio(struct file *file, int __user *p)
	if (get_user(nonblock, p))
	if (get_user(nonblock, p))
		return -EFAULT;
		return -EFAULT;


	/* file->f_flags is still BKL protected in the fs layer - vomit */
	spin_lock(&file->f_lock);
	lock_kernel();
	if (nonblock)
	if (nonblock)
		file->f_flags |= O_NONBLOCK;
		file->f_flags |= O_NONBLOCK;
	else
	else
		file->f_flags &= ~O_NONBLOCK;
		file->f_flags &= ~O_NONBLOCK;
	unlock_kernel();
	spin_unlock(&file->f_lock);
	return 0;
	return 0;
}
}


+1 −5
Original line number Original line Diff line number Diff line
@@ -337,14 +337,10 @@ int drm_fasync(int fd, struct file *filp, int on)
{
{
	struct drm_file *priv = filp->private_data;
	struct drm_file *priv = filp->private_data;
	struct drm_device *dev = priv->minor->dev;
	struct drm_device *dev = priv->minor->dev;
	int retcode;


	DRM_DEBUG("fd = %d, device = 0x%lx\n", fd,
	DRM_DEBUG("fd = %d, device = 0x%lx\n", fd,
		  (long)old_encode_dev(priv->minor->device));
		  (long)old_encode_dev(priv->minor->device));
	retcode = fasync_helper(fd, filp, on, &dev->buf_async);
	return fasync_helper(fd, filp, on, &dev->buf_async);
	if (retcode < 0)
		return retcode;
	return 0;
}
}
EXPORT_SYMBOL(drm_fasync);
EXPORT_SYMBOL(drm_fasync);


+1 −4
Original line number Original line Diff line number Diff line
@@ -227,12 +227,9 @@ void hiddev_report_event(struct hid_device *hid, struct hid_report *report)
 */
 */
static int hiddev_fasync(int fd, struct file *file, int on)
static int hiddev_fasync(int fd, struct file *file, int on)
{
{
	int retval;
	struct hiddev_list *list = file->private_data;
	struct hiddev_list *list = file->private_data;


	retval = fasync_helper(fd, file, on, &list->fasync);
	return fasync_helper(fd, file, on, &list->fasync);

	return retval < 0 ? retval : 0;
}
}




Loading