]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libufs/getino.3
This commit was generated by cvs2svn to compensate for changes in r127128,
[FreeBSD/FreeBSD.git] / lib / libufs / getino.3
1 .\" Author:     Juli Mallett <jmallett@FreeBSD.org>
2 .\" Date:       June 04, 2003
3 .\" Description:
4 .\"     Manual page for libufs functions:
5 .\"             getino(3)
6 .\"             putino(3)
7 .\"
8 .\" This file is in the public domain.
9 .\"
10 .\" $FreeBSD$
11 .\"
12 .Dd June 04, 2003
13 .Dt GETINO 3
14 .Os
15 .Sh NAME
16 .Nm getino , putino
17 .Nd get and put inodes to and from UFS disks
18 .Sh LIBRARY
19 .Lb libufs
20 .Sh SYNOPSIS
21 .In sys/param.h
22 .In sys/mount.h
23 .In ufs/ufs/ufsmount.h
24 .In ufs/ufs/dinode.h
25 .In ufs/ffs/fs.h
26 .In libufs.h
27 .Ft int
28 .Fn getino "struct uufsd *disk" "void *dino" "ino_t inode"
29 .Ft int
30 .Fn putino "struct uufsd *disk" "void *dino" "ino_t inode"
31 .Sh DESCRIPTION
32 The
33 .Fn getino
34 and
35 .Fn putino
36 functions provide the ability to put an inode to disk or read an
37 inode from disk for
38 .Xr libufs 3
39 consumers.
40 The
41 .Fn getino
42 function reads the inode specified by
43 .Fa inode ,
44 and puts a pointer to an inode with the correct type into the memory
45 pointed to by
46 .Fa dino .
47 It maintains a cache of nearby inodes, and may simply return pointers
48 into memory that are in said cache.
49 The pointer it returns may be modified as if it were of the type
50 .Dq struct ufs1_dinode
51 or
52 .Dq struct ufs2_dinode
53 depending on whether the disk being operated on is UFS1 or UFS2,
54 respectively.
55 .Pp
56 The
57 .Fn putino
58 function puts an inode specified to be
59 .Fa inode
60 to disk, given memory passed in the
61 .Fa dino
62 pointer, in exactly the same manner as an inode is retrieved into
63 .Fa dino
64 by
65 .Fn getino .
66 Calls to
67 .Fn putino
68 immediately invalidate the inode cache.
69 .Pp
70 Both functions return 0 on success and -1 on error.
71 .Sh ERRORS
72 The function
73 .Fn getino
74 may fail and set
75 .Va errno
76 for any of the errors specified for the library functions
77 .Xr bread 3
78 and
79 .Xr malloc 3 .
80 Additionally, error may be returned if the inode format cannot be
81 determined.
82 Error reporting conventions for
83 .Xr libufs 3
84 functions are followed.
85 .Pp
86 The function
87 .Fn putino
88 may fail and set
89 .Va errno
90 for any of the errors specified for the library functions
91 .Xr bwrite 3 .
92 Additionally, error may be returned if the inode format cannot be
93 determined, or if the
94 .Fa dino
95 parameter is
96 .Dv NULL .
97 In the latter case, where
98 .Fa dino
99 is unusable,
100 .Va errno
101 is set to
102 .Er EDOOFUS .
103 Error reporting conventions for
104 .Xr libufs 3
105 functions are followed.
106 .Sh SEE ALSO
107 .Xr bread 3 ,
108 .Xr bwrite 3 ,
109 .Xr libufs 3
110 .Sh HISTORY
111 These functions first appeared as part of
112 .Xr libufs 3
113 in
114 .Fx 5.1 .
115 .Sh AUTHORS
116 .An Juli Mallett Aq jmallett@FreeBSD.org