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

Commit 408afb8d authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull aio updates from Al Viro:
 "Majority of AIO stuff this cycle. aio-fsync and aio-poll, mostly.

  The only thing I'm holding back for a day or so is Adam's aio ioprio -
  his last-minute fixup is trivial (missing stub in !CONFIG_BLOCK case),
  but let it sit in -next for decency sake..."

* 'work.aio-1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (46 commits)
  aio: sanitize the limit checking in io_submit(2)
  aio: fold do_io_submit() into callers
  aio: shift copyin of iocb into io_submit_one()
  aio_read_events_ring(): make a bit more readable
  aio: all callers of aio_{read,write,fsync,poll} treat 0 and -EIOCBQUEUED the same way
  aio: take list removal to (some) callers of aio_complete()
  aio: add missing break for the IOCB_CMD_FDSYNC case
  random: convert to ->poll_mask
  timerfd: convert to ->poll_mask
  eventfd: switch to ->poll_mask
  pipe: convert to ->poll_mask
  crypto: af_alg: convert to ->poll_mask
  net/rxrpc: convert to ->poll_mask
  net/iucv: convert to ->poll_mask
  net/phonet: convert to ->poll_mask
  net/nfc: convert to ->poll_mask
  net/caif: convert to ->poll_mask
  net/bluetooth: convert to ->poll_mask
  net/sctp: convert to ->poll_mask
  net/tipc: convert to ->poll_mask
  ...
parents b058efc1 1da92779
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -440,7 +440,9 @@ prototypes:
	ssize_t (*write_iter) (struct kiocb *, struct iov_iter *);
	int (*iterate) (struct file *, struct dir_context *);
	int (*iterate_shared) (struct file *, struct dir_context *);
	unsigned int (*poll) (struct file *, struct poll_table_struct *);
	__poll_t (*poll) (struct file *, struct poll_table_struct *);
	struct wait_queue_head * (*get_poll_head)(struct file *, __poll_t);
	__poll_t (*poll_mask) (struct file *, __poll_t);
	long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
	long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
	int (*mmap) (struct file *, struct vm_area_struct *);
@@ -471,7 +473,7 @@ prototypes:
};

locking rules:
	All may block.
	All except for ->poll_mask may block.

->llseek() locking has moved from llseek to the individual llseek
implementations.  If your fs is not using generic_file_llseek, you
@@ -503,6 +505,9 @@ in sys_read() and friends.
the lease within the individual filesystem to record the result of the
operation

->poll_mask can be called with or without the waitqueue lock for the waitqueue
returned from ->get_poll_head.

--------------------------- dquot_operations -------------------------------
prototypes:
	int (*write_dquot) (struct dquot *);
+14 −1
Original line number Diff line number Diff line
@@ -856,7 +856,9 @@ struct file_operations {
	ssize_t (*read_iter) (struct kiocb *, struct iov_iter *);
	ssize_t (*write_iter) (struct kiocb *, struct iov_iter *);
	int (*iterate) (struct file *, struct dir_context *);
	unsigned int (*poll) (struct file *, struct poll_table_struct *);
	__poll_t (*poll) (struct file *, struct poll_table_struct *);
	struct wait_queue_head * (*get_poll_head)(struct file *, __poll_t);
	__poll_t (*poll_mask) (struct file *, __poll_t);
	long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
	long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
	int (*mmap) (struct file *, struct vm_area_struct *);
@@ -901,6 +903,17 @@ otherwise noted.
	activity on this file and (optionally) go to sleep until there
	is activity. Called by the select(2) and poll(2) system calls

  get_poll_head: Returns the struct wait_queue_head that callers can
  wait on.  Callers need to check the returned events using ->poll_mask
  once woken.  Can return NULL to indicate polling is not supported,
  or any error code using the ERR_PTR convention to indicate that a
  grave error occured and ->poll_mask shall not be called.

  poll_mask: return the mask of EPOLL* values describing the file descriptor
  state.  Called either before going to sleep on the waitqueue returned by
  get_poll_head, or after it has been woken.  If ->get_poll_head and
  ->poll_mask are implemented ->poll does not need to be implement.

  unlocked_ioctl: called by the ioctl(2) system call.

  compat_ioctl: called by the ioctl(2) system call when 32 bit system calls
+1 −0
Original line number Diff line number Diff line
@@ -396,3 +396,4 @@
382	i386	pkey_free		sys_pkey_free			__ia32_sys_pkey_free
383	i386	statx			sys_statx			__ia32_sys_statx
384	i386	arch_prctl		sys_arch_prctl			__ia32_compat_sys_arch_prctl
385	i386	io_pgetevents		sys_io_pgetevents		__ia32_compat_sys_io_pgetevents
+1 −0
Original line number Diff line number Diff line
@@ -341,6 +341,7 @@
330	common	pkey_alloc		__x64_sys_pkey_alloc
331	common	pkey_free		__x64_sys_pkey_free
332	common	statx			__x64_sys_statx
333	common	io_pgetevents		__x64_sys_io_pgetevents

#
# x32-specific system call numbers start at 512 to avoid cache impact
+3 −11
Original line number Diff line number Diff line
@@ -347,7 +347,6 @@ static const struct proto_ops alg_proto_ops = {
	.sendpage	=	sock_no_sendpage,
	.sendmsg	=	sock_no_sendmsg,
	.recvmsg	=	sock_no_recvmsg,
	.poll		=	sock_no_poll,

	.bind		=	alg_bind,
	.release	=	af_alg_release,
@@ -1061,19 +1060,12 @@ void af_alg_async_cb(struct crypto_async_request *_req, int err)
}
EXPORT_SYMBOL_GPL(af_alg_async_cb);

/**
 * af_alg_poll - poll system call handler
 */
__poll_t af_alg_poll(struct file *file, struct socket *sock,
			 poll_table *wait)
__poll_t af_alg_poll_mask(struct socket *sock, __poll_t events)
{
	struct sock *sk = sock->sk;
	struct alg_sock *ask = alg_sk(sk);
	struct af_alg_ctx *ctx = ask->private;
	__poll_t mask;

	sock_poll_wait(file, sk_sleep(sk), wait);
	mask = 0;
	__poll_t mask = 0;

	if (!ctx->more || ctx->used)
		mask |= EPOLLIN | EPOLLRDNORM;
@@ -1083,7 +1075,7 @@ __poll_t af_alg_poll(struct file *file, struct socket *sock,

	return mask;
}
EXPORT_SYMBOL_GPL(af_alg_poll);
EXPORT_SYMBOL_GPL(af_alg_poll_mask);

/**
 * af_alg_alloc_areq - allocate struct af_alg_async_req
Loading