diff options
Diffstat (limited to 'drivers/net/bonding/bond_sysfs.c')
-rw-r--r-- | drivers/net/bonding/bond_sysfs.c | 73 |
1 files changed, 36 insertions, 37 deletions
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index 040b493f60ae..6096440e96ea 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c @@ -147,7 +147,7 @@ err_no_cmd: static const struct class_attribute class_attr_bonding_masters = { .attr = { .name = "bonding_masters", - .mode = S_IWUSR | S_IRUGO, + .mode = 0644, }, .show = bonding_show_bonds, .store = bonding_store_bonds, @@ -202,7 +202,7 @@ static ssize_t bonding_show_slaves(struct device *d, return res; } -static DEVICE_ATTR(slaves, S_IRUGO | S_IWUSR, bonding_show_slaves, +static DEVICE_ATTR(slaves, 0644, bonding_show_slaves, bonding_sysfs_store_option); /* Show the bonding mode. */ @@ -216,8 +216,7 @@ static ssize_t bonding_show_mode(struct device *d, return sprintf(buf, "%s %d\n", val->string, BOND_MODE(bond)); } -static DEVICE_ATTR(mode, S_IRUGO | S_IWUSR, - bonding_show_mode, bonding_sysfs_store_option); +static DEVICE_ATTR(mode, 0644, bonding_show_mode, bonding_sysfs_store_option); /* Show the bonding transmit hash method. */ static ssize_t bonding_show_xmit_hash(struct device *d, @@ -231,7 +230,7 @@ static ssize_t bonding_show_xmit_hash(struct device *d, return sprintf(buf, "%s %d\n", val->string, bond->params.xmit_policy); } -static DEVICE_ATTR(xmit_hash_policy, S_IRUGO | S_IWUSR, +static DEVICE_ATTR(xmit_hash_policy, 0644, bonding_show_xmit_hash, bonding_sysfs_store_option); /* Show arp_validate. */ @@ -247,7 +246,7 @@ static ssize_t bonding_show_arp_validate(struct device *d, return sprintf(buf, "%s %d\n", val->string, bond->params.arp_validate); } -static DEVICE_ATTR(arp_validate, S_IRUGO | S_IWUSR, bonding_show_arp_validate, +static DEVICE_ATTR(arp_validate, 0644, bonding_show_arp_validate, bonding_sysfs_store_option); /* Show arp_all_targets. */ @@ -263,7 +262,7 @@ static ssize_t bonding_show_arp_all_targets(struct device *d, return sprintf(buf, "%s %d\n", val->string, bond->params.arp_all_targets); } -static DEVICE_ATTR(arp_all_targets, S_IRUGO | S_IWUSR, +static DEVICE_ATTR(arp_all_targets, 0644, bonding_show_arp_all_targets, bonding_sysfs_store_option); /* Show fail_over_mac. */ @@ -279,7 +278,7 @@ static ssize_t bonding_show_fail_over_mac(struct device *d, return sprintf(buf, "%s %d\n", val->string, bond->params.fail_over_mac); } -static DEVICE_ATTR(fail_over_mac, S_IRUGO | S_IWUSR, +static DEVICE_ATTR(fail_over_mac, 0644, bonding_show_fail_over_mac, bonding_sysfs_store_option); /* Show the arp timer interval. */ @@ -291,7 +290,7 @@ static ssize_t bonding_show_arp_interval(struct device *d, return sprintf(buf, "%d\n", bond->params.arp_interval); } -static DEVICE_ATTR(arp_interval, S_IRUGO | S_IWUSR, +static DEVICE_ATTR(arp_interval, 0644, bonding_show_arp_interval, bonding_sysfs_store_option); /* Show the arp targets. */ @@ -312,7 +311,7 @@ static ssize_t bonding_show_arp_targets(struct device *d, return res; } -static DEVICE_ATTR(arp_ip_target, S_IRUGO | S_IWUSR, +static DEVICE_ATTR(arp_ip_target, 0644, bonding_show_arp_targets, bonding_sysfs_store_option); /* Show the up and down delays. */ @@ -324,7 +323,7 @@ static ssize_t bonding_show_downdelay(struct device *d, return sprintf(buf, "%d\n", bond->params.downdelay * bond->params.miimon); } -static DEVICE_ATTR(downdelay, S_IRUGO | S_IWUSR, +static DEVICE_ATTR(downdelay, 0644, bonding_show_downdelay, bonding_sysfs_store_option); static ssize_t bonding_show_updelay(struct device *d, @@ -336,7 +335,7 @@ static ssize_t bonding_show_updelay(struct device *d, return sprintf(buf, "%d\n", bond->params.updelay * bond->params.miimon); } -static DEVICE_ATTR(updelay, S_IRUGO | S_IWUSR, +static DEVICE_ATTR(updelay, 0644, bonding_show_updelay, bonding_sysfs_store_option); /* Show the LACP interval. */ @@ -351,7 +350,7 @@ static ssize_t bonding_show_lacp(struct device *d, return sprintf(buf, "%s %d\n", val->string, bond->params.lacp_fast); } -static DEVICE_ATTR(lacp_rate, S_IRUGO | S_IWUSR, +static DEVICE_ATTR(lacp_rate, 0644, bonding_show_lacp, bonding_sysfs_store_option); static ssize_t bonding_show_min_links(struct device *d, @@ -362,7 +361,7 @@ static ssize_t bonding_show_min_links(struct device *d, return sprintf(buf, "%u\n", bond->params.min_links); } -static DEVICE_ATTR(min_links, S_IRUGO | S_IWUSR, +static DEVICE_ATTR(min_links, 0644, bonding_show_min_links, bonding_sysfs_store_option); static ssize_t bonding_show_ad_select(struct device *d, @@ -376,7 +375,7 @@ static ssize_t bonding_show_ad_select(struct device *d, return sprintf(buf, "%s %d\n", val->string, bond->params.ad_select); } -static DEVICE_ATTR(ad_select, S_IRUGO | S_IWUSR, +static DEVICE_ATTR(ad_select, 0644, bonding_show_ad_select, bonding_sysfs_store_option); /* Show the number of peer notifications to send after a failover event. */ @@ -387,9 +386,9 @@ static ssize_t bonding_show_num_peer_notif(struct device *d, struct bonding *bond = to_bond(d); return sprintf(buf, "%d\n", bond->params.num_peer_notif); } -static DEVICE_ATTR(num_grat_arp, S_IRUGO | S_IWUSR, +static DEVICE_ATTR(num_grat_arp, 0644, bonding_show_num_peer_notif, bonding_sysfs_store_option); -static DEVICE_ATTR(num_unsol_na, S_IRUGO | S_IWUSR, +static DEVICE_ATTR(num_unsol_na, 0644, bonding_show_num_peer_notif, bonding_sysfs_store_option); /* Show the MII monitor interval. */ @@ -401,7 +400,7 @@ static ssize_t bonding_show_miimon(struct device *d, return sprintf(buf, "%d\n", bond->params.miimon); } -static DEVICE_ATTR(miimon, S_IRUGO | S_IWUSR, +static DEVICE_ATTR(miimon, 0644, bonding_show_miimon, bonding_sysfs_store_option); /* Show the primary slave. */ @@ -421,7 +420,7 @@ static ssize_t bonding_show_primary(struct device *d, return count; } -static DEVICE_ATTR(primary, S_IRUGO | S_IWUSR, +static DEVICE_ATTR(primary, 0644, bonding_show_primary, bonding_sysfs_store_option); /* Show the primary_reselect flag. */ @@ -438,7 +437,7 @@ static ssize_t bonding_show_primary_reselect(struct device *d, return sprintf(buf, "%s %d\n", val->string, bond->params.primary_reselect); } -static DEVICE_ATTR(primary_reselect, S_IRUGO | S_IWUSR, +static DEVICE_ATTR(primary_reselect, 0644, bonding_show_primary_reselect, bonding_sysfs_store_option); /* Show the use_carrier flag. */ @@ -450,7 +449,7 @@ static ssize_t bonding_show_carrier(struct device *d, return sprintf(buf, "%d\n", bond->params.use_carrier); } -static DEVICE_ATTR(use_carrier, S_IRUGO | S_IWUSR, +static DEVICE_ATTR(use_carrier, 0644, bonding_show_carrier, bonding_sysfs_store_option); @@ -471,7 +470,7 @@ static ssize_t bonding_show_active_slave(struct device *d, return count; } -static DEVICE_ATTR(active_slave, S_IRUGO | S_IWUSR, +static DEVICE_ATTR(active_slave, 0644, bonding_show_active_slave, bonding_sysfs_store_option); /* Show link status of the bond interface. */ @@ -484,7 +483,7 @@ static ssize_t bonding_show_mii_status(struct device *d, return sprintf(buf, "%s\n", active ? "up" : "down"); } -static DEVICE_ATTR(mii_status, S_IRUGO, bonding_show_mii_status, NULL); +static DEVICE_ATTR(mii_status, 0444, bonding_show_mii_status, NULL); /* Show current 802.3ad aggregator ID. */ static ssize_t bonding_show_ad_aggregator(struct device *d, @@ -503,7 +502,7 @@ static ssize_t bonding_show_ad_aggregator(struct device *d, return count; } -static DEVICE_ATTR(ad_aggregator, S_IRUGO, bonding_show_ad_aggregator, NULL); +static DEVICE_ATTR(ad_aggregator, 0444, bonding_show_ad_aggregator, NULL); /* Show number of active 802.3ad ports. */ @@ -523,7 +522,7 @@ static ssize_t bonding_show_ad_num_ports(struct device *d, return count; } -static DEVICE_ATTR(ad_num_ports, S_IRUGO, bonding_show_ad_num_ports, NULL); +static DEVICE_ATTR(ad_num_ports, 0444, bonding_show_ad_num_ports, NULL); /* Show current 802.3ad actor key. */ @@ -543,7 +542,7 @@ static ssize_t bonding_show_ad_actor_key(struct device *d, return count; } -static DEVICE_ATTR(ad_actor_key, S_IRUGO, bonding_show_ad_actor_key, NULL); +static DEVICE_ATTR(ad_actor_key, 0444, bonding_show_ad_actor_key, NULL); /* Show current 802.3ad partner key. */ @@ -563,7 +562,7 @@ static ssize_t bonding_show_ad_partner_key(struct device *d, return count; } -static DEVICE_ATTR(ad_partner_key, S_IRUGO, bonding_show_ad_partner_key, NULL); +static DEVICE_ATTR(ad_partner_key, 0444, bonding_show_ad_partner_key, NULL); /* Show current 802.3ad partner mac. */ @@ -582,7 +581,7 @@ static ssize_t bonding_show_ad_partner_mac(struct device *d, return count; } -static DEVICE_ATTR(ad_partner_mac, S_IRUGO, bonding_show_ad_partner_mac, NULL); +static DEVICE_ATTR(ad_partner_mac, 0444, bonding_show_ad_partner_mac, NULL); /* Show the queue_ids of the slaves in the current bond. */ static ssize_t bonding_show_queue_id(struct device *d, @@ -615,7 +614,7 @@ static ssize_t bonding_show_queue_id(struct device *d, return res; } -static DEVICE_ATTR(queue_id, S_IRUGO | S_IWUSR, bonding_show_queue_id, +static DEVICE_ATTR(queue_id, 0644, bonding_show_queue_id, bonding_sysfs_store_option); @@ -628,7 +627,7 @@ static ssize_t bonding_show_slaves_active(struct device *d, return sprintf(buf, "%d\n", bond->params.all_slaves_active); } -static DEVICE_ATTR(all_slaves_active, S_IRUGO | S_IWUSR, +static DEVICE_ATTR(all_slaves_active, 0644, bonding_show_slaves_active, bonding_sysfs_store_option); /* Show the number of IGMP membership reports to send on link failure */ @@ -640,7 +639,7 @@ static ssize_t bonding_show_resend_igmp(struct device *d, return sprintf(buf, "%d\n", bond->params.resend_igmp); } -static DEVICE_ATTR(resend_igmp, S_IRUGO | S_IWUSR, +static DEVICE_ATTR(resend_igmp, 0644, bonding_show_resend_igmp, bonding_sysfs_store_option); @@ -652,7 +651,7 @@ static ssize_t bonding_show_lp_interval(struct device *d, return sprintf(buf, "%d\n", bond->params.lp_interval); } -static DEVICE_ATTR(lp_interval, S_IRUGO | S_IWUSR, +static DEVICE_ATTR(lp_interval, 0644, bonding_show_lp_interval, bonding_sysfs_store_option); static ssize_t bonding_show_tlb_dynamic_lb(struct device *d, @@ -662,7 +661,7 @@ static ssize_t bonding_show_tlb_dynamic_lb(struct device *d, struct bonding *bond = to_bond(d); return sprintf(buf, "%d\n", bond->params.tlb_dynamic_lb); } -static DEVICE_ATTR(tlb_dynamic_lb, S_IRUGO | S_IWUSR, +static DEVICE_ATTR(tlb_dynamic_lb, 0644, bonding_show_tlb_dynamic_lb, bonding_sysfs_store_option); static ssize_t bonding_show_packets_per_slave(struct device *d, @@ -674,7 +673,7 @@ static ssize_t bonding_show_packets_per_slave(struct device *d, return sprintf(buf, "%u\n", packets_per_slave); } -static DEVICE_ATTR(packets_per_slave, S_IRUGO | S_IWUSR, +static DEVICE_ATTR(packets_per_slave, 0644, bonding_show_packets_per_slave, bonding_sysfs_store_option); static ssize_t bonding_show_ad_actor_sys_prio(struct device *d, @@ -688,7 +687,7 @@ static ssize_t bonding_show_ad_actor_sys_prio(struct device *d, return 0; } -static DEVICE_ATTR(ad_actor_sys_prio, S_IRUGO | S_IWUSR, +static DEVICE_ATTR(ad_actor_sys_prio, 0644, bonding_show_ad_actor_sys_prio, bonding_sysfs_store_option); static ssize_t bonding_show_ad_actor_system(struct device *d, @@ -703,7 +702,7 @@ static ssize_t bonding_show_ad_actor_system(struct device *d, return 0; } -static DEVICE_ATTR(ad_actor_system, S_IRUGO | S_IWUSR, +static DEVICE_ATTR(ad_actor_system, 0644, bonding_show_ad_actor_system, bonding_sysfs_store_option); static ssize_t bonding_show_ad_user_port_key(struct device *d, @@ -717,7 +716,7 @@ static ssize_t bonding_show_ad_user_port_key(struct device *d, return 0; } -static DEVICE_ATTR(ad_user_port_key, S_IRUGO | S_IWUSR, +static DEVICE_ATTR(ad_user_port_key, 0644, bonding_show_ad_user_port_key, bonding_sysfs_store_option); static struct attribute *per_bond_attrs[] = { |