aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/autofs4/waitq.c12
-rw-r--r--include/linux/auto_fs4.h16
2 files changed, 20 insertions, 8 deletions
diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c
index 1e4a539f4417..0d041a9cb348 100644
--- a/fs/autofs4/waitq.c
+++ b/fs/autofs4/waitq.c
@@ -84,7 +84,11 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
84 struct autofs_wait_queue *wq, 84 struct autofs_wait_queue *wq,
85 int type) 85 int type)
86{ 86{
87 union autofs_packet_union pkt; 87 union {
88 struct autofs_packet_hdr hdr;
89 union autofs_packet_union v4_pkt;
90 union autofs_v5_packet_union v5_pkt;
91 } pkt;
88 size_t pktsz; 92 size_t pktsz;
89 93
90 DPRINTK("wait id = 0x%08lx, name = %.*s, type=%d", 94 DPRINTK("wait id = 0x%08lx, name = %.*s, type=%d",
@@ -98,7 +102,7 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
98 /* Kernel protocol v4 missing and expire packets */ 102 /* Kernel protocol v4 missing and expire packets */
99 case autofs_ptype_missing: 103 case autofs_ptype_missing:
100 { 104 {
101 struct autofs_packet_missing *mp = &pkt.missing; 105 struct autofs_packet_missing *mp = &pkt.v4_pkt.missing;
102 106
103 pktsz = sizeof(*mp); 107 pktsz = sizeof(*mp);
104 108
@@ -110,7 +114,7 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
110 } 114 }
111 case autofs_ptype_expire_multi: 115 case autofs_ptype_expire_multi:
112 { 116 {
113 struct autofs_packet_expire_multi *ep = &pkt.expire_multi; 117 struct autofs_packet_expire_multi *ep = &pkt.v4_pkt.expire_multi;
114 118
115 pktsz = sizeof(*ep); 119 pktsz = sizeof(*ep);
116 120
@@ -129,7 +133,7 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
129 case autofs_ptype_missing_direct: 133 case autofs_ptype_missing_direct:
130 case autofs_ptype_expire_direct: 134 case autofs_ptype_expire_direct:
131 { 135 {
132 struct autofs_v5_packet *packet = &pkt.v5_packet; 136 struct autofs_v5_packet *packet = &pkt.v5_pkt.v5_packet;
133 137
134 pktsz = sizeof(*packet); 138 pktsz = sizeof(*packet);
135 139
diff --git a/include/linux/auto_fs4.h b/include/linux/auto_fs4.h
index 0a6bc52ffe88..31a29541b504 100644
--- a/include/linux/auto_fs4.h
+++ b/include/linux/auto_fs4.h
@@ -59,6 +59,13 @@ struct autofs_packet_expire_multi {
59 char name[NAME_MAX+1]; 59 char name[NAME_MAX+1];
60}; 60};
61 61
62union autofs_packet_union {
63 struct autofs_packet_hdr hdr;
64 struct autofs_packet_missing missing;
65 struct autofs_packet_expire expire;
66 struct autofs_packet_expire_multi expire_multi;
67};
68
62/* autofs v5 common packet struct */ 69/* autofs v5 common packet struct */
63struct autofs_v5_packet { 70struct autofs_v5_packet {
64 struct autofs_packet_hdr hdr; 71 struct autofs_packet_hdr hdr;
@@ -78,12 +85,13 @@ typedef struct autofs_v5_packet autofs_packet_expire_indirect_t;
78typedef struct autofs_v5_packet autofs_packet_missing_direct_t; 85typedef struct autofs_v5_packet autofs_packet_missing_direct_t;
79typedef struct autofs_v5_packet autofs_packet_expire_direct_t; 86typedef struct autofs_v5_packet autofs_packet_expire_direct_t;
80 87
81union autofs_packet_union { 88union autofs_v5_packet_union {
82 struct autofs_packet_hdr hdr; 89 struct autofs_packet_hdr hdr;
83 struct autofs_packet_missing missing;
84 struct autofs_packet_expire expire;
85 struct autofs_packet_expire_multi expire_multi;
86 struct autofs_v5_packet v5_packet; 90 struct autofs_v5_packet v5_packet;
91 autofs_packet_missing_indirect_t missing_indirect;
92 autofs_packet_expire_indirect_t expire_indirect;
93 autofs_packet_missing_direct_t missing_direct;
94 autofs_packet_expire_direct_t expire_direct;
87}; 95};
88 96
89#define AUTOFS_IOC_EXPIRE_MULTI _IOW(0x93,0x66,int) 97#define AUTOFS_IOC_EXPIRE_MULTI _IOW(0x93,0x66,int)