i_socket is i_un.is_socket; i_un was missing
[unix-history] / usr / src / sys / ufs / ffs / inode.h
index b3de1ba..5be727a 100644 (file)
@@ -1,4 +1,4 @@
-/*     inode.h 4.14    82/08/10        */
+/*     inode.h 4.19    82/10/31        */
 
 /*
  * The I node is the focus of all file activity in UNIX.
 
 /*
  * The I node is the focus of all file activity in UNIX.
@@ -63,7 +63,7 @@ struct dinode {
 #define        i_ctime         i_ic.ic_ctime
 #define        i_rdev          i_ic.ic_db[0]
 #define        i_lastr         i_un.if_lastr
 #define        i_ctime         i_ic.ic_ctime
 #define        i_rdev          i_ic.ic_db[0]
 #define        i_lastr         i_un.if_lastr
-#define        i_socket        is_socket
+#define        i_socket        i_un.is_socket
 #define        i_forw          i_chain[0]
 #define        i_back          i_chain[1]
 #define        i_freef         i_un.i_fr.if_freef
 #define        i_forw          i_chain[0]
 #define        i_back          i_chain[1]
 #define        i_freef         i_un.i_fr.if_freef
@@ -83,14 +83,13 @@ struct dinode {
 #define        di_rdev         di_ic.ic_db[0]
 
 #ifdef KERNEL
 #define        di_rdev         di_ic.ic_db[0]
 
 #ifdef KERNEL
-extern struct inode *inode;            /* The inode table itself */
-extern struct inode *inodeNINODE;      /* The end of the inode table */
-extern int ninode;                     /* number of slots in the table */
+struct inode *inode;           /* the inode table itself */
+struct inode *inodeNINODE;     /* the end of the inode table */
+int    ninode;                 /* number of slots in the table */
 
 struct inode *rootdir;                 /* pointer to inode of root directory */
 
 struct inode *ialloc();
 
 struct inode *rootdir;                 /* pointer to inode of root directory */
 
 struct inode *ialloc();
-struct inode *ifind();
 struct inode *iget();
 struct inode *owner();
 struct inode *maknode();
 struct inode *iget();
 struct inode *owner();
 struct inode *maknode();
@@ -98,7 +97,7 @@ struct        inode *namei();
 #endif
 
 /* flags */
 #endif
 
 /* flags */
-#define        ILOCK           0x1             /* inode is locked */
+#define        ILOCKED         0x1             /* inode is locked */
 #define        IUPD            0x2             /* file has been modified */
 #define        IACC            0x4             /* inode access time to be updated */
 #define        IMOUNT          0x8             /* inode is mounted on */
 #define        IUPD            0x2             /* file has been modified */
 #define        IACC            0x4             /* inode access time to be updated */
 #define        IMOUNT          0x8             /* inode is mounted on */
@@ -116,10 +115,32 @@ struct    inode *namei();
 #define        IFBLK           0060000         /* block special */
 #define        IFREG           0100000         /* regular */
 #define        IFLNK           0120000         /* symbolic link */
 #define        IFBLK           0060000         /* block special */
 #define        IFREG           0100000         /* regular */
 #define        IFLNK           0120000         /* symbolic link */
-#define        IFPORTAL        0140000         /* portal */
+#define        IFSOCK          0140000         /* socket */
+
 #define        ISUID           04000           /* set user id on execution */
 #define        ISGID           02000           /* set group id on execution */
 #define        ISVTX           01000           /* save swapped text even after use */
 #define        IREAD           0400            /* read, write, execute permissions */
 #define        IWRITE          0200
 #define        IEXEC           0100
 #define        ISUID           04000           /* set user id on execution */
 #define        ISGID           02000           /* set group id on execution */
 #define        ISVTX           01000           /* save swapped text even after use */
 #define        IREAD           0400            /* read, write, execute permissions */
 #define        IWRITE          0200
 #define        IEXEC           0100
+
+#define        ILOCK(ip) { \
+       while ((ip)->i_flag & ILOCKED) { \
+               (ip)->i_flag |= IWANT; \
+               sleep((caddr_t)(ip), PINOD); \
+       } \
+       (ip)->i_flag |= ILOCKED; \
+}
+
+#define        IUNLOCK(ip) { \
+       (ip)->i_flag &= ~ILOCKED; \
+       if ((ip)->i_flag&IWANT) { \
+               (ip)->i_flag &= ~IWANT; \
+               wakeup((caddr_t)(ip)); \
+       } \
+}
+
+#define        IUPDAT(ip, t1, t2, waitfor) { \
+       if (ip->i_flag&(IUPD|IACC|ICHG)) \
+               iupdat(ip, t1, t2, waitfor); \
+}