Skip to content

Commit

Permalink
Merge branch 'work.afs' of git://git.kernel.org/pub/scm/linux/kernel/…
Browse files Browse the repository at this point in the history
…git/viro/vfs

Pull AFS updates from Al Viro:
 "AFS series, with some iov_iter bits included"

* 'work.afs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (26 commits)
  missing bits of "iov_iter: Separate type from direction and use accessor functions"
  afs: Probe multiple fileservers simultaneously
  afs: Fix callback handling
  afs: Eliminate the address pointer from the address list cursor
  afs: Allow dumping of server cursor on operation failure
  afs: Implement YFS support in the fs client
  afs: Expand data structure fields to support YFS
  afs: Get the target vnode in afs_rmdir() and get a callback on it
  afs: Calc callback expiry in op reply delivery
  afs: Fix FS.FetchStatus delivery from updating wrong vnode
  afs: Implement the YFS cache manager service
  afs: Remove callback details from afs_callback_break struct
  afs: Commit the status on a new file/dir/symlink
  afs: Increase to 64-bit volume ID and 96-bit vnode ID for YFS
  afs: Don't invoke the server to read data beyond EOF
  afs: Add a couple of tracepoints to log I/O errors
  afs: Handle EIO from delivery function
  afs: Fix TTL on VL server and address lists
  afs: Implement VL server rotation
  afs: Improve FS server rotation error handling
  ...
  • Loading branch information
