Lines Matching +full:set +full:- +full:aces
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
19 #include <linux/backing-dev.h>
39 * Partial file-locking emulation mode. (The problem being that AFS3 only
40 * allows whole-file locks and no upgrading/downgrading).
52 bool autocell; /* T if set auto mount operation */
55 enum afs_flock_mode flock_mode; /* Partial file-locking emulation mode */
126 * a record of an in-progress RxRPC call
145 union { /* Convenience for ->def_iter */
158 unsigned char probe_index; /* Address in ->probe_alist */
166 unsigned int max_lifespan; /* Maximum lifespan in secs to set if not 0 */
197 * - returning an error will cause the call to be aborted
217 struct list_head vnode_link; /* Link in vnode->wb_keys */
221 * AFS open file information record. Pointed to by file->private_data.
230 struct afs_file *af = file->private_data; in afs_file_key()
232 return af->key; in afs_file_key()
259 * - there's one superblock per volume
271 return sb->s_fs_info; in AFS_FS_S()
277 * Set of substitutes for @sys.
376 * simply by pointing AFSDB/SRV records for two names at the same set of VL
381 * Cells only exist in the sense that (a) a cell's name maps to a set of VL
394 struct rb_node net_node; /* Node in net->cells */
407 #define AFS_CELL_FL_NO_GC 0 /* The cell was added manually, don't auto-gc */
418 struct rw_semaphore vs_lock; /* Lock for server->volumes */
432 char *name; /* Cell name, case-flattened and NUL-padded */
469 char name[]; /* Server name, case-flattened */
498 * This is pointed to by cell->vldb_entries, indexed by name.
504 #define AFS_VLDB_HAS_RW 0 /* - R/W volume exists */
505 #define AFS_VLDB_HAS_RO 1 /* - R/O volume exists */
506 #define AFS_VLDB_HAS_BAK 2 /* - Backup volume exists */
507 #define AFS_VLDB_QUERY_VALID 3 /* - Record is valid */
508 #define AFS_VLDB_QUERY_ERROR 4 /* - VL server returned error */
520 u8 name[AFS_MAXVOLNAME + 1]; /* NUL-padded volume name */
542 #define AFS_ESTATE_RESPONDED 0 /* Set if the server responded */
543 #define AFS_ESTATE_SUPERSEDED 1 /* Set if this record has been superseded */
544 #define AFS_ESTATE_IS_YFS 2 /* Set if probe upgraded to YFS */
545 #define AFS_ESTATE_NOT_YFS 3 /* Set if probe didn't upgrade to YFS */
546 #define AFS_ESTATE_LOCAL_FAILURE 4 /* Set if there was a local failure (eg. ENOMEM) */
560 struct rb_node uuid_rb; /* Link in net->fs_servers */
563 struct list_head probe_link; /* Link in net->fs_probe_list */
564 struct hlist_node addr_link; /* Link in net->fs_addresses6 */
565 struct hlist_node proc_link; /* Link in net->fs_proc */
611 struct list_head slink; /* Link in server->volumes */
612 time64_t cb_expires_at; /* Time at which volume-level callback expires */
614 #define AFS_SE_EXCLUDED 0 /* Set if server is to be excluded in rotation */
615 #define AFS_SE_VOLUME_OFFLINE 1 /* Set if volume offline notice given */
616 #define AFS_SE_VOLUME_BUSY 2 /* Set if volume busy notice given */
623 enum afs_ro_replicating ro_replicating; /* RW->RO update (probably) in progress */
626 unsigned int seq; /* Set to ->servers_seq when installed */
641 struct rb_node cell_node; /* Link in cell->volumes */
642 struct hlist_node proc_link; /* Link in cell->proc_volumes */
646 #define AFS_VOLUME_NEEDS_UPDATE 0 /* - T if an update needs performing */
647 #define AFS_VOLUME_UPDATING 1 /* - T if an update is in progress */
648 #define AFS_VOLUME_WAIT 2 /* - T if users must wait for update */
649 #define AFS_VOLUME_DELETED 3 /* - T if volume appears deleted */
650 #define AFS_VOLUME_MAYBE_NO_IBULK 4 /* - T if some servers don't have InlineBulkStatus */
651 #define AFS_VOLUME_RM_TREE 5 /* - Set if volume removed from cell->volumes */
656 rwlock_t servers_lock; /* Lock for ->servers */
657 unsigned int servers_seq; /* Incremented each time ->servers changes */
667 atomic_t cb_ro_snapshot; /* RO volume update-from-snapshot counter */
668 atomic_t cb_v_break; /* Volume-break event counter. */
669 atomic_t cb_v_check; /* Volume-break has-been-checked counter. */
670 atomic_t cb_scrub; /* Scrub-all-data event counter. */
676 char type_force; /* force volume type (suppress R/O -> R/W) */
678 u8 name[AFS_MAXVOLNAME + 1]; /* NUL-padded volume name */
712 #define AFS_VNODE_UNSET 1 /* set if vnode attributes not yet set */
713 #define AFS_VNODE_DIR_VALID 2 /* Set if dir contents are valid */
714 #define AFS_VNODE_ZAP_DATA 3 /* set if vnode's data should be invalidated */
715 #define AFS_VNODE_DELETED 4 /* set if vnode deleted on server */
716 #define AFS_VNODE_MOUNTPOINT 5 /* set if vnode is a mountpoint symlink */
717 #define AFS_VNODE_AUTOCELL 6 /* set if Vnode is an auto mount point */
718 #define AFS_VNODE_PSEUDODIR 7 /* set if Vnode is a pseudo directory */
719 #define AFS_VNODE_NEW_CONTENT 8 /* Set if file has new content (create/trunc-0) */
720 #define AFS_VNODE_SILLY_DELETED 9 /* Set if file has been silly-deleted */
721 #define AFS_VNODE_MODIFYING 10 /* Set if we're performing a modification op */
734 struct list_head cb_mmap_link; /* Link in cell->fs_open_mmaps */
737 unsigned int cb_ro_snapshot; /* RO volume release counter on ->volume */
738 unsigned int cb_scrub; /* Scrub counter on ->volume */
740 unsigned int cb_v_check; /* Break check counter on ->volume */
741 seqlock_t cb_lock; /* Lock for ->cb_server, ->status, ->cb_*break */
750 return netfs_i_cookie(&vnode->netfs); in afs_vnode_cache()
760 vnode->netfs.cache = cookie; in afs_vnode_set_cache()
762 mapping_set_release_always(vnode->netfs.inode.i_mapping); in afs_vnode_set_cache()
795 bool aborted; /* T if ->error is from an abort */
799 * Cursor for iterating over a set of volume location servers.
816 #define AFS_VL_CURSOR_STOP 0x0001 /* Set to cease iteration */
817 #define AFS_VL_CURSOR_RETRY 0x0002 /* Set to do a retry */
818 #define AFS_VL_CURSOR_RETRIED 0x0004 /* Set if started a retry */
863 bool modification:1; /* Set if the content gets modified */
885 struct timespec64 ctime; /* Change time to set */
894 int which; /* Which ->file[] to fetch for */
949 #define AFS_OPERATION_STOP 0x0001 /* Set to cease iteration */
950 #define AFS_OPERATION_VBUSY 0x0002 /* Set if seen VBUSY */
951 #define AFS_OPERATION_VMOVED 0x0004 /* Set if seen VMOVED */
952 #define AFS_OPERATION_VNOVOL 0x0008 /* Set if seen VNOVOL */
953 #define AFS_OPERATION_CUR_ONLY 0x0010 /* Set if current server only (file lock held) */
954 #define AFS_OPERATION_NO_VSLEEP 0x0020 /* Set to prevent sleep on VBUSY, VOFFLINE, ... */
955 #define AFS_OPERATION_UNINTR 0x0040 /* Set if op is uninterruptible */
956 #define AFS_OPERATION_DOWNGRADE 0x0080 /* Set to retry with downgraded opcode */
957 #define AFS_OPERATION_LOCK_0 0x0100 /* Set if have io_lock on file[0] */
958 #define AFS_OPERATION_LOCK_1 0x0200 /* Set if have io_lock on file[1] */
959 #define AFS_OPERATION_TRIED_ALL 0x0400 /* Set if we've tried all the fileservers */
960 #define AFS_OPERATION_RETRY_SERVER 0x0800 /* Set if we should retry the current server */
961 #define AFS_OPERATION_DIR_CONFLICT 0x1000 /* Set if we detected a 3rd-party dir change */
974 aux->data_version = cpu_to_be64(vnode->status.data_version); in afs_set_cache_aux()
983 i_size_read(&vnode->netfs.inode), flags); in afs_invalidate_cache()
1025 return vnode->cb_break + vnode->cb_ro_snapshot + vnode->cb_scrub; in afs_calc_vnode_cb_break()
1031 return cb_break != (vnode->cb_break + in afs_cb_is_broken()
1032 atomic_read(&vnode->volume->cb_ro_snapshot) + in afs_cb_is_broken()
1033 atomic_read(&vnode->volume->cb_scrub)); in afs_cb_is_broken()
1117 refcount_inc(&req->usage); in afs_get_read()
1177 op->file[n].vnode = vnode; in afs_op_set_vnode()
1178 op->file[n].need_io_lock = true; in afs_op_set_vnode()
1184 op->file[n].fid = *fid; in afs_op_set_fid()
1233 return afs_net(AFS_FS_S(sb)->net_ns); in afs_sb2net()
1238 return afs_sb2net(dentry->d_sb); in afs_d2net()
1243 return afs_sb2net(inode->i_sb); in afs_i2net()
1248 return afs_i2net(&vnode->netfs.inode); in afs_v2net()
1261 #define afs_stat_v(vnode, n) __afs_stat(&afs_v2net(vnode)->n)
1271 op->cumul_error.error = -ENOMEM; in afs_op_nomem()
1276 return op->cumul_error.error; in afs_op_error()
1281 return op->cumul_error.abort_code; in afs_op_abort_code()
1286 return op->cumul_error.error = error; in afs_op_set_error()
1291 afs_prioritise_error(&op->cumul_error, error, abort_code); in afs_op_accumulate_error()
1352 struct afs_addr_list *alist = op->estate->addresses; in afs_make_op_call()
1354 op->call = call; in afs_make_op_call()
1355 op->type = call->type; in afs_make_op_call()
1356 call->op = op; in afs_make_op_call()
1357 call->key = op->key; in afs_make_op_call()
1358 call->intr = !(op->flags & AFS_OPERATION_UNINTR); in afs_make_op_call()
1359 call->peer = rxrpc_kernel_get_peer(alist->addrs[op->addr_index].peer); in afs_make_op_call()
1360 call->service_id = op->server->service_id; in afs_make_op_call()
1366 call->iov_len = size; in afs_extract_begin()
1367 call->kvec[0].iov_base = buf; in afs_extract_begin()
1368 call->kvec[0].iov_len = size; in afs_extract_begin()
1369 iov_iter_kvec(&call->def_iter, ITER_DEST, call->kvec, 1, size); in afs_extract_begin()
1374 call->iov_len = sizeof(call->tmp); in afs_extract_to_tmp()
1375 afs_extract_begin(call, &call->tmp, sizeof(call->tmp)); in afs_extract_to_tmp()
1380 call->iov_len = sizeof(call->tmp64); in afs_extract_to_tmp64()
1381 afs_extract_begin(call, &call->tmp64, sizeof(call->tmp64)); in afs_extract_to_tmp64()
1386 call->iov_len = size; in afs_extract_discard()
1387 iov_iter_discard(&call->def_iter, ITER_DEST, size); in afs_extract_discard()
1392 call->iov_len = size; in afs_extract_to_buf()
1393 afs_extract_begin(call, call->buffer, size); in afs_extract_to_buf()
1404 return READ_ONCE(call->state) == state; in afs_check_call_state()
1413 spin_lock_bh(&call->state_lock); in afs_set_call_state()
1414 if (call->state == from) { in afs_set_call_state()
1415 call->state = to; in afs_set_call_state()
1419 spin_unlock_bh(&call->state_lock); in afs_set_call_state()
1429 spin_lock_bh(&call->state_lock); in afs_set_call_complete()
1430 state = call->state; in afs_set_call_complete()
1432 call->abort_code = remote_abort; in afs_set_call_complete()
1433 call->error = error; in afs_set_call_complete()
1434 call->state = AFS_CALL_COMPLETE; in afs_set_call_complete()
1439 spin_unlock_bh(&call->state_lock); in afs_set_call_complete()
1443 /* Asynchronous calls have two refs to release - one from the alloc and in afs_set_call_complete()
1444 * one queued with the work item - and we can't just deallocate the in afs_set_call_complete()
1447 if (call->drop_ref) in afs_set_call_complete()
1486 atomic_inc(&net->servers_outstanding); in afs_inc_servers_outstanding()
1491 if (atomic_dec_and_test(&net->servers_outstanding)) in afs_dec_servers_outstanding()
1492 wake_up_var(&net->servers_outstanding); in afs_dec_servers_outstanding()
1497 return list_empty(&server->probe_link); in afs_is_probing_server()
1505 refcount_inc(&slist->usage); in afs_get_serverlist()
1573 refcount_inc(&vlserver->ref); in afs_get_vlserver()
1580 refcount_inc(&vllist->ref); in afs_get_vlserverlist()
1644 u32 num_cleaned; /* Number of ACEs removed due to subject removal */
1646 #define YFS_ACL_WANT_ACL 0x01 /* Set if caller wants ->acl */
1647 #define YFS_ACL_WANT_VOL_ACL 0x02 /* Set if caller wants ->vol_acl */
1664 return &vnode->netfs.inode; in AFS_VNODE_TO_I()
1668 * Note that a dentry got changed. We need to set d_fsdata to the data version
1676 if (!op->cumul_error.error) in afs_update_dentry_version()
1677 dentry->d_fsdata = in afs_update_dentry_version()
1678 (void *)(unsigned long)dir_vp->scb.status.data_version; in afs_update_dentry_version()
1682 * Set the file size and block count. Estimate the number of 512 bytes blocks
1687 i_size_write(&vnode->netfs.inode, size); in afs_set_i_size()
1688 vnode->netfs.inode.i_blocks = ((size + 1023) >> 10) << 1; in afs_set_i_size()
1699 if (dvp->dv_before + dvp->dv_delta != dvp->scb.status.data_version) in afs_check_dir_conflict()
1700 op->flags |= AFS_OPERATION_DIR_CONFLICT; in afs_check_dir_conflict()
1705 trace_afs_io_error(call->debug_id, -EIO, where); in afs_io_error()
1706 return -EIO; in afs_io_error()
1711 trace_afs_file_error(vnode, -EIO, where); in afs_bad()
1712 return -EIO; in afs_bad()
1722 printk("[%-6.6s] "FMT"\n", current->comm ,##__VA_ARGS__)