Skip to content

Commit

Permalink
[PATCH] autofs4: header file update
Browse files Browse the repository at this point in the history
The current header file definitions for autofs version 5 have caused a couple
of problems for application builds downstream.

This fixes the problem by separating the definitions.

Signed-off-by: Ian Kent <raven@themaw.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Ian Kent authored and Linus Torvalds committed Feb 21, 2007
1 parent 22c8ca7 commit e851447
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
12 changes: 8 additions & 4 deletions fs/autofs4/waitq.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
struct autofs_wait_queue *wq,
int type)
{
union autofs_packet_union pkt;
union {
struct autofs_packet_hdr hdr;
union autofs_packet_union v4_pkt;
union autofs_v5_packet_union v5_pkt;
} pkt;
size_t pktsz;

DPRINTK("wait id = 0x%08lx, name = %.*s, type=%d",
Expand All @@ -98,7 +102,7 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
/* Kernel protocol v4 missing and expire packets */
case autofs_ptype_missing:
{
struct autofs_packet_missing *mp = &pkt.missing;
struct autofs_packet_missing *mp = &pkt.v4_pkt.missing;

pktsz = sizeof(*mp);

Expand All @@ -110,7 +114,7 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
}
case autofs_ptype_expire_multi:
{
struct autofs_packet_expire_multi *ep = &pkt.expire_multi;
struct autofs_packet_expire_multi *ep = &pkt.v4_pkt.expire_multi;

pktsz = sizeof(*ep);

Expand All @@ -129,7 +133,7 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
case autofs_ptype_missing_direct:
case autofs_ptype_expire_direct:
{
struct autofs_v5_packet *packet = &pkt.v5_packet;
struct autofs_v5_packet *packet = &pkt.v5_pkt.v5_packet;

pktsz = sizeof(*packet);

Expand Down
16 changes: 12 additions & 4 deletions include/linux/auto_fs4.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ struct autofs_packet_expire_multi {
char name[NAME_MAX+1];
};

union autofs_packet_union {
struct autofs_packet_hdr hdr;
struct autofs_packet_missing missing;
struct autofs_packet_expire expire;
struct autofs_packet_expire_multi expire_multi;
};

/* autofs v5 common packet struct */
struct autofs_v5_packet {
struct autofs_packet_hdr hdr;
Expand All @@ -78,12 +85,13 @@ typedef struct autofs_v5_packet autofs_packet_expire_indirect_t;
typedef struct autofs_v5_packet autofs_packet_missing_direct_t;
typedef struct autofs_v5_packet autofs_packet_expire_direct_t;

union autofs_packet_union {
union autofs_v5_packet_union {
struct autofs_packet_hdr hdr;
struct autofs_packet_missing missing;
struct autofs_packet_expire expire;
struct autofs_packet_expire_multi expire_multi;
struct autofs_v5_packet v5_packet;
autofs_packet_missing_indirect_t missing_indirect;
autofs_packet_expire_indirect_t expire_indirect;
autofs_packet_missing_direct_t missing_direct;
autofs_packet_expire_direct_t expire_direct;
};

#define AUTOFS_IOC_EXPIRE_MULTI _IOW(0x93,0x66,int)
Expand Down

0 comments on commit e851447

Please sign in to comment.