torvalds committed Nov 2, 2018
2 parents e468f5c + 0e9b4a8 commit 9931a07
Show file tree
Hide file tree
Showing 85 changed files with 5,632 additions and 1,239 deletions.
2 changes: 1 addition & 1 deletion block/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,7 @@ struct bio *bio_copy_user_iov(struct request_queue *q,
/*
* success
*/
if (((iter->type & WRITE) && (!map_data || !map_data->null_mapped)) ||
if ((iov_iter_rw(iter) == WRITE && (!map_data || !map_data->null_mapped)) ||
(map_data && map_data->from_user)) {
ret = bio_copy_from_iter(bio, iter);
if (ret)
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/drbd/drbd_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1856,7 +1856,7 @@ int drbd_send(struct drbd_connection *connection, struct socket *sock,

/* THINK if (signal_pending) return ... ? */

iov_iter_kvec(&msg.msg_iter, WRITE | ITER_KVEC, &iov, 1, size);
iov_iter_kvec(&msg.msg_iter, WRITE, &iov, 1, size);

if (sock == connection->data.socket) {
rcu_read_lock();
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/drbd/drbd_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ static int drbd_recv_short(struct socket *sock, void *buf, size_t size, int flag
struct msghdr msg = {
.msg_flags = (flags ? flags : MSG_WAITALL | MSG_NOSIGNAL)
};
iov_iter_kvec(&msg.msg_iter, READ | ITER_KVEC, &iov, 1, size);
iov_iter_kvec(&msg.msg_iter, READ, &iov, 1, size);
return sock_recvmsg(sock, &msg, msg.msg_flags);
}

Expand Down
9 changes: 4 additions & 5 deletions drivers/block/loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ static int lo_write_bvec(struct file *file, struct bio_vec *bvec, loff_t *ppos)
struct iov_iter i;
ssize_t bw;

iov_iter_bvec(&i, ITER_BVEC | WRITE, bvec, 1, bvec->bv_len);
iov_iter_bvec(&i, WRITE, bvec, 1, bvec->bv_len);

file_start_write(file);
bw = vfs_iter_write(file, &i, ppos, 0);
Expand Down Expand Up @@ -347,7 +347,7 @@ static int lo_read_simple(struct loop_device *lo, struct request *rq,
ssize_t len;

rq_for_each_segment(bvec, rq, iter) {
iov_iter_bvec(&i, ITER_BVEC, &bvec, 1, bvec.bv_len);
iov_iter_bvec(&i, READ, &bvec, 1, bvec.bv_len);
len = vfs_iter_read(lo->lo_backing_file, &i, &pos, 0);
if (len < 0)
return len;
Expand Down Expand Up @@ -388,7 +388,7 @@ static int lo_read_transfer(struct loop_device *lo, struct request *rq,
b.bv_offset = 0;
b.bv_len = bvec.bv_len;

iov_iter_bvec(&i, ITER_BVEC, &b, 1, b.bv_len);
iov_iter_bvec(&i, READ, &b, 1, b.bv_len);
len = vfs_iter_read(lo->lo_backing_file, &i, &pos, 0);
if (len < 0) {
ret = len;
Expand Down Expand Up @@ -555,8 +555,7 @@ static int lo_rw_aio(struct loop_device *lo, struct loop_cmd *cmd,
}
atomic_set(&cmd->ref, 2);

iov_iter_bvec(&iter, ITER_BVEC | rw, bvec,
segments, blk_rq_bytes(rq));
iov_iter_bvec(&iter, rw, bvec, segments, blk_rq_bytes(rq));
iter.iov_offset = offset;

cmd->iocb.ki_pos = pos;
Expand Down
12 changes: 5 additions & 7 deletions drivers/block/nbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ static int nbd_send_cmd(struct nbd_device *nbd, struct nbd_cmd *cmd, int index)
u32 nbd_cmd_flags = 0;
int sent = nsock->sent, skip = 0;

iov_iter_kvec(&from, WRITE | ITER_KVEC, &iov, 1, sizeof(request));
iov_iter_kvec(&from, WRITE, &iov, 1, sizeof(request));

switch (req_op(req)) {
case REQ_OP_DISCARD:
Expand Down Expand Up @@ -564,8 +564,7 @@ static int nbd_send_cmd(struct nbd_device *nbd, struct nbd_cmd *cmd, int index)

dev_dbg(nbd_to_dev(nbd), "request %p: sending %d bytes data\n",
req, bvec.bv_len);
iov_iter_bvec(&from, ITER_BVEC | WRITE,
&bvec, 1, bvec.bv_len);
iov_iter_bvec(&from, WRITE, &bvec, 1, bvec.bv_len);
if (skip) {
if (skip >= iov_iter_count(&from)) {
skip -= iov_iter_count(&from);
Expand Down Expand Up @@ -624,7 +623,7 @@ static struct nbd_cmd *nbd_read_stat(struct nbd_device *nbd, int index)
int ret = 0;

reply.magic = 0;
iov_iter_kvec(&to, READ | ITER_KVEC, &iov, 1, sizeof(reply));
iov_iter_kvec(&to, READ, &iov, 1, sizeof(reply));
result = sock_xmit(nbd, index, 0, &to, MSG_WAITALL, NULL);
if (result <= 0) {
if (!nbd_disconnected(config))
Expand Down Expand Up @@ -678,8 +677,7 @@ static struct nbd_cmd *nbd_read_stat(struct nbd_device *nbd, int index)
struct bio_vec bvec;

rq_for_each_segment(bvec, req, iter) {
iov_iter_bvec(&to, ITER_BVEC | READ,
&bvec, 1, bvec.bv_len);
iov_iter_bvec(&to, READ, &bvec, 1, bvec.bv_len);
result = sock_xmit(nbd, index, 0, &to, MSG_WAITALL, NULL);
if (result <= 0) {
dev_err(disk_to_dev(nbd->disk), "Receive data failed (result %d)\n",
Expand Down Expand Up @@ -1073,7 +1071,7 @@ static void send_disconnects(struct nbd_device *nbd)
for (i = 0; i < config->num_connections; i++) {
struct nbd_sock *nsock = config->socks[i];

iov_iter_kvec(&from, WRITE | ITER_KVEC, &iov, 1, sizeof(request));
iov_iter_kvec(&from, WRITE, &iov, 1, sizeof(request));
mutex_lock(&nsock->tx_lock);
ret = sock_xmit(nbd, i, 1, &from, 0, NULL);
if (ret <= 0)
Expand Down
4 changes: 2 additions & 2 deletions drivers/fsi/fsi-sbefifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ static void sbefifo_collect_async_ffdc(struct sbefifo *sbefifo)
}
ffdc_iov.iov_base = ffdc;
ffdc_iov.iov_len = SBEFIFO_MAX_FFDC_SIZE;
iov_iter_kvec(&ffdc_iter, WRITE | ITER_KVEC, &ffdc_iov, 1, SBEFIFO_MAX_FFDC_SIZE);
iov_iter_kvec(&ffdc_iter, WRITE, &ffdc_iov, 1, SBEFIFO_MAX_FFDC_SIZE);
cmd[0] = cpu_to_be32(2);
cmd[1] = cpu_to_be32(SBEFIFO_CMD_GET_SBE_FFDC);
rc = sbefifo_do_command(sbefifo, cmd, 2, &ffdc_iter);
Expand Down Expand Up @@ -735,7 +735,7 @@ int sbefifo_submit(struct device *dev, const __be32 *command, size_t cmd_len,
rbytes = (*resp_len) * sizeof(__be32);
resp_iov.iov_base = response;
resp_iov.iov_len = rbytes;
iov_iter_kvec(&resp_iter, WRITE | ITER_KVEC, &resp_iov, 1, rbytes);
iov_iter_kvec(&resp_iter, WRITE, &resp_iov, 1, rbytes);

/* Perform the command */
mutex_lock(&sbefifo->lock);
Expand Down
2 changes: 0 additions & 2 deletions drivers/gpu/drm/amd/display/dc/os_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
#define LITTLEENDIAN_CPU
#endif

#undef READ
#undef WRITE
#undef FRAME_SIZE

#define dm_output_to_console(fmt, ...) DRM_DEBUG_KMS(fmt, ##__VA_ARGS__)
Expand Down
3 changes: 1 addition & 2 deletions drivers/isdn/mISDN/l1oip_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,7 @@ l1oip_socket_thread(void *data)
printk(KERN_DEBUG "%s: socket created and open\n",
__func__);
while (!signal_pending(current)) {
iov_iter_kvec(&msg.msg_iter, READ | ITER_KVEC, &iov, 1,
recvbuf_size);
iov_iter_kvec(&msg.msg_iter, READ, &iov, 1, recvbuf_size);
recvlen = sock_recvmsg(socket, &msg, 0);
if (recvlen > 0) {
l1oip_socket_parse(hc, &sin_rx, recvbuf, recvlen);
Expand Down
6 changes: 3 additions & 3 deletions drivers/misc/vmw_vmci/vmci_queue_pair.c
Original file line number Diff line number Diff line change
Expand Up @@ -3030,7 +3030,7 @@ ssize_t vmci_qpair_enqueue(struct vmci_qp *qpair,
if (!qpair || !buf)
return VMCI_ERROR_INVALID_ARGS;

iov_iter_kvec(&from, WRITE | ITER_KVEC, &v, 1, buf_size);
iov_iter_kvec(&from, WRITE, &v, 1, buf_size);

qp_lock(qpair);

Expand Down Expand Up @@ -3074,7 +3074,7 @@ ssize_t vmci_qpair_dequeue(struct vmci_qp *qpair,
if (!qpair || !buf)
return VMCI_ERROR_INVALID_ARGS;

iov_iter_kvec(&to, READ | ITER_KVEC, &v, 1, buf_size);
iov_iter_kvec(&to, READ, &v, 1, buf_size);

qp_lock(qpair);

Expand Down Expand Up @@ -3119,7 +3119,7 @@ ssize_t vmci_qpair_peek(struct vmci_qp *qpair,
if (!qpair || !buf)
return VMCI_ERROR_INVALID_ARGS;

iov_iter_kvec(&to, READ | ITER_KVEC, &v, 1, buf_size);
iov_iter_kvec(&to, READ, &v, 1, buf_size);

qp_lock(qpair);

Expand Down
2 changes: 1 addition & 1 deletion drivers/nvme/target/io-cmd-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static ssize_t nvmet_file_submit_bvec(struct nvmet_req *req, loff_t pos,
rw = READ;
}

iov_iter_bvec(&iter, ITER_BVEC | rw, req->f.bvec, nr_segs, count);
iov_iter_bvec(&iter, rw, req->f.bvec, nr_segs, count);

iocb->ki_pos = pos;
iocb->ki_filp = req->ns->file;
Expand Down
6 changes: 2 additions & 4 deletions drivers/target/iscsi/iscsi_target_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1245,8 +1245,7 @@ static int iscsit_do_rx_data(
return -1;

memset(&msg, 0, sizeof(struct msghdr));
iov_iter_kvec(&msg.msg_iter, READ | ITER_KVEC,
count->iov, count->iov_count, data);
iov_iter_kvec(&msg.msg_iter, READ, count->iov, count->iov_count, data);

while (msg_data_left(&msg)) {
rx_loop = sock_recvmsg(conn->sock, &msg, MSG_WAITALL);
Expand Down Expand Up @@ -1302,8 +1301,7 @@ int tx_data(

memset(&msg, 0, sizeof(struct msghdr));

iov_iter_kvec(&msg.msg_iter, WRITE | ITER_KVEC,
iov, iov_count, data);
iov_iter_kvec(&msg.msg_iter, WRITE, iov, iov_count, data);

while (msg_data_left(&msg)) {
int tx_loop = sock_sendmsg(conn->sock, &msg);
Expand Down
6 changes: 3 additions & 3 deletions drivers/target/target_core_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ fd_execute_rw_aio(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
len += sg->length;
}

iov_iter_bvec(&iter, ITER_BVEC | is_write, bvec, sgl_nents, len);
iov_iter_bvec(&iter, is_write, bvec, sgl_nents, len);

aio_cmd->cmd = cmd;
aio_cmd->len = len;
Expand Down Expand Up @@ -353,7 +353,7 @@ static int fd_do_rw(struct se_cmd *cmd, struct file *fd,
len += sg->length;
}

iov_iter_bvec(&iter, ITER_BVEC, bvec, sgl_nents, len);
iov_iter_bvec(&iter, READ, bvec, sgl_nents, len);
if (is_write)
ret = vfs_iter_write(fd, &iter, &pos, 0);
else
Expand Down Expand Up @@ -490,7 +490,7 @@ fd_execute_write_same(struct se_cmd *cmd)
len += se_dev->dev_attrib.block_size;
}

iov_iter_bvec(&iter, ITER_BVEC, bvec, nolb, len);
iov_iter_bvec(&iter, READ, bvec, nolb, len);
ret = vfs_iter_write(fd_dev->fd_file, &iter, &pos, 0);

kfree(bvec);
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/usbip/usbip_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ int usbip_recv(struct socket *sock, void *buf, int size)
if (!sock || !buf || !size)
return -EINVAL;

iov_iter_kvec(&msg.msg_iter, READ|ITER_KVEC, &iov, 1, size);
iov_iter_kvec(&msg.msg_iter, READ, &iov, 1, size);

usbip_dbg_xmit("enter\n");

Expand Down
8 changes: 4 additions & 4 deletions drivers/xen/pvcalls-back.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,13 @@ static void pvcalls_conn_back_read(void *opaque)
if (masked_prod < masked_cons) {
vec[0].iov_base = data->in + masked_prod;
vec[0].iov_len = wanted;
iov_iter_kvec(&msg.msg_iter, ITER_KVEC|WRITE, vec, 1, wanted);
iov_iter_kvec(&msg.msg_iter, WRITE, vec, 1, wanted);
} else {
vec[0].iov_base = data->in + masked_prod;
vec[0].iov_len = array_size - masked_prod;
vec[1].iov_base = data->in;
vec[1].iov_len = wanted - vec[0].iov_len;
iov_iter_kvec(&msg.msg_iter, ITER_KVEC|WRITE, vec, 2, wanted);
iov_iter_kvec(&msg.msg_iter, WRITE, vec, 2, wanted);
}

atomic_set(&map->read, 0);
Expand Down Expand Up @@ -195,13 +195,13 @@ static void pvcalls_conn_back_write(struct sock_mapping *map)
if (pvcalls_mask(prod, array_size) > pvcalls_mask(cons, array_size)) {
vec[0].iov_base = data->out + pvcalls_mask(cons, array_size);
vec[0].iov_len = size;
iov_iter_kvec(&msg.msg_iter, ITER_KVEC|READ, vec, 1, size);
iov_iter_kvec(&msg.msg_iter, READ, vec, 1, size);
} else {
vec[0].iov_base = data->out + pvcalls_mask(cons, array_size);
vec[0].iov_len = array_size - pvcalls_mask(cons, array_size);
vec[1].iov_base = data->out;
vec[1].iov_len = size - vec[0].iov_len;
iov_iter_kvec(&msg.msg_iter, ITER_KVEC|READ, vec, 2, size);
iov_iter_kvec(&msg.msg_iter, READ, vec, 2, size);
}

atomic_set(&map->write, 0);
Expand Down
4 changes: 2 additions & 2 deletions fs/9p/vfs_addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static int v9fs_fid_readpage(struct p9_fid *fid, struct page *page)
if (retval == 0)
return retval;

iov_iter_bvec(&to, ITER_BVEC | READ, &bvec, 1, PAGE_SIZE);
iov_iter_bvec(&to, READ, &bvec, 1, PAGE_SIZE);

retval = p9_client_read(fid, page_offset(page), &to, &err);
if (err) {
Expand Down Expand Up @@ -175,7 +175,7 @@ static int v9fs_vfs_writepage_locked(struct page *page)
bvec.bv_page = page;
bvec.bv_offset = 0;
bvec.bv_len = len;
iov_iter_bvec(&from, ITER_BVEC | WRITE, &bvec, 1, len);
iov_iter_bvec(&from, WRITE, &bvec, 1, len);

/* We should have writeback_fid always set */
BUG_ON(!v9inode->writeback_fid);
Expand Down
2 changes: 1 addition & 1 deletion fs/9p/vfs_dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ static int v9fs_dir_readdir(struct file *file, struct dir_context *ctx)
if (rdir->tail == rdir->head) {
struct iov_iter to;
int n;
iov_iter_kvec(&to, READ | ITER_KVEC, &kvec, 1, buflen);
iov_iter_kvec(&to, READ, &kvec, 1, buflen);
n = p9_client_read(file->private_data, ctx->pos, &to,
&err);
if (err)
Expand Down
4 changes: 2 additions & 2 deletions fs/9p/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ssize_t v9fs_fid_xattr_get(struct p9_fid *fid, const char *name,
struct iov_iter to;
int err;

iov_iter_kvec(&to, READ | ITER_KVEC, &kvec, 1, buffer_size);
iov_iter_kvec(&to, READ, &kvec, 1, buffer_size);

attr_fid = p9_client_xattrwalk(fid, name, &attr_size);
if (IS_ERR(attr_fid)) {
Expand Down Expand Up @@ -107,7 +107,7 @@ int v9fs_fid_xattr_set(struct p9_fid *fid, const char *name,
struct iov_iter from;
int retval, err;

iov_iter_kvec(&from, WRITE | ITER_KVEC, &kvec, 1, value_len);
iov_iter_kvec(&from, WRITE, &kvec, 1, value_len);

p9_debug(P9_DEBUG_VFS, "name = %s value_len = %zu flags = %d\n",
name, value_len, flags);
Expand Down
12 changes: 12 additions & 0 deletions fs/afs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,15 @@ config AFS_FSCACHE
help
Say Y here if you want AFS data to be cached locally on disk through
the generic filesystem cache manager

config AFS_DEBUG_CURSOR
bool "AFS server cursor debugging"
depends on AFS_FS
help
Say Y here to cause the contents of a server cursor to be dumped to
the dmesg log if the server rotation algorithm fails to successfully
contact a server.

See <file:Documentation/filesystems/afs.txt> for more information.

If unsure, say N.
7 changes: 6 additions & 1 deletion fs/afs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ kafs-y := \
file.o \
flock.o \
fsclient.o \
fs_probe.o \
inode.o \
main.o \
misc.o \
Expand All @@ -29,9 +30,13 @@ kafs-y := \
super.o \
netdevices.o \
vlclient.o \
vl_list.o \
vl_probe.o \
vl_rotate.o \
volume.o \
write.o \
xattr.o
xattr.o \
yfsclient.o

kafs-$(CONFIG_PROC_FS) += proc.o
obj-$(CONFIG_AFS_FS) := kafs.o
Loading

0 comments on commit 9931a07

Please sign in to comment.