Lines Matching refs:volume
122 const struct afs_volume *volume = vnode->volume; in afs_check_validity() local
128 if (atomic_read(&volume->cb_v_check) != atomic_read(&volume->cb_v_break) || in afs_check_validity()
130 volume->cb_expires_at <= deadline || in afs_check_validity()
131 vnode->cb_ro_snapshot != atomic_read(&volume->cb_ro_snapshot) || in afs_check_validity()
132 vnode->cb_scrub != atomic_read(&volume->cb_scrub) || in afs_check_validity()
144 static bool __afs_is_server_excluded(struct afs_operation *op, struct afs_volume *volume) in __afs_is_server_excluded() argument
153 slist = rcu_dereference(volume->servers); in __afs_is_server_excluded()
170 static int afs_is_server_excluded(struct afs_operation *op, struct afs_volume *volume) in afs_is_server_excluded() argument
174 if (__afs_is_server_excluded(op, volume)) in afs_is_server_excluded()
177 set_bit(AFS_VOLUME_NEEDS_UPDATE, &volume->flags); in afs_is_server_excluded()
178 ret = afs_check_volume_status(op->volume, op); in afs_is_server_excluded()
182 return __afs_is_server_excluded(op, volume); in afs_is_server_excluded()
188 static int afs_update_volume_creation_time(struct afs_operation *op, struct afs_volume *volume) in afs_update_volume_creation_time() argument
191 time64_t cur = volume->creation_time; in afs_update_volume_creation_time()
196 _enter("%llx,%llx,%llx->%llx", volume->vid, cur, old, new); in afs_update_volume_creation_time()
199 volume->creation_time = new; in afs_update_volume_creation_time()
219 if (volume->type == AFSVL_RWVOL) in afs_update_volume_creation_time()
221 if (volume->type == AFSVL_BACKVOL) { in afs_update_volume_creation_time()
230 ret = afs_is_server_excluded(op, volume); in afs_update_volume_creation_time()
234 snap = atomic_read(&volume->cb_ro_snapshot); in afs_update_volume_creation_time()
235 trace_afs_cb_v_break(volume->vid, snap, afs_cb_break_volume_excluded); in afs_update_volume_creation_time()
240 snap = atomic_inc_return(&volume->cb_ro_snapshot); in afs_update_volume_creation_time()
241 trace_afs_cb_v_break(volume->vid, snap, afs_cb_break_for_vos_release); in afs_update_volume_creation_time()
242 volume->creation_time = new; in afs_update_volume_creation_time()
246 atomic_inc(&volume->cb_scrub); in afs_update_volume_creation_time()
247 trace_afs_cb_v_break(volume->vid, 0, afs_cb_break_for_creation_regress); in afs_update_volume_creation_time()
248 volume->creation_time = new; in afs_update_volume_creation_time()
255 static void afs_update_volume_update_time(struct afs_operation *op, struct afs_volume *volume) in afs_update_volume_update_time() argument
258 time64_t cur = volume->update_time; in afs_update_volume_update_time()
262 _enter("%llx,%llx,%llx->%llx", volume->vid, cur, old, new); in afs_update_volume_update_time()
265 volume->update_time = new; in afs_update_volume_update_time()
287 atomic_inc(&volume->cb_scrub); in afs_update_volume_update_time()
288 trace_afs_cb_v_break(volume->vid, 0, reason); in afs_update_volume_update_time()
290 volume->update_time = new; in afs_update_volume_update_time()
294 static int afs_update_volume_times(struct afs_operation *op, struct afs_volume *volume) in afs_update_volume_times() argument
298 if (likely(op->volsync.creation == volume->creation_time && in afs_update_volume_times()
299 op->volsync.update == volume->update_time)) in afs_update_volume_times()
302 mutex_lock(&volume->volsync_lock); in afs_update_volume_times()
303 if (op->volsync.creation != volume->creation_time) { in afs_update_volume_times()
304 ret = afs_update_volume_creation_time(op, volume); in afs_update_volume_times()
308 if (op->volsync.update != volume->update_time) in afs_update_volume_times()
309 afs_update_volume_update_time(op, volume); in afs_update_volume_times()
311 mutex_unlock(&volume->volsync_lock); in afs_update_volume_times()
324 struct afs_volume *volume = op->volume; in afs_update_volume_state() local
325 unsigned int cb_v_break = atomic_read(&volume->cb_v_break); in afs_update_volume_state()
326 unsigned int cb_v_check = atomic_read(&volume->cb_v_check); in afs_update_volume_state()
329 _enter("%llx", op->volume->vid); in afs_update_volume_state()
332 ret = afs_update_volume_times(op, volume); in afs_update_volume_state()
347 volume->cb_expires_at = expires_at; in afs_update_volume_state()
350 atomic_cmpxchg(&volume->cb_v_check, cb_v_check, op->cb_v_break); in afs_update_volume_state()
384 struct afs_volume *volume = vnode->volume; in afs_validate() local
411 if (volume->cb_expires_at <= deadline || in afs_validate()
412 atomic_read(&volume->cb_v_check) != atomic_read(&volume->cb_v_break)) { in afs_validate()
413 ret = mutex_lock_interruptible(&volume->cb_check_lock); in afs_validate()
419 cb_ro_snapshot = atomic_read(&volume->cb_ro_snapshot); in afs_validate()
420 cb_scrub = atomic_read(&volume->cb_scrub); in afs_validate()
427 volume->cb_expires_at <= deadline || in afs_validate()
428 atomic_read(&volume->cb_v_check) != atomic_read(&volume->cb_v_break) || in afs_validate()
445 mutex_unlock(&volume->cb_check_lock); in afs_validate()
449 cb_ro_snapshot = atomic_read(&volume->cb_ro_snapshot); in afs_validate()
450 cb_scrub = atomic_read(&volume->cb_scrub); in afs_validate()
470 mutex_unlock(&volume->cb_check_lock); in afs_validate()