@@ -119,8 +119,13 @@ pub mod ro {
119119 impl From < INodeType > for DirEntryType {
120120 fn from ( value : INodeType ) -> Self {
121121 match value {
122+ INodeType :: Fifo => DirEntryType :: Fifo ,
123+ INodeType :: Chr ( _, _) => DirEntryType :: Chr ,
122124 INodeType :: Dir => DirEntryType :: Dir ,
125+ INodeType :: Blk ( _, _) => DirEntryType :: Blk ,
123126 INodeType :: Reg => DirEntryType :: Reg ,
127+ INodeType :: Lnk => DirEntryType :: Lnk ,
128+ INodeType :: Sock => DirEntryType :: Sock ,
124129 }
125130 }
126131 }
@@ -280,6 +285,46 @@ pub mod ro {
280285 unsafe { bindings:: mapping_set_large_folios ( inode. i_mapping ) } ;
281286 bindings:: S_IFREG
282287 }
288+ INodeType :: Lnk => {
289+ inode. i_op = & Tables :: < T > :: LNK_INODE_OPERATIONS ;
290+ inode. i_data . a_ops = & Tables :: < T > :: FILE_ADDRESS_SPACE_OPERATIONS ;
291+
292+ // SAFETY: `inode` is valid for write as it's a new inode.
293+ unsafe { bindings:: inode_nohighmem ( inode) } ;
294+ bindings:: S_IFLNK
295+ }
296+ INodeType :: Fifo => {
297+ // SAFETY: `inode` is valid for write as it's a new inode.
298+ unsafe { bindings:: init_special_inode ( inode, bindings:: S_IFIFO as _ , 0 ) } ;
299+ bindings:: S_IFIFO
300+ }
301+ INodeType :: Sock => {
302+ // SAFETY: `inode` is valid for write as it's a new inode.
303+ unsafe { bindings:: init_special_inode ( inode, bindings:: S_IFSOCK as _ , 0 ) } ;
304+ bindings:: S_IFSOCK
305+ }
306+ INodeType :: Chr ( major, minor) => {
307+ // SAFETY: `inode` is valid for write as it's a new inode.
308+ unsafe {
309+ bindings:: init_special_inode (
310+ inode,
311+ bindings:: S_IFCHR as _ ,
312+ bindings:: MKDEV ( major, minor & bindings:: MINORMASK ) ,
313+ )
314+ } ;
315+ bindings:: S_IFCHR
316+ }
317+ INodeType :: Blk ( major, minor) => {
318+ // SAFETY: `inode` is valid for write as it's a new inode.
319+ unsafe {
320+ bindings:: init_special_inode (
321+ inode,
322+ bindings:: S_IFBLK as _ ,
323+ bindings:: MKDEV ( major, minor & bindings:: MINORMASK ) ,
324+ )
325+ } ;
326+ bindings:: S_IFBLK
327+ }
283328 } ;
284329
285330 inode. i_mode = ( params. mode & 0o777 ) | u16:: try_from ( mode) ?;
@@ -315,11 +360,26 @@ pub mod ro {
315360 /// The type of the inode.
316361 #[ derive( Copy , Clone ) ]
317362 pub enum INodeType {
363+ /// Named pipe (first-in, first-out) type.
364+ Fifo ,
365+
366+ /// Character device type.
367+ Chr ( u32 , u32 ) ,
368+
318369 /// Directory type.
319370 Dir ,
320371
372+ /// Block device type.
373+ Blk ( u32 , u32 ) ,
374+
321375 /// Regular file type.
322376 Reg ,
377+
378+ /// Symbolic link type.
379+ Lnk ,
380+
381+ /// Named unix-domain socket type.
382+ Sock ,
323383 }
324384
325385 /// Required inode parameters.
@@ -731,6 +791,34 @@ pub mod ro {
731791 }
732792 }
733793
794+ const LNK_INODE_OPERATIONS : bindings:: inode_operations = bindings:: inode_operations {
795+ lookup : None ,
796+ get_link : Some ( bindings:: page_get_link) ,
797+ permission : None ,
798+ get_inode_acl : None ,
799+ readlink : None ,
800+ create : None ,
801+ link : None ,
802+ unlink : None ,
803+ symlink : None ,
804+ mkdir : None ,
805+ rmdir : None ,
806+ mknod : None ,
807+ rename : None ,
808+ setattr : None ,
809+ getattr : None ,
810+ listxattr : None ,
811+ fiemap : None ,
812+ update_time : None ,
813+ atomic_open : None ,
814+ tmpfile : None ,
815+ get_acl : None ,
816+ set_acl : None ,
817+ fileattr_set : None ,
818+ fileattr_get : None ,
819+ get_offset_ctx : None ,
820+ } ;
821+
734822 const FILE_ADDRESS_SPACE_OPERATIONS : bindings:: address_space_operations =
735823 bindings:: address_space_operations {
736824 writepage : None ,
0 commit comments