mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
Merge 8e5423e991 ("Merge tag 'parisc-for-6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux") into android-mainline
Steps on the way to 6.1-rc4 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: I3eac80c94b558b3c6aca549e5f1471555d3a8faa
This commit is contained in:
@@ -15637,7 +15637,7 @@ F: drivers/input/serio/gscps2.c
|
||||
F: drivers/input/serio/hp_sdc*
|
||||
F: drivers/parisc/
|
||||
F: drivers/parport/parport_gsc.*
|
||||
F: drivers/tty/serial/8250/8250_gsc.c
|
||||
F: drivers/tty/serial/8250/8250_parisc.c
|
||||
F: drivers/video/console/sti*
|
||||
F: drivers/video/fbdev/sti*
|
||||
F: drivers/video/logo/logo_parisc*
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
#define SVERSION_ANY_ID PA_SVERSION_ANY_ID
|
||||
|
||||
struct hp_hardware {
|
||||
unsigned short hw_type:5; /* HPHW_xxx */
|
||||
unsigned short hversion;
|
||||
unsigned long sversion:28;
|
||||
unsigned short opt;
|
||||
const char name[80]; /* The hardware description */
|
||||
};
|
||||
unsigned int hw_type:8; /* HPHW_xxx */
|
||||
unsigned int hversion:12;
|
||||
unsigned int sversion:12;
|
||||
unsigned char opt;
|
||||
unsigned char name[59]; /* The hardware description */
|
||||
} __packed;
|
||||
|
||||
struct parisc_device;
|
||||
|
||||
|
||||
@@ -363,20 +363,25 @@
|
||||
|
||||
#if !defined(__ASSEMBLY__)
|
||||
|
||||
/* flags of the device_path */
|
||||
/* flags for hardware_path */
|
||||
#define PF_AUTOBOOT 0x80
|
||||
#define PF_AUTOSEARCH 0x40
|
||||
#define PF_TIMER 0x0F
|
||||
|
||||
struct device_path { /* page 1-69 */
|
||||
unsigned char flags; /* flags see above! */
|
||||
unsigned char bc[6]; /* bus converter routing info */
|
||||
unsigned char mod;
|
||||
unsigned int layers[6];/* device-specific layer-info */
|
||||
} __attribute__((aligned(8))) ;
|
||||
struct hardware_path {
|
||||
unsigned char flags; /* see bit definitions below */
|
||||
signed char bc[6]; /* Bus Converter routing info to a specific */
|
||||
/* I/O adaptor (< 0 means none, > 63 resvd) */
|
||||
signed char mod; /* fixed field of specified module */
|
||||
};
|
||||
|
||||
struct pdc_module_path { /* page 1-69 */
|
||||
struct hardware_path path;
|
||||
unsigned int layers[6]; /* device-specific info (ctlr #, unit # ...) */
|
||||
} __attribute__((aligned(8)));
|
||||
|
||||
struct pz_device {
|
||||
struct device_path dp; /* see above */
|
||||
struct pdc_module_path dp; /* see above */
|
||||
/* struct iomod *hpa; */
|
||||
unsigned int hpa; /* HPA base address */
|
||||
/* char *spa; */
|
||||
@@ -611,21 +616,6 @@ struct pdc_initiator { /* PDC_INITIATOR */
|
||||
int mode;
|
||||
};
|
||||
|
||||
struct hardware_path {
|
||||
char flags; /* see bit definitions below */
|
||||
char bc[6]; /* Bus Converter routing info to a specific */
|
||||
/* I/O adaptor (< 0 means none, > 63 resvd) */
|
||||
char mod; /* fixed field of specified module */
|
||||
};
|
||||
|
||||
/*
|
||||
* Device path specifications used by PDC.
|
||||
*/
|
||||
struct pdc_module_path {
|
||||
struct hardware_path path;
|
||||
unsigned int layers[6]; /* device-specific info (ctlr #, unit # ...) */
|
||||
};
|
||||
|
||||
/* Only used on some pre-PA2.0 boxes */
|
||||
struct pdc_memory_map { /* PDC_MEMORY_MAP */
|
||||
unsigned long hpa; /* mod's register set address */
|
||||
|
||||
@@ -882,15 +882,13 @@ void __init walk_central_bus(void)
|
||||
&root);
|
||||
}
|
||||
|
||||
static void print_parisc_device(struct parisc_device *dev)
|
||||
static __init void print_parisc_device(struct parisc_device *dev)
|
||||
{
|
||||
char hw_path[64];
|
||||
static int count;
|
||||
static int count __initdata;
|
||||
|
||||
print_pa_hwpath(dev, hw_path);
|
||||
pr_info("%d. %s at %pap [%s] { %d, 0x%x, 0x%.3x, 0x%.5x }",
|
||||
++count, dev->name, &(dev->hpa.start), hw_path, dev->id.hw_type,
|
||||
dev->id.hversion_rev, dev->id.hversion, dev->id.sversion);
|
||||
pr_info("%d. %s at %pap { type:%d, hv:%#x, sv:%#x, rev:%#x }",
|
||||
++count, dev->name, &(dev->hpa.start), dev->id.hw_type,
|
||||
dev->id.hversion, dev->id.sversion, dev->id.hversion_rev);
|
||||
|
||||
if (dev->num_addrs) {
|
||||
int k;
|
||||
@@ -1079,7 +1077,7 @@ static __init int qemu_print_iodc_data(struct device *lin_dev, void *data)
|
||||
|
||||
|
||||
|
||||
static int print_one_device(struct device * dev, void * data)
|
||||
static __init int print_one_device(struct device * dev, void * data)
|
||||
{
|
||||
struct parisc_device * pdev = to_parisc_device(dev);
|
||||
|
||||
|
||||
@@ -1556,7 +1556,7 @@ static bool validate_ipv4_net_dev(struct net_device *net_dev,
|
||||
return false;
|
||||
|
||||
memset(&fl4, 0, sizeof(fl4));
|
||||
fl4.flowi4_iif = net_dev->ifindex;
|
||||
fl4.flowi4_oif = net_dev->ifindex;
|
||||
fl4.daddr = daddr;
|
||||
fl4.saddr = saddr;
|
||||
|
||||
|
||||
@@ -2815,10 +2815,18 @@ static int __init ib_core_init(void)
|
||||
|
||||
nldev_init();
|
||||
rdma_nl_register(RDMA_NL_LS, ibnl_ls_cb_table);
|
||||
roce_gid_mgmt_init();
|
||||
ret = roce_gid_mgmt_init();
|
||||
if (ret) {
|
||||
pr_warn("Couldn't init RoCE GID management\n");
|
||||
goto err_parent;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
err_parent:
|
||||
rdma_nl_unregister(RDMA_NL_LS);
|
||||
nldev_exit();
|
||||
unregister_pernet_device(&rdma_dev_net_ops);
|
||||
err_compat:
|
||||
unregister_blocking_lsm_notifier(&ibdev_lsm_nb);
|
||||
err_sa:
|
||||
|
||||
@@ -2537,7 +2537,7 @@ void __init nldev_init(void)
|
||||
rdma_nl_register(RDMA_NL_NLDEV, nldev_cb_table);
|
||||
}
|
||||
|
||||
void __exit nldev_exit(void)
|
||||
void nldev_exit(void)
|
||||
{
|
||||
rdma_nl_unregister(RDMA_NL_NLDEV);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
|
||||
/*
|
||||
* Copyright 2018-2021 Amazon.com, Inc. or its affiliates. All rights reserved.
|
||||
* Copyright 2018-2022 Amazon.com, Inc. or its affiliates. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
@@ -14,10 +14,12 @@
|
||||
|
||||
#define PCI_DEV_ID_EFA0_VF 0xefa0
|
||||
#define PCI_DEV_ID_EFA1_VF 0xefa1
|
||||
#define PCI_DEV_ID_EFA2_VF 0xefa2
|
||||
|
||||
static const struct pci_device_id efa_pci_tbl[] = {
|
||||
{ PCI_VDEVICE(AMAZON, PCI_DEV_ID_EFA0_VF) },
|
||||
{ PCI_VDEVICE(AMAZON, PCI_DEV_ID_EFA1_VF) },
|
||||
{ PCI_VDEVICE(AMAZON, PCI_DEV_ID_EFA2_VF) },
|
||||
{ }
|
||||
};
|
||||
|
||||
|
||||
@@ -913,8 +913,7 @@ void sc_disable(struct send_context *sc)
|
||||
spin_unlock(&sc->release_lock);
|
||||
|
||||
write_seqlock(&sc->waitlock);
|
||||
if (!list_empty(&sc->piowait))
|
||||
list_move(&sc->piowait, &wake_list);
|
||||
list_splice_init(&sc->piowait, &wake_list);
|
||||
write_sequnlock(&sc->waitlock);
|
||||
while (!list_empty(&wake_list)) {
|
||||
struct iowait *wait;
|
||||
|
||||
@@ -118,7 +118,6 @@ static const u32 hns_roce_op_code[] = {
|
||||
HR_OPC_MAP(ATOMIC_CMP_AND_SWP, ATOM_CMP_AND_SWAP),
|
||||
HR_OPC_MAP(ATOMIC_FETCH_AND_ADD, ATOM_FETCH_AND_ADD),
|
||||
HR_OPC_MAP(SEND_WITH_INV, SEND_WITH_INV),
|
||||
HR_OPC_MAP(LOCAL_INV, LOCAL_INV),
|
||||
HR_OPC_MAP(MASKED_ATOMIC_CMP_AND_SWP, ATOM_MSK_CMP_AND_SWAP),
|
||||
HR_OPC_MAP(MASKED_ATOMIC_FETCH_AND_ADD, ATOM_MSK_FETCH_AND_ADD),
|
||||
HR_OPC_MAP(REG_MR, FAST_REG_PMR),
|
||||
@@ -559,9 +558,6 @@ static int set_rc_opcode(struct hns_roce_dev *hr_dev,
|
||||
else
|
||||
ret = -EOPNOTSUPP;
|
||||
break;
|
||||
case IB_WR_LOCAL_INV:
|
||||
hr_reg_enable(rc_sq_wqe, RC_SEND_WQE_SO);
|
||||
fallthrough;
|
||||
case IB_WR_SEND_WITH_INV:
|
||||
rc_sq_wqe->inv_key = cpu_to_le32(wr->ex.invalidate_rkey);
|
||||
break;
|
||||
@@ -2805,8 +2801,12 @@ static int free_mr_modify_qp(struct hns_roce_dev *hr_dev)
|
||||
|
||||
static int free_mr_init(struct hns_roce_dev *hr_dev)
|
||||
{
|
||||
struct hns_roce_v2_priv *priv = hr_dev->priv;
|
||||
struct hns_roce_v2_free_mr *free_mr = &priv->free_mr;
|
||||
int ret;
|
||||
|
||||
mutex_init(&free_mr->mutex);
|
||||
|
||||
ret = free_mr_alloc_res(hr_dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -3222,7 +3222,6 @@ static int hns_roce_v2_write_mtpt(struct hns_roce_dev *hr_dev,
|
||||
|
||||
hr_reg_write(mpt_entry, MPT_ST, V2_MPT_ST_VALID);
|
||||
hr_reg_write(mpt_entry, MPT_PD, mr->pd);
|
||||
hr_reg_enable(mpt_entry, MPT_L_INV_EN);
|
||||
|
||||
hr_reg_write_bool(mpt_entry, MPT_BIND_EN,
|
||||
mr->access & IB_ACCESS_MW_BIND);
|
||||
@@ -3313,7 +3312,6 @@ static int hns_roce_v2_frmr_write_mtpt(struct hns_roce_dev *hr_dev,
|
||||
|
||||
hr_reg_enable(mpt_entry, MPT_RA_EN);
|
||||
hr_reg_enable(mpt_entry, MPT_R_INV_EN);
|
||||
hr_reg_enable(mpt_entry, MPT_L_INV_EN);
|
||||
|
||||
hr_reg_enable(mpt_entry, MPT_FRE);
|
||||
hr_reg_clear(mpt_entry, MPT_MR_MW);
|
||||
@@ -3345,7 +3343,6 @@ static int hns_roce_v2_mw_write_mtpt(void *mb_buf, struct hns_roce_mw *mw)
|
||||
hr_reg_write(mpt_entry, MPT_PD, mw->pdn);
|
||||
|
||||
hr_reg_enable(mpt_entry, MPT_R_INV_EN);
|
||||
hr_reg_enable(mpt_entry, MPT_L_INV_EN);
|
||||
hr_reg_enable(mpt_entry, MPT_LW_EN);
|
||||
|
||||
hr_reg_enable(mpt_entry, MPT_MR_MW);
|
||||
@@ -3794,7 +3791,6 @@ static const u32 wc_send_op_map[] = {
|
||||
HR_WC_OP_MAP(RDMA_READ, RDMA_READ),
|
||||
HR_WC_OP_MAP(RDMA_WRITE, RDMA_WRITE),
|
||||
HR_WC_OP_MAP(RDMA_WRITE_WITH_IMM, RDMA_WRITE),
|
||||
HR_WC_OP_MAP(LOCAL_INV, LOCAL_INV),
|
||||
HR_WC_OP_MAP(ATOM_CMP_AND_SWAP, COMP_SWAP),
|
||||
HR_WC_OP_MAP(ATOM_FETCH_AND_ADD, FETCH_ADD),
|
||||
HR_WC_OP_MAP(ATOM_MSK_CMP_AND_SWAP, MASKED_COMP_SWAP),
|
||||
@@ -3844,9 +3840,6 @@ static void fill_send_wc(struct ib_wc *wc, struct hns_roce_v2_cqe *cqe)
|
||||
case HNS_ROCE_V2_WQE_OP_RDMA_WRITE_WITH_IMM:
|
||||
wc->wc_flags |= IB_WC_WITH_IMM;
|
||||
break;
|
||||
case HNS_ROCE_V2_WQE_OP_LOCAL_INV:
|
||||
wc->wc_flags |= IB_WC_WITH_INVALIDATE;
|
||||
break;
|
||||
case HNS_ROCE_V2_WQE_OP_ATOM_CMP_AND_SWAP:
|
||||
case HNS_ROCE_V2_WQE_OP_ATOM_FETCH_AND_ADD:
|
||||
case HNS_ROCE_V2_WQE_OP_ATOM_MSK_CMP_AND_SWAP:
|
||||
|
||||
@@ -179,7 +179,6 @@ enum {
|
||||
HNS_ROCE_V2_WQE_OP_ATOM_MSK_CMP_AND_SWAP = 0x8,
|
||||
HNS_ROCE_V2_WQE_OP_ATOM_MSK_FETCH_AND_ADD = 0x9,
|
||||
HNS_ROCE_V2_WQE_OP_FAST_REG_PMR = 0xa,
|
||||
HNS_ROCE_V2_WQE_OP_LOCAL_INV = 0xb,
|
||||
HNS_ROCE_V2_WQE_OP_BIND_MW = 0xc,
|
||||
HNS_ROCE_V2_WQE_OP_MASK = 0x1f,
|
||||
};
|
||||
@@ -915,7 +914,6 @@ struct hns_roce_v2_rc_send_wqe {
|
||||
#define RC_SEND_WQE_OWNER RC_SEND_WQE_FIELD_LOC(7, 7)
|
||||
#define RC_SEND_WQE_CQE RC_SEND_WQE_FIELD_LOC(8, 8)
|
||||
#define RC_SEND_WQE_FENCE RC_SEND_WQE_FIELD_LOC(9, 9)
|
||||
#define RC_SEND_WQE_SO RC_SEND_WQE_FIELD_LOC(10, 10)
|
||||
#define RC_SEND_WQE_SE RC_SEND_WQE_FIELD_LOC(11, 11)
|
||||
#define RC_SEND_WQE_INLINE RC_SEND_WQE_FIELD_LOC(12, 12)
|
||||
#define RC_SEND_WQE_WQE_INDEX RC_SEND_WQE_FIELD_LOC(30, 15)
|
||||
|
||||
@@ -344,6 +344,10 @@ static int qedr_alloc_resources(struct qedr_dev *dev)
|
||||
if (IS_IWARP(dev)) {
|
||||
xa_init(&dev->qps);
|
||||
dev->iwarp_wq = create_singlethread_workqueue("qedr_iwarpq");
|
||||
if (!dev->iwarp_wq) {
|
||||
rc = -ENOMEM;
|
||||
goto err1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Allocate Status blocks for CNQ */
|
||||
@@ -351,7 +355,7 @@ static int qedr_alloc_resources(struct qedr_dev *dev)
|
||||
GFP_KERNEL);
|
||||
if (!dev->sb_array) {
|
||||
rc = -ENOMEM;
|
||||
goto err1;
|
||||
goto err_destroy_wq;
|
||||
}
|
||||
|
||||
dev->cnq_array = kcalloc(dev->num_cnq,
|
||||
@@ -402,6 +406,9 @@ err3:
|
||||
kfree(dev->cnq_array);
|
||||
err2:
|
||||
kfree(dev->sb_array);
|
||||
err_destroy_wq:
|
||||
if (IS_IWARP(dev))
|
||||
destroy_workqueue(dev->iwarp_wq);
|
||||
err1:
|
||||
kfree(dev->sgid_tbl);
|
||||
return rc;
|
||||
|
||||
@@ -806,8 +806,10 @@ static enum resp_states read_reply(struct rxe_qp *qp,
|
||||
|
||||
skb = prepare_ack_packet(qp, &ack_pkt, opcode, payload,
|
||||
res->cur_psn, AETH_ACK_UNLIMITED);
|
||||
if (!skb)
|
||||
if (!skb) {
|
||||
rxe_put(mr);
|
||||
return RESPST_ERR_RNR;
|
||||
}
|
||||
|
||||
rxe_mr_copy(mr, res->read.va, payload_addr(&ack_pkt),
|
||||
payload, RXE_FROM_MR_OBJ);
|
||||
|
||||
@@ -866,6 +866,7 @@ int iosapic_serial_irq(struct parisc_device *dev)
|
||||
|
||||
return vi->txn_irq;
|
||||
}
|
||||
EXPORT_SYMBOL(iosapic_serial_irq);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* all) PA-RISC machines should have them. Anyway, for safety reasons, the
|
||||
* following code can deal with just 96 bytes of Stable Storage, and all
|
||||
* sizes between 96 and 192 bytes (provided they are multiple of struct
|
||||
* device_path size, eg: 128, 160 and 192) to provide full information.
|
||||
* pdc_module_path size, eg: 128, 160 and 192) to provide full information.
|
||||
* One last word: there's one path we can always count on: the primary path.
|
||||
* Anything above 224 bytes is used for 'osdep2' OS-dependent storage area.
|
||||
*
|
||||
@@ -88,7 +88,7 @@ struct pdcspath_entry {
|
||||
short ready; /* entry record is valid if != 0 */
|
||||
unsigned long addr; /* entry address in stable storage */
|
||||
char *name; /* entry name */
|
||||
struct device_path devpath; /* device path in parisc representation */
|
||||
struct pdc_module_path devpath; /* device path in parisc representation */
|
||||
struct device *dev; /* corresponding device */
|
||||
struct kobject kobj;
|
||||
};
|
||||
@@ -138,7 +138,7 @@ struct pdcspath_attribute paths_attr_##_name = { \
|
||||
static int
|
||||
pdcspath_fetch(struct pdcspath_entry *entry)
|
||||
{
|
||||
struct device_path *devpath;
|
||||
struct pdc_module_path *devpath;
|
||||
|
||||
if (!entry)
|
||||
return -EINVAL;
|
||||
@@ -153,7 +153,7 @@ pdcspath_fetch(struct pdcspath_entry *entry)
|
||||
return -EIO;
|
||||
|
||||
/* Find the matching device.
|
||||
NOTE: hardware_path overlays with device_path, so the nice cast can
|
||||
NOTE: hardware_path overlays with pdc_module_path, so the nice cast can
|
||||
be used */
|
||||
entry->dev = hwpath_to_device((struct hardware_path *)devpath);
|
||||
|
||||
@@ -179,7 +179,7 @@ pdcspath_fetch(struct pdcspath_entry *entry)
|
||||
static void
|
||||
pdcspath_store(struct pdcspath_entry *entry)
|
||||
{
|
||||
struct device_path *devpath;
|
||||
struct pdc_module_path *devpath;
|
||||
|
||||
BUG_ON(!entry);
|
||||
|
||||
@@ -221,7 +221,7 @@ static ssize_t
|
||||
pdcspath_hwpath_read(struct pdcspath_entry *entry, char *buf)
|
||||
{
|
||||
char *out = buf;
|
||||
struct device_path *devpath;
|
||||
struct pdc_module_path *devpath;
|
||||
short i;
|
||||
|
||||
if (!entry || !buf)
|
||||
@@ -236,11 +236,11 @@ pdcspath_hwpath_read(struct pdcspath_entry *entry, char *buf)
|
||||
return -ENODATA;
|
||||
|
||||
for (i = 0; i < 6; i++) {
|
||||
if (devpath->bc[i] >= 128)
|
||||
if (devpath->path.bc[i] < 0)
|
||||
continue;
|
||||
out += sprintf(out, "%u/", (unsigned char)devpath->bc[i]);
|
||||
out += sprintf(out, "%d/", devpath->path.bc[i]);
|
||||
}
|
||||
out += sprintf(out, "%u\n", (unsigned char)devpath->mod);
|
||||
out += sprintf(out, "%u\n", (unsigned char)devpath->path.mod);
|
||||
|
||||
return out - buf;
|
||||
}
|
||||
@@ -296,12 +296,12 @@ pdcspath_hwpath_write(struct pdcspath_entry *entry, const char *buf, size_t coun
|
||||
for (i=5; ((temp = strrchr(in, '/'))) && (temp-in > 0) && (likely(i)); i--) {
|
||||
hwpath.bc[i] = simple_strtoul(temp+1, NULL, 10);
|
||||
in[temp-in] = '\0';
|
||||
DPRINTK("%s: bc[%d]: %d\n", __func__, i, hwpath.bc[i]);
|
||||
DPRINTK("%s: bc[%d]: %d\n", __func__, i, hwpath.path.bc[i]);
|
||||
}
|
||||
|
||||
/* Store the final field */
|
||||
hwpath.bc[i] = simple_strtoul(in, NULL, 10);
|
||||
DPRINTK("%s: bc[%d]: %d\n", __func__, i, hwpath.bc[i]);
|
||||
DPRINTK("%s: bc[%d]: %d\n", __func__, i, hwpath.path.bc[i]);
|
||||
|
||||
/* Now we check that the user isn't trying to lure us */
|
||||
if (!(dev = hwpath_to_device((struct hardware_path *)&hwpath))) {
|
||||
@@ -342,7 +342,7 @@ static ssize_t
|
||||
pdcspath_layer_read(struct pdcspath_entry *entry, char *buf)
|
||||
{
|
||||
char *out = buf;
|
||||
struct device_path *devpath;
|
||||
struct pdc_module_path *devpath;
|
||||
short i;
|
||||
|
||||
if (!entry || !buf)
|
||||
@@ -547,7 +547,7 @@ static ssize_t pdcs_auto_read(struct kobject *kobj,
|
||||
pathentry = &pdcspath_entry_primary;
|
||||
|
||||
read_lock(&pathentry->rw_lock);
|
||||
out += sprintf(out, "%s\n", (pathentry->devpath.flags & knob) ?
|
||||
out += sprintf(out, "%s\n", (pathentry->devpath.path.flags & knob) ?
|
||||
"On" : "Off");
|
||||
read_unlock(&pathentry->rw_lock);
|
||||
|
||||
@@ -594,8 +594,8 @@ static ssize_t pdcs_timer_read(struct kobject *kobj,
|
||||
|
||||
/* print the timer value in seconds */
|
||||
read_lock(&pathentry->rw_lock);
|
||||
out += sprintf(out, "%u\n", (pathentry->devpath.flags & PF_TIMER) ?
|
||||
(1 << (pathentry->devpath.flags & PF_TIMER)) : 0);
|
||||
out += sprintf(out, "%u\n", (pathentry->devpath.path.flags & PF_TIMER) ?
|
||||
(1 << (pathentry->devpath.path.flags & PF_TIMER)) : 0);
|
||||
read_unlock(&pathentry->rw_lock);
|
||||
|
||||
return out - buf;
|
||||
@@ -764,7 +764,7 @@ static ssize_t pdcs_auto_write(struct kobject *kobj,
|
||||
|
||||
/* Be nice to the existing flag record */
|
||||
read_lock(&pathentry->rw_lock);
|
||||
flags = pathentry->devpath.flags;
|
||||
flags = pathentry->devpath.path.flags;
|
||||
read_unlock(&pathentry->rw_lock);
|
||||
|
||||
DPRINTK("%s: flags before: 0x%X\n", __func__, flags);
|
||||
@@ -785,7 +785,7 @@ static ssize_t pdcs_auto_write(struct kobject *kobj,
|
||||
write_lock(&pathentry->rw_lock);
|
||||
|
||||
/* Change the path entry flags first */
|
||||
pathentry->devpath.flags = flags;
|
||||
pathentry->devpath.path.flags = flags;
|
||||
|
||||
/* Now, dive in. Write back to the hardware */
|
||||
pdcspath_store(pathentry);
|
||||
|
||||
@@ -116,9 +116,9 @@ config SERIAL_8250_CONSOLE
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
config SERIAL_8250_GSC
|
||||
config SERIAL_8250_PARISC
|
||||
tristate
|
||||
depends on SERIAL_8250 && GSC
|
||||
depends on SERIAL_8250 && PARISC
|
||||
default SERIAL_8250
|
||||
|
||||
config SERIAL_8250_DMA
|
||||
|
||||
@@ -12,7 +12,7 @@ obj-$(CONFIG_SERIAL_8250) += 8250.o 8250_base.o
|
||||
8250_base-$(CONFIG_SERIAL_8250_DMA) += 8250_dma.o
|
||||
8250_base-$(CONFIG_SERIAL_8250_DWLIB) += 8250_dwlib.o
|
||||
8250_base-$(CONFIG_SERIAL_8250_FINTEK) += 8250_fintek.o
|
||||
obj-$(CONFIG_SERIAL_8250_GSC) += 8250_gsc.o
|
||||
obj-$(CONFIG_SERIAL_8250_PARISC) += 8250_parisc.o
|
||||
obj-$(CONFIG_SERIAL_8250_PCI) += 8250_pci.o
|
||||
obj-$(CONFIG_SERIAL_8250_EXAR) += 8250_exar.o
|
||||
obj-$(CONFIG_SERIAL_8250_HP300) += 8250_hp300.o
|
||||
|
||||
@@ -280,7 +280,7 @@ EXPORT_SYMBOL_GPL(nfs_put_client);
|
||||
static struct nfs_client *nfs_match_client(const struct nfs_client_initdata *data)
|
||||
{
|
||||
struct nfs_client *clp;
|
||||
const struct sockaddr *sap = data->addr;
|
||||
const struct sockaddr *sap = (struct sockaddr *)data->addr;
|
||||
struct nfs_net *nn = net_generic(data->net, nfs_net_id);
|
||||
int error;
|
||||
|
||||
@@ -666,7 +666,7 @@ static int nfs_init_server(struct nfs_server *server,
|
||||
struct rpc_timeout timeparms;
|
||||
struct nfs_client_initdata cl_init = {
|
||||
.hostname = ctx->nfs_server.hostname,
|
||||
.addr = (const struct sockaddr *)&ctx->nfs_server.address,
|
||||
.addr = &ctx->nfs_server._address,
|
||||
.addrlen = ctx->nfs_server.addrlen,
|
||||
.nfs_mod = ctx->nfs_mod,
|
||||
.proto = ctx->nfs_server.protocol,
|
||||
|
||||
@@ -228,8 +228,7 @@ again:
|
||||
*
|
||||
*/
|
||||
void nfs_inode_reclaim_delegation(struct inode *inode, const struct cred *cred,
|
||||
fmode_t type,
|
||||
const nfs4_stateid *stateid,
|
||||
fmode_t type, const nfs4_stateid *stateid,
|
||||
unsigned long pagemod_limit)
|
||||
{
|
||||
struct nfs_delegation *delegation;
|
||||
@@ -239,25 +238,24 @@ void nfs_inode_reclaim_delegation(struct inode *inode, const struct cred *cred,
|
||||
delegation = rcu_dereference(NFS_I(inode)->delegation);
|
||||
if (delegation != NULL) {
|
||||
spin_lock(&delegation->lock);
|
||||
if (nfs4_is_valid_delegation(delegation, 0)) {
|
||||
nfs4_stateid_copy(&delegation->stateid, stateid);
|
||||
delegation->type = type;
|
||||
delegation->pagemod_limit = pagemod_limit;
|
||||
oldcred = delegation->cred;
|
||||
delegation->cred = get_cred(cred);
|
||||
clear_bit(NFS_DELEGATION_NEED_RECLAIM,
|
||||
&delegation->flags);
|
||||
spin_unlock(&delegation->lock);
|
||||
rcu_read_unlock();
|
||||
put_cred(oldcred);
|
||||
trace_nfs4_reclaim_delegation(inode, type);
|
||||
return;
|
||||
}
|
||||
/* We appear to have raced with a delegation return. */
|
||||
nfs4_stateid_copy(&delegation->stateid, stateid);
|
||||
delegation->type = type;
|
||||
delegation->pagemod_limit = pagemod_limit;
|
||||
oldcred = delegation->cred;
|
||||
delegation->cred = get_cred(cred);
|
||||
clear_bit(NFS_DELEGATION_NEED_RECLAIM, &delegation->flags);
|
||||
if (test_and_clear_bit(NFS_DELEGATION_REVOKED,
|
||||
&delegation->flags))
|
||||
atomic_long_inc(&nfs_active_delegations);
|
||||
spin_unlock(&delegation->lock);
|
||||
rcu_read_unlock();
|
||||
put_cred(oldcred);
|
||||
trace_nfs4_reclaim_delegation(inode, type);
|
||||
} else {
|
||||
rcu_read_unlock();
|
||||
nfs_inode_set_delegation(inode, cred, type, stateid,
|
||||
pagemod_limit);
|
||||
}
|
||||
rcu_read_unlock();
|
||||
nfs_inode_set_delegation(inode, cred, type, stateid, pagemod_limit);
|
||||
}
|
||||
|
||||
static int nfs_do_return_delegation(struct inode *inode, struct nfs_delegation *delegation, int issync)
|
||||
|
||||
@@ -2489,9 +2489,8 @@ int nfs_unlink(struct inode *dir, struct dentry *dentry)
|
||||
spin_unlock(&dentry->d_lock);
|
||||
goto out;
|
||||
}
|
||||
if (dentry->d_fsdata)
|
||||
/* old devname */
|
||||
kfree(dentry->d_fsdata);
|
||||
/* old devname */
|
||||
kfree(dentry->d_fsdata);
|
||||
dentry->d_fsdata = NFS_FSDATA_BLOCKED;
|
||||
|
||||
spin_unlock(&dentry->d_lock);
|
||||
|
||||
@@ -16,8 +16,9 @@
|
||||
#include "dns_resolve.h"
|
||||
|
||||
ssize_t nfs_dns_resolve_name(struct net *net, char *name, size_t namelen,
|
||||
struct sockaddr *sa, size_t salen)
|
||||
struct sockaddr_storage *ss, size_t salen)
|
||||
{
|
||||
struct sockaddr *sa = (struct sockaddr *)ss;
|
||||
ssize_t ret;
|
||||
char *ip_addr = NULL;
|
||||
int ip_len;
|
||||
@@ -341,7 +342,7 @@ out:
|
||||
}
|
||||
|
||||
ssize_t nfs_dns_resolve_name(struct net *net, char *name,
|
||||
size_t namelen, struct sockaddr *sa, size_t salen)
|
||||
size_t namelen, struct sockaddr_storage *ss, size_t salen)
|
||||
{
|
||||
struct nfs_dns_ent key = {
|
||||
.hostname = name,
|
||||
@@ -354,7 +355,7 @@ ssize_t nfs_dns_resolve_name(struct net *net, char *name,
|
||||
ret = do_cache_lookup_wait(nn->nfs_dns_resolve, &key, &item);
|
||||
if (ret == 0) {
|
||||
if (salen >= item->addrlen) {
|
||||
memcpy(sa, &item->addr, item->addrlen);
|
||||
memcpy(ss, &item->addr, item->addrlen);
|
||||
ret = item->addrlen;
|
||||
} else
|
||||
ret = -EOVERFLOW;
|
||||
|
||||
@@ -32,6 +32,6 @@ extern void nfs_dns_resolver_cache_destroy(struct net *net);
|
||||
#endif
|
||||
|
||||
extern ssize_t nfs_dns_resolve_name(struct net *net, char *name,
|
||||
size_t namelen, struct sockaddr *sa, size_t salen);
|
||||
size_t namelen, struct sockaddr_storage *sa, size_t salen);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -273,9 +273,9 @@ static const struct constant_table nfs_secflavor_tokens[] = {
|
||||
* Address family must be initialized, and address must not be
|
||||
* the ANY address for that family.
|
||||
*/
|
||||
static int nfs_verify_server_address(struct sockaddr *addr)
|
||||
static int nfs_verify_server_address(struct sockaddr_storage *addr)
|
||||
{
|
||||
switch (addr->sa_family) {
|
||||
switch (addr->ss_family) {
|
||||
case AF_INET: {
|
||||
struct sockaddr_in *sa = (struct sockaddr_in *)addr;
|
||||
return sa->sin_addr.s_addr != htonl(INADDR_ANY);
|
||||
@@ -969,7 +969,7 @@ static int nfs23_parse_monolithic(struct fs_context *fc,
|
||||
{
|
||||
struct nfs_fs_context *ctx = nfs_fc2context(fc);
|
||||
struct nfs_fh *mntfh = ctx->mntfh;
|
||||
struct sockaddr *sap = (struct sockaddr *)&ctx->nfs_server.address;
|
||||
struct sockaddr_storage *sap = &ctx->nfs_server._address;
|
||||
int extra_flags = NFS_MOUNT_LEGACY_INTERFACE;
|
||||
int ret;
|
||||
|
||||
@@ -1044,7 +1044,7 @@ static int nfs23_parse_monolithic(struct fs_context *fc,
|
||||
memcpy(sap, &data->addr, sizeof(data->addr));
|
||||
ctx->nfs_server.addrlen = sizeof(data->addr);
|
||||
ctx->nfs_server.port = ntohs(data->addr.sin_port);
|
||||
if (sap->sa_family != AF_INET ||
|
||||
if (sap->ss_family != AF_INET ||
|
||||
!nfs_verify_server_address(sap))
|
||||
goto out_no_address;
|
||||
|
||||
@@ -1200,7 +1200,7 @@ static int nfs4_parse_monolithic(struct fs_context *fc,
|
||||
struct nfs4_mount_data *data)
|
||||
{
|
||||
struct nfs_fs_context *ctx = nfs_fc2context(fc);
|
||||
struct sockaddr *sap = (struct sockaddr *)&ctx->nfs_server.address;
|
||||
struct sockaddr_storage *sap = &ctx->nfs_server._address;
|
||||
int ret;
|
||||
char *c;
|
||||
|
||||
@@ -1314,7 +1314,7 @@ static int nfs_fs_context_validate(struct fs_context *fc)
|
||||
{
|
||||
struct nfs_fs_context *ctx = nfs_fc2context(fc);
|
||||
struct nfs_subversion *nfs_mod;
|
||||
struct sockaddr *sap = (struct sockaddr *)&ctx->nfs_server.address;
|
||||
struct sockaddr_storage *sap = &ctx->nfs_server._address;
|
||||
int max_namelen = PAGE_SIZE;
|
||||
int max_pathlen = NFS_MAXPATHLEN;
|
||||
int port = 0;
|
||||
@@ -1540,7 +1540,7 @@ static int nfs_init_fs_context(struct fs_context *fc)
|
||||
ctx->version = nfss->nfs_client->rpc_ops->version;
|
||||
ctx->minorversion = nfss->nfs_client->cl_minorversion;
|
||||
|
||||
memcpy(&ctx->nfs_server.address, &nfss->nfs_client->cl_addr,
|
||||
memcpy(&ctx->nfs_server._address, &nfss->nfs_client->cl_addr,
|
||||
ctx->nfs_server.addrlen);
|
||||
|
||||
if (fc->net_ns != net) {
|
||||
|
||||
@@ -69,7 +69,7 @@ static inline fmode_t flags_to_mode(int flags)
|
||||
struct nfs_client_initdata {
|
||||
unsigned long init_flags;
|
||||
const char *hostname; /* Hostname of the server */
|
||||
const struct sockaddr *addr; /* Address of the server */
|
||||
const struct sockaddr_storage *addr; /* Address of the server */
|
||||
const char *nodename; /* Hostname of the client */
|
||||
const char *ip_addr; /* IP address of the client */
|
||||
size_t addrlen;
|
||||
@@ -180,7 +180,7 @@ static inline struct nfs_fs_context *nfs_fc2context(const struct fs_context *fc)
|
||||
|
||||
/* mount_clnt.c */
|
||||
struct nfs_mount_request {
|
||||
struct sockaddr *sap;
|
||||
struct sockaddr_storage *sap;
|
||||
size_t salen;
|
||||
char *hostname;
|
||||
char *dirpath;
|
||||
@@ -223,7 +223,7 @@ extern void nfs4_server_set_init_caps(struct nfs_server *);
|
||||
extern struct nfs_server *nfs4_create_server(struct fs_context *);
|
||||
extern struct nfs_server *nfs4_create_referral_server(struct fs_context *);
|
||||
extern int nfs4_update_server(struct nfs_server *server, const char *hostname,
|
||||
struct sockaddr *sap, size_t salen,
|
||||
struct sockaddr_storage *sap, size_t salen,
|
||||
struct net *net);
|
||||
extern void nfs_free_server(struct nfs_server *server);
|
||||
extern struct nfs_server *nfs_clone_server(struct nfs_server *,
|
||||
@@ -235,7 +235,7 @@ extern int nfs_client_init_status(const struct nfs_client *clp);
|
||||
extern int nfs_wait_client_init_complete(const struct nfs_client *clp);
|
||||
extern void nfs_mark_client_ready(struct nfs_client *clp, int state);
|
||||
extern struct nfs_client *nfs4_set_ds_client(struct nfs_server *mds_srv,
|
||||
const struct sockaddr *ds_addr,
|
||||
const struct sockaddr_storage *ds_addr,
|
||||
int ds_addrlen, int ds_proto,
|
||||
unsigned int ds_timeo,
|
||||
unsigned int ds_retrans,
|
||||
@@ -243,7 +243,7 @@ extern struct nfs_client *nfs4_set_ds_client(struct nfs_server *mds_srv,
|
||||
extern struct rpc_clnt *nfs4_find_or_create_ds_client(struct nfs_client *,
|
||||
struct inode *);
|
||||
extern struct nfs_client *nfs3_set_ds_client(struct nfs_server *mds_srv,
|
||||
const struct sockaddr *ds_addr, int ds_addrlen,
|
||||
const struct sockaddr_storage *ds_addr, int ds_addrlen,
|
||||
int ds_proto, unsigned int ds_timeo,
|
||||
unsigned int ds_retrans);
|
||||
#ifdef CONFIG_PROC_FS
|
||||
@@ -894,13 +894,13 @@ static inline bool nfs_error_is_fatal_on_server(int err)
|
||||
* Select between a default port value and a user-specified port value.
|
||||
* If a zero value is set, then autobind will be used.
|
||||
*/
|
||||
static inline void nfs_set_port(struct sockaddr *sap, int *port,
|
||||
static inline void nfs_set_port(struct sockaddr_storage *sap, int *port,
|
||||
const unsigned short default_port)
|
||||
{
|
||||
if (*port == NFS_UNSPEC_PORT)
|
||||
*port = default_port;
|
||||
|
||||
rpc_set_port(sap, *port);
|
||||
rpc_set_port((struct sockaddr *)sap, *port);
|
||||
}
|
||||
|
||||
struct nfs_direct_req {
|
||||
|
||||
@@ -158,7 +158,7 @@ int nfs_mount(struct nfs_mount_request *info, int timeo, int retrans)
|
||||
struct rpc_create_args args = {
|
||||
.net = info->net,
|
||||
.protocol = info->protocol,
|
||||
.address = info->sap,
|
||||
.address = (struct sockaddr *)info->sap,
|
||||
.addrsize = info->salen,
|
||||
.timeout = &mnt_timeout,
|
||||
.servername = info->hostname,
|
||||
@@ -245,7 +245,7 @@ void nfs_umount(const struct nfs_mount_request *info)
|
||||
struct rpc_create_args args = {
|
||||
.net = info->net,
|
||||
.protocol = IPPROTO_UDP,
|
||||
.address = info->sap,
|
||||
.address = (struct sockaddr *)info->sap,
|
||||
.addrsize = info->salen,
|
||||
.timeout = &nfs_umnt_timeout,
|
||||
.servername = info->hostname,
|
||||
|
||||
@@ -175,7 +175,7 @@ struct vfsmount *nfs_d_automount(struct path *path)
|
||||
}
|
||||
|
||||
/* for submounts we want the same server; referrals will reassign */
|
||||
memcpy(&ctx->nfs_server.address, &client->cl_addr, client->cl_addrlen);
|
||||
memcpy(&ctx->nfs_server._address, &client->cl_addr, client->cl_addrlen);
|
||||
ctx->nfs_server.addrlen = client->cl_addrlen;
|
||||
ctx->nfs_server.port = server->port;
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ struct nfs_server *nfs3_clone_server(struct nfs_server *source,
|
||||
* the MDS.
|
||||
*/
|
||||
struct nfs_client *nfs3_set_ds_client(struct nfs_server *mds_srv,
|
||||
const struct sockaddr *ds_addr, int ds_addrlen,
|
||||
const struct sockaddr_storage *ds_addr, int ds_addrlen,
|
||||
int ds_proto, unsigned int ds_timeo, unsigned int ds_retrans)
|
||||
{
|
||||
struct rpc_timeout ds_timeout;
|
||||
@@ -98,7 +98,7 @@ struct nfs_client *nfs3_set_ds_client(struct nfs_server *mds_srv,
|
||||
char buf[INET6_ADDRSTRLEN + 1];
|
||||
|
||||
/* fake a hostname because lockd wants it */
|
||||
if (rpc_ntop(ds_addr, buf, sizeof(buf)) <= 0)
|
||||
if (rpc_ntop((struct sockaddr *)ds_addr, buf, sizeof(buf)) <= 0)
|
||||
return ERR_PTR(-EINVAL);
|
||||
cl_init.hostname = buf;
|
||||
|
||||
|
||||
@@ -1093,6 +1093,9 @@ static int _nfs42_proc_clone(struct rpc_message *msg, struct file *src_f,
|
||||
&args.seq_args, &res.seq_res, 0);
|
||||
trace_nfs4_clone(src_inode, dst_inode, &args, status);
|
||||
if (status == 0) {
|
||||
/* a zero-length count means clone to EOF in src */
|
||||
if (count == 0 && res.dst_fattr->valid & NFS_ATTR_FATTR_SIZE)
|
||||
count = nfs_size_to_loff_t(res.dst_fattr->size) - dst_offset;
|
||||
nfs42_copy_dest_done(dst_inode, dst_offset, count);
|
||||
status = nfs_post_op_update_inode(dst_inode, res.dst_fattr);
|
||||
}
|
||||
|
||||
@@ -281,7 +281,7 @@ struct rpc_clnt *nfs4_negotiate_security(struct rpc_clnt *, struct inode *,
|
||||
int nfs4_submount(struct fs_context *, struct nfs_server *);
|
||||
int nfs4_replace_transport(struct nfs_server *server,
|
||||
const struct nfs4_fs_locations *locations);
|
||||
size_t nfs_parse_server_name(char *string, size_t len, struct sockaddr *sa,
|
||||
size_t nfs_parse_server_name(char *string, size_t len, struct sockaddr_storage *ss,
|
||||
size_t salen, struct net *net, int port);
|
||||
/* nfs4proc.c */
|
||||
extern int nfs4_handle_exception(struct nfs_server *, int, struct nfs4_exception *);
|
||||
|
||||
@@ -346,6 +346,7 @@ int nfs40_init_client(struct nfs_client *clp)
|
||||
ret = nfs4_setup_slot_table(tbl, NFS4_MAX_SLOT_TABLE,
|
||||
"NFSv4.0 transport Slot table");
|
||||
if (ret) {
|
||||
nfs4_shutdown_slot_table(tbl);
|
||||
kfree(tbl);
|
||||
return ret;
|
||||
}
|
||||
@@ -889,7 +890,7 @@ nfs4_find_client_sessionid(struct net *net, const struct sockaddr *addr,
|
||||
*/
|
||||
static int nfs4_set_client(struct nfs_server *server,
|
||||
const char *hostname,
|
||||
const struct sockaddr *addr,
|
||||
const struct sockaddr_storage *addr,
|
||||
const size_t addrlen,
|
||||
const char *ip_addr,
|
||||
int proto, const struct rpc_timeout *timeparms,
|
||||
@@ -924,7 +925,7 @@ static int nfs4_set_client(struct nfs_server *server,
|
||||
__set_bit(NFS_CS_MIGRATION, &cl_init.init_flags);
|
||||
if (test_bit(NFS_MIG_TSM_POSSIBLE, &server->mig_status))
|
||||
__set_bit(NFS_CS_TSM_POSSIBLE, &cl_init.init_flags);
|
||||
server->port = rpc_get_port(addr);
|
||||
server->port = rpc_get_port((struct sockaddr *)addr);
|
||||
|
||||
/* Allocate or find a client reference we can use */
|
||||
clp = nfs_get_client(&cl_init);
|
||||
@@ -960,7 +961,7 @@ static int nfs4_set_client(struct nfs_server *server,
|
||||
* the MDS.
|
||||
*/
|
||||
struct nfs_client *nfs4_set_ds_client(struct nfs_server *mds_srv,
|
||||
const struct sockaddr *ds_addr, int ds_addrlen,
|
||||
const struct sockaddr_storage *ds_addr, int ds_addrlen,
|
||||
int ds_proto, unsigned int ds_timeo, unsigned int ds_retrans,
|
||||
u32 minor_version)
|
||||
{
|
||||
@@ -980,7 +981,7 @@ struct nfs_client *nfs4_set_ds_client(struct nfs_server *mds_srv,
|
||||
};
|
||||
char buf[INET6_ADDRSTRLEN + 1];
|
||||
|
||||
if (rpc_ntop(ds_addr, buf, sizeof(buf)) <= 0)
|
||||
if (rpc_ntop((struct sockaddr *)ds_addr, buf, sizeof(buf)) <= 0)
|
||||
return ERR_PTR(-EINVAL);
|
||||
cl_init.hostname = buf;
|
||||
|
||||
@@ -1148,7 +1149,7 @@ static int nfs4_init_server(struct nfs_server *server, struct fs_context *fc)
|
||||
/* Get a client record */
|
||||
error = nfs4_set_client(server,
|
||||
ctx->nfs_server.hostname,
|
||||
&ctx->nfs_server.address,
|
||||
&ctx->nfs_server._address,
|
||||
ctx->nfs_server.addrlen,
|
||||
ctx->client_address,
|
||||
ctx->nfs_server.protocol,
|
||||
@@ -1238,7 +1239,7 @@ struct nfs_server *nfs4_create_referral_server(struct fs_context *fc)
|
||||
rpc_set_port(&ctx->nfs_server.address, NFS_RDMA_PORT);
|
||||
error = nfs4_set_client(server,
|
||||
ctx->nfs_server.hostname,
|
||||
&ctx->nfs_server.address,
|
||||
&ctx->nfs_server._address,
|
||||
ctx->nfs_server.addrlen,
|
||||
parent_client->cl_ipaddr,
|
||||
XPRT_TRANSPORT_RDMA,
|
||||
@@ -1254,7 +1255,7 @@ struct nfs_server *nfs4_create_referral_server(struct fs_context *fc)
|
||||
rpc_set_port(&ctx->nfs_server.address, NFS_PORT);
|
||||
error = nfs4_set_client(server,
|
||||
ctx->nfs_server.hostname,
|
||||
&ctx->nfs_server.address,
|
||||
&ctx->nfs_server._address,
|
||||
ctx->nfs_server.addrlen,
|
||||
parent_client->cl_ipaddr,
|
||||
XPRT_TRANSPORT_TCP,
|
||||
@@ -1303,14 +1304,14 @@ error:
|
||||
* Returns zero on success, or a negative errno value.
|
||||
*/
|
||||
int nfs4_update_server(struct nfs_server *server, const char *hostname,
|
||||
struct sockaddr *sap, size_t salen, struct net *net)
|
||||
struct sockaddr_storage *sap, size_t salen, struct net *net)
|
||||
{
|
||||
struct nfs_client *clp = server->nfs_client;
|
||||
struct rpc_clnt *clnt = server->client;
|
||||
struct xprt_create xargs = {
|
||||
.ident = clp->cl_proto,
|
||||
.net = net,
|
||||
.dstaddr = sap,
|
||||
.dstaddr = (struct sockaddr *)sap,
|
||||
.addrlen = salen,
|
||||
.servername = hostname,
|
||||
};
|
||||
|
||||
@@ -164,16 +164,17 @@ static int nfs4_validate_fspath(struct dentry *dentry,
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t nfs_parse_server_name(char *string, size_t len, struct sockaddr *sa,
|
||||
size_t nfs_parse_server_name(char *string, size_t len, struct sockaddr_storage *ss,
|
||||
size_t salen, struct net *net, int port)
|
||||
{
|
||||
struct sockaddr *sa = (struct sockaddr *)ss;
|
||||
ssize_t ret;
|
||||
|
||||
ret = rpc_pton(net, string, len, sa, salen);
|
||||
if (ret == 0) {
|
||||
ret = rpc_uaddr2sockaddr(net, string, len, sa, salen);
|
||||
if (ret == 0) {
|
||||
ret = nfs_dns_resolve_name(net, string, len, sa, salen);
|
||||
ret = nfs_dns_resolve_name(net, string, len, ss, salen);
|
||||
if (ret < 0)
|
||||
ret = 0;
|
||||
}
|
||||
@@ -331,7 +332,7 @@ static int try_location(struct fs_context *fc,
|
||||
|
||||
ctx->nfs_server.addrlen =
|
||||
nfs_parse_server_name(buf->data, buf->len,
|
||||
&ctx->nfs_server.address,
|
||||
&ctx->nfs_server._address,
|
||||
sizeof(ctx->nfs_server._address),
|
||||
fc->net_ns, 0);
|
||||
if (ctx->nfs_server.addrlen == 0)
|
||||
@@ -483,14 +484,13 @@ static int nfs4_try_replacing_one_location(struct nfs_server *server,
|
||||
char *page, char *page2,
|
||||
const struct nfs4_fs_location *location)
|
||||
{
|
||||
const size_t addr_bufsize = sizeof(struct sockaddr_storage);
|
||||
struct net *net = rpc_net_ns(server->client);
|
||||
struct sockaddr *sap;
|
||||
struct sockaddr_storage *sap;
|
||||
unsigned int s;
|
||||
size_t salen;
|
||||
int error;
|
||||
|
||||
sap = kmalloc(addr_bufsize, GFP_KERNEL);
|
||||
sap = kmalloc(sizeof(*sap), GFP_KERNEL);
|
||||
if (sap == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -506,10 +506,10 @@ static int nfs4_try_replacing_one_location(struct nfs_server *server,
|
||||
continue;
|
||||
|
||||
salen = nfs_parse_server_name(buf->data, buf->len,
|
||||
sap, addr_bufsize, net, 0);
|
||||
sap, sizeof(*sap), net, 0);
|
||||
if (salen == 0)
|
||||
continue;
|
||||
rpc_set_port(sap, NFS_PORT);
|
||||
rpc_set_port((struct sockaddr *)sap, NFS_PORT);
|
||||
|
||||
error = -ENOMEM;
|
||||
hostname = kmemdup_nul(buf->data, buf->len, GFP_KERNEL);
|
||||
|
||||
@@ -3951,7 +3951,7 @@ static void test_fs_location_for_trunking(struct nfs4_fs_location *location,
|
||||
|
||||
for (i = 0; i < location->nservers; i++) {
|
||||
struct nfs4_string *srv_loc = &location->servers[i];
|
||||
struct sockaddr addr;
|
||||
struct sockaddr_storage addr;
|
||||
size_t addrlen;
|
||||
struct xprt_create xprt_args = {
|
||||
.ident = 0,
|
||||
@@ -3974,7 +3974,7 @@ static void test_fs_location_for_trunking(struct nfs4_fs_location *location,
|
||||
clp->cl_net, server->port);
|
||||
if (!addrlen)
|
||||
return;
|
||||
xprt_args.dstaddr = &addr;
|
||||
xprt_args.dstaddr = (struct sockaddr *)&addr;
|
||||
xprt_args.addrlen = addrlen;
|
||||
servername = kmalloc(srv_loc->len + 1, GFP_KERNEL);
|
||||
if (!servername)
|
||||
@@ -7138,6 +7138,7 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata)
|
||||
{
|
||||
struct nfs4_lockdata *data = calldata;
|
||||
struct nfs4_lock_state *lsp = data->lsp;
|
||||
struct nfs_server *server = NFS_SERVER(d_inode(data->ctx->dentry));
|
||||
|
||||
if (!nfs4_sequence_done(task, &data->res.seq_res))
|
||||
return;
|
||||
@@ -7145,8 +7146,7 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata)
|
||||
data->rpc_status = task->tk_status;
|
||||
switch (task->tk_status) {
|
||||
case 0:
|
||||
renew_lease(NFS_SERVER(d_inode(data->ctx->dentry)),
|
||||
data->timestamp);
|
||||
renew_lease(server, data->timestamp);
|
||||
if (data->arg.new_lock && !data->cancelled) {
|
||||
data->fl.fl_flags &= ~(FL_SLEEP | FL_ACCESS);
|
||||
if (locks_lock_inode_wait(lsp->ls_state->inode, &data->fl) < 0)
|
||||
@@ -7167,6 +7167,8 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata)
|
||||
if (!nfs4_stateid_match(&data->arg.open_stateid,
|
||||
&lsp->ls_state->open_stateid))
|
||||
goto out_restart;
|
||||
else if (nfs4_async_handle_error(task, server, lsp->ls_state, NULL) == -EAGAIN)
|
||||
goto out_restart;
|
||||
} else if (!nfs4_stateid_match(&data->arg.lock_stateid,
|
||||
&lsp->ls_stateid))
|
||||
goto out_restart;
|
||||
|
||||
@@ -1786,6 +1786,7 @@ static void nfs4_state_mark_reclaim_helper(struct nfs_client *clp,
|
||||
|
||||
static void nfs4_state_start_reclaim_reboot(struct nfs_client *clp)
|
||||
{
|
||||
set_bit(NFS4CLNT_RECLAIM_REBOOT, &clp->cl_state);
|
||||
/* Mark all delegations for reclaim */
|
||||
nfs_delegation_mark_reclaim(clp);
|
||||
nfs4_state_mark_reclaim_helper(clp, nfs4_state_mark_reclaim_reboot);
|
||||
@@ -2670,6 +2671,7 @@ static void nfs4_state_manager(struct nfs_client *clp)
|
||||
if (status < 0)
|
||||
goto out_error;
|
||||
nfs4_state_end_reclaim_reboot(clp);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Detect expired delegations... */
|
||||
|
||||
@@ -821,7 +821,7 @@ static void nfs4_clear_ds_conn_bit(struct nfs4_pnfs_ds *ds)
|
||||
|
||||
static struct nfs_client *(*get_v3_ds_connect)(
|
||||
struct nfs_server *mds_srv,
|
||||
const struct sockaddr *ds_addr,
|
||||
const struct sockaddr_storage *ds_addr,
|
||||
int ds_addrlen,
|
||||
int ds_proto,
|
||||
unsigned int ds_timeo,
|
||||
@@ -882,7 +882,7 @@ static int _nfs4_pnfs_v3_ds_connect(struct nfs_server *mds_srv,
|
||||
continue;
|
||||
}
|
||||
clp = get_v3_ds_connect(mds_srv,
|
||||
(struct sockaddr *)&da->da_addr,
|
||||
&da->da_addr,
|
||||
da->da_addrlen, da->da_transport,
|
||||
timeo, retrans);
|
||||
if (IS_ERR(clp))
|
||||
@@ -951,7 +951,7 @@ static int _nfs4_pnfs_v4_ds_connect(struct nfs_server *mds_srv,
|
||||
put_cred(xprtdata.cred);
|
||||
} else {
|
||||
clp = nfs4_set_ds_client(mds_srv,
|
||||
(struct sockaddr *)&da->da_addr,
|
||||
&da->da_addr,
|
||||
da->da_addrlen,
|
||||
da->da_transport, timeo,
|
||||
retrans, minor_version);
|
||||
|
||||
@@ -822,8 +822,7 @@ static int nfs_request_mount(struct fs_context *fc,
|
||||
{
|
||||
struct nfs_fs_context *ctx = nfs_fc2context(fc);
|
||||
struct nfs_mount_request request = {
|
||||
.sap = (struct sockaddr *)
|
||||
&ctx->mount_server.address,
|
||||
.sap = &ctx->mount_server._address,
|
||||
.dirpath = ctx->nfs_server.export_path,
|
||||
.protocol = ctx->mount_server.protocol,
|
||||
.fh = root_fh,
|
||||
@@ -854,7 +853,7 @@ static int nfs_request_mount(struct fs_context *fc,
|
||||
* Construct the mount server's address.
|
||||
*/
|
||||
if (ctx->mount_server.address.sa_family == AF_UNSPEC) {
|
||||
memcpy(request.sap, &ctx->nfs_server.address,
|
||||
memcpy(request.sap, &ctx->nfs_server._address,
|
||||
ctx->nfs_server.addrlen);
|
||||
ctx->mount_server.addrlen = ctx->nfs_server.addrlen;
|
||||
}
|
||||
|
||||
@@ -1989,7 +1989,7 @@ gss_unwrap_resp_integ(struct rpc_task *task, struct rpc_cred *cred,
|
||||
goto unwrap_failed;
|
||||
mic.len = len;
|
||||
mic.data = kmalloc(len, GFP_KERNEL);
|
||||
if (!mic.data)
|
||||
if (ZERO_OR_NULL_PTR(mic.data))
|
||||
goto unwrap_failed;
|
||||
if (read_bytes_from_xdr_buf(rcv_buf, offset, mic.data, mic.len))
|
||||
goto unwrap_failed;
|
||||
|
||||
@@ -518,13 +518,16 @@ void rpc_sysfs_client_setup(struct rpc_clnt *clnt,
|
||||
struct net *net)
|
||||
{
|
||||
struct rpc_sysfs_client *rpc_client;
|
||||
struct rpc_sysfs_xprt_switch *xswitch =
|
||||
(struct rpc_sysfs_xprt_switch *)xprt_switch->xps_sysfs;
|
||||
|
||||
if (!xswitch)
|
||||
return;
|
||||
|
||||
rpc_client = rpc_sysfs_client_alloc(rpc_sunrpc_client_kobj,
|
||||
net, clnt->cl_clid);
|
||||
if (rpc_client) {
|
||||
char name[] = "switch";
|
||||
struct rpc_sysfs_xprt_switch *xswitch =
|
||||
(struct rpc_sysfs_xprt_switch *)xprt_switch->xps_sysfs;
|
||||
int ret;
|
||||
|
||||
clnt->cl_sysfs = rpc_client;
|
||||
@@ -558,6 +561,8 @@ void rpc_sysfs_xprt_switch_setup(struct rpc_xprt_switch *xprt_switch,
|
||||
rpc_xprt_switch->xprt_switch = xprt_switch;
|
||||
rpc_xprt_switch->xprt = xprt;
|
||||
kobject_uevent(&rpc_xprt_switch->kobject, KOBJ_ADD);
|
||||
} else {
|
||||
xprt_switch->xps_sysfs = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -569,6 +574,9 @@ void rpc_sysfs_xprt_setup(struct rpc_xprt_switch *xprt_switch,
|
||||
struct rpc_sysfs_xprt_switch *switch_obj =
|
||||
(struct rpc_sysfs_xprt_switch *)xprt_switch->xps_sysfs;
|
||||
|
||||
if (!switch_obj)
|
||||
return;
|
||||
|
||||
rpc_xprt = rpc_sysfs_xprt_alloc(&switch_obj->kobject, xprt, gfp_flags);
|
||||
if (rpc_xprt) {
|
||||
xprt->xprt_sysfs = rpc_xprt;
|
||||
|
||||
Reference in New Issue
Block a user