#define SS_CLOSEWAIT 9 /* Remote has closed */
#define SS_CLOSING 10 /* Protocol close in progress */
#define SS_CLOSED 11 /* Protocol layers done, not close()d */
+#define SS_DEAD 12 /* Closed byuser space but not yet
+ free of any stack resources */
/* FIXME: need state for shutdown handling */
uint8_t s_data; /* Socket we are an accept() for */
uint8_t s_error;
#define SI_EOF 8 /* At EOF */
#define SI_THROTTLE 16 /* Transmit is throttled */
void *s_priv; /* Private pointer for lower layers */
+ inoptr s_ino; /* Inode back pointer */
};
#define NSOCKTYPE 3
extern void sock_init(void);
extern int sock_error(struct socket *s);
extern struct netdevice net_dev;
+extern void sock_closed(struct socket *s);
/* For the moment */
struct socket *s = &sockets[ino->c_node.i_nlink];
net_close(s);
- sock_wait_enter(s, 0, SS_CLOSED);
+ /* Dead but not unbound from netd activity yet */
+ s->s_state = SS_DEAD;
+}
+
+void sock_closed(struct socket *s)
+{
s->s_state = SS_UNUSED;
/* You re-use something you pays the price. Probably should switch
to using data 0 as devices do ? FIXME */
- ino->c_node.i_nlink = 0;
- ino->c_flags |= CDIRTY;
+ s->s_ino->c_node.i_nlink = 0;
+ s->s_ino->c_flags |= CDIRTY;
}
/*
ino->c_readers = 1;
ino->c_writers = 1;
+ n->s_ino = ino;
+
of_tab[oftindex].o_inode = ino;
of_tab[oftindex].o_access = O_RDWR;