Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / doc / man-pages / pod1 / fs_storebehind.pod
... / ...
CommitLineData
1=head1 NAME
2
3fs_storebehind - Enables asynchronous writes to the file server
4
5=head1 SYNOPSIS
6
7=for html
8<div class="synopsis">
9
10B<fs storebehind> S<<< [B<-kbytes> <I<asynchrony for specified names>>] >>>
11 S<<< [B<-files> <I<specific pathnames>>+] >>>
12 S<<< [B<-allfiles> <I<new default (KB)>>] >>> [B<-verbose>] [B<-help>]
13
14B<fs st> S<<< [B<-k> <I<asynchrony for specified names>>] >>>
15 S<<< [B<-f> <I<specific pathnames>>+] >>>
16 S<<< [B<-a> <I<new default (KB)>>] >>> [B<-v>] [B<-h>]
17
18=for html
19</div>
20
21=head1 DESCRIPTION
22
23The B<fs storebehind> command enables the Cache Manager to perform a
24delayed asynchronous write to the File Server when an application closes a
25file. By default, the Cache Manager writes all data to the File Server
26immediately and synchronously when an application program closes a file --
27that is, the close() system call does not return until the Cache Manager
28has actually transferred the final chunk of the file to the File
29Server. This command specifies the number of kilobytes of a file that can
30still remain to be written to the File Server when the Cache Manager
31returns control to the application. It is useful if users working on the
32machine commonly work with very large files, but also introduces the
33complications discussed in the L</CAUTIONS>.
34
35Set either or both of the following in a single command:
36
37=over 4
38
39=item *
40
41To set a value that applies to all AFS files manipulated by applications
42running on the machine, use the B<-allfiles> argument. This value is
43termed the I<default store asynchrony> for the machine, and persists until
44the machine reboots. If it is not set, the default value is zero,
45indicating that the Cache Manager performs synchronous writes.
46
47As an example, the following setting means that when an application closes
48a file, the Cache Manager can return control to the application as soon as
49no more than 10 kilobytes of the file remain to be written to the File
50Server.
51
52 -allfiles 10
53
54=item *
55
56To set a value that applies to one or more individual files, and overrides
57the value of the B<-allfiles> argument for them, combine the B<-kbytes>
58and B<-files> arguments. The setting persists as long as there is an entry
59for the file in the kernel table that the Cache Manager uses to track
60certain information about files. In general, such an entry persists at
61least until an application closes the file or exits, but the Cache Manager
62is free to recycle the entry if the file is inactive and it needs to free
63up slots in the table. To increase the certainty that there is an entry
64for the file in the table, issue the B<fs storebehind> command shortly
65before closing the file.
66
67As an example, the following setting means that when an application closes
68either of the files B<bigfile> and B<biggerfile>, the Cache Manager can
69return control to the application as soon as no more than a megabyte of
70the file remains to be written to the File Server.
71
72 -kbytes 1024 -files bigfile biggerfile
73
74Note that once an explicit value has been set for a file, the only way to
75make it subject to the default store asynchrony once again is to set
76B<-kbytes> to that value. In other words, there is no combination of
77arguments that automatically makes a file subject to the default store
78asynchrony once another value has been set for the file.
79
80=back
81
82To display the settings that currently apply to individual files or to all
83files, provide the command's arguments in certain combinations as
84specified in L</OUTPUT>.
85
86=head1 CAUTIONS
87
88For the following reasons, use of this command is not recommended in most
89cases.
90
91In normal circumstances, an asynchronous setting results in the Cache
92Manager returning control to applications earlier than it otherwise does,
93but this is not guaranteed.
94
95If a delayed write fails, there is no way to notify the application, since
96the close() system call has already returned with a code indicating
97success.
98
99Writing asynchronously increases the possibility that the user will not
100notice if a write operation makes the volume that houses the file exceed
101its quota. As always, the portion of the file that exceeds the volume's
102quota is lost, which prompts a message such as the following:
103
104 No space left on device
105
106To avoid losing data, it is advisable to verify that the volume housing
107the file has space available for the amount of data anticipated to be
108written.
109
110=head1 OPTIONS
111
112=over 4
113
114=item B<-kbytes> <I<asynchrony for specified names>>
115
116Specifies the number of kilobytes of data from each file named by the
117B<-files> argument that can remain to be written to the file server when
118the Cache Manager returns control to an application program that closed
119the file. The B<-files> argument is required along with this
120argument. Provide an integer from the range C<0> (which reinstates the
121Cache Manager's default behavior or writing synchronously) to the maximum
122AFS file size.
123
124=item B<-files> <I<specific pathnames>>+
125
126Names each file to which the value set with the B<-kbytes> argument
127applies. The setting persists as long as there is an entry for the file in
128the kernel table that the Cache Manager uses to track certain information
129about files. Because closing a file generally erases the entry, when
130reopening a file the only way to guarantee that the setting still applies
131is to reissue the command. If this argument is provided without the
132B<-kbytes> argument, the command reports the current setting for the
133specified files, and the default store asynchrony.
134
135=item B<-allfiles> <I<new default (KB)>>
136
137Sets the default store asynchrony for the local machine, which is the
138number of kilobytes of data that can remain to be written to the file
139server when the Cache Manager returns control to the application program
140that closed a file. The value applies to all AFS files manipulated by
141applications running on the machine, except those for which settings have
142been made with the B<-kbytes> and B<-files> arguments. Provide an integer
143from the range C<0> (which indicates the default of synchronous writes) to
144the maximum AFS file size.
145
146=item B<-verbose>
147
148Produces output confirming the settings made with the accompanying
149B<-kbytes> and B<-files> arguments, the B<-allfiles> argument, or all
150three. If provided by itself, reports the current default store
151asynchrony.
152
153=item B<-help>
154
155Prints the online help for this command. All other valid options are
156ignored.
157
158=back
159
160=head1 OUTPUT
161
162If none of the command's options are included, or if only the B<-verbose>
163flag is included, the following message reports the default store
164asynchrony (the setting that applies to all files manipulated by
165applications running on the local machine and for which not more specific
166asynchrony is set).
167
168 Default store asynchrony is <x> kbytes.
169
170A value of C<0> (zero) indicates synchronous writes and is the default if
171no one has included the B<-allfiles> argument on this command since the
172machine last rebooted.
173
174If the B<-files> argument is provided without the B<-kbytes> argument, the
175output reports the value that applies to each specified file along with
176the default store asynchrony. If a particular value has previously been
177set for a file, the following message reports it:
178
179 Will store up to <y> kbytes of <file> asynchronously.
180 Default store asynchrony is <x> kbytes.
181
182If the default store asynchrony applies to a file because no explicit
183B<-kbytes> value has been set for it, the message is instead as follows:
184
185 Will store <file> according to default.
186 Default store asynchrony is <x> kbytes.
187
188If the B<-verbose> flag is combined with arguments that set values
189(B<-files> and B<-kbytes>, or B<-allfiles>, or all three), there is a
190message that confirms immediately that the setting has taken effect. When
191included without other arguments or flags, the B<-verbose> flag reports
192the default store asynchrony only.
193
194=head1 EXAMPLES
195
196The following command enables the Cache Manager to return control to the
197application program that closed the file F<test.data> when 100 kilobytes
198still remain to be written to the File Server. The B<-verbose> flag
199produces output that confirms the new setting, and that the default store
200asynchrony is zero.
201
202 % fs storebehind -kbytes 100 -files test.data -verbose
203 Will store up to 100 kbytes of test.data asynchronously.
204 Default store asynchrony is 0 kbytes.
205
206=head1 PRIVILEGE REQUIRED
207
208To include the B<-allfiles> argument, the issuer must be logged in as the
209local superuser C<root>.
210
211To include the B<-kbytes> and B<-files> arguments, the issuer must either
212be logged in as the local superuser C<root> or have the C<w> (write)
213permission on the ACL of each file's directory.
214
215To view the current settings (by including no arguments, the B<-file>
216argument alone, or the B<-verbose> argument alone), no privilege is
217required.
218
219=head1 SEE ALSO
220
221L<afsd(8)>
222
223=head1 COPYRIGHT
224
225IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.
226
227This documentation is covered by the IBM Public License Version 1.0. It was
228converted from HTML to POD by software written by Chas Williams and Russ
229Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.