~ubuntu-branches/ubuntu/precise/mountall/precise

« back to all changes in this revision

Viewing changes to src/control.c

  • Committer: Surbhi Palande
  • Date: 2011-07-15 06:58:31 UTC
  • mto: This revision was merged to the branch mainline in revision 372.
  • Revision ID: surbhi.palande@canonical.com-20110715065831-jga2lw83obvg28e6
Changed the interface to stop/restart timers to use a mountpoint rather than
the device name. This is useful in situations where the device mentioned in
/etc/fstab is not the device used for mounting because of the change mount
device interface. The mountpoint remains constant in all cases and is also
easier to use that specifying a device with uuids for eg.

Show diffs side-by-side

added added

removed removed

Lines of Context:
149
149
 
150
150
/**
151
151
 * control_stop_timer:
152
 
 * @devname: Name of the device whose timer you want to stop.
 
152
 * @mountpoint: the mountpoint corresponding to the device for which the
 
153
 * timeout option has to be disabled.
153
154
 *
154
155
 * Implements the StopTimer method of com.ubuntu.Moutall01_Server
155
156
 * interface.
156
157
 *
157
158
 * This function is called for stopping a previously started timer for a
158
 
 * @device. Stopping a timer has the effect that mountall would no longer
159
 
 * expect the device to be ready within a previously registered stipulated
160
 
 * time period. After this call, mountall will wait endlessly till the device
161
 
 * becomes ready! Use this function only when you know that you might restart
162
 
 * the timer later or that you really want to wait endlessly for the device to
163
 
 * become available. 
 
159
 * mountpoint. Stopping a timer has the effect that mountall would no longer
 
160
 * expect the corresponding device to be ready within a previously registered
 
161
 * stiplulated time period. After this call, mountall will wait endlessly till
 
162
 * the device becomes ready. Use this function only when you know that you
 
163
 * might restart the timer later or that you really want to wait endlessly
 
164
 * till the device becomes available.
164
165
 *
165
166
 * Returns 0 on success and -1 on failure.
166
167
 **/
167
168
int
168
169
control_stop_timer  (void *data, 
169
170
                     NihDBusMessage *message,
170
 
                     const char *devname)
 
171
                     const char *mountpoint)
171
172
{
172
173
 
173
 
        nih_assert (devname != NULL);
 
174
        nih_assert (mountpoint != NULL);
174
175
        nih_assert (message != NULL);
175
176
 
176
 
        return stop_dev_timer (devname);
 
177
        return stop_dev_timer (mountpoint);
177
178
}
178
179
 
179
180
/**
180
181
 * control_restart_timer:
181
 
 * @devname: Name of the device whose timer you want to stop.
 
182
 * @mountpoint: the mountpoint corresponding to the device for which the
 
183
 * timeout option has to be disabled.
182
184
 *
183
185
 * Implements the RestartTimer method of com.ubuntu.Moutall01_Server
184
186
 * interface.
185
187
 *
186
188
 * This function is called for restarting a previously stopped timer for a
187
 
 * @device. After successfully restarting a timer, mountall will expect the
188
 
 * device to become ready for mounting within the previously configured
189
 
 * timeout or the default of 30 seconds.
 
189
 * mountpoint. After successfully restarting a timer, mountall will expect the
 
190
 * corresponding device to become ready for mounting within the previously
 
191
 * configured timeout or the default of 30 seconds.
190
192
 *
191
193
 * Returns 0 on success and -1 on failure.
192
194
 **/
193
195
int
194
196
control_restart_timer (void *data,
195
197
                       NihDBusMessage *message,
196
 
                       const char *devname)
 
198
                       const char *mountpoint)
197
199
{
198
200
 
199
 
        nih_assert (devname != NULL);
 
201
        nih_assert (mountpoint != NULL);
200
202
        nih_assert (message != NULL);
201
203
 
202
 
        return restart_dev_timer (devname);
 
204
        return restart_dev_timer (mountpoint);
203
205
}
204
206
 
205
207
/**