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 */
167 unsigned int max_lifespan; /* Maximum lifespan in secs to set if not 0 */
198 * - returning an error will cause the call to be aborted
224 struct list_head vnode_link; /* Link in vnode->wb_keys */
228 * AFS open file information record. Pointed to by file->private_data.
237 struct afs_file *af = file->private_data; in afs_file_key()
239 return af->key; in afs_file_key()
244 * - there's one superblock per volume
256 return sb->s_fs_info; in AFS_FS_S()
262 * Set of substitutes for @sys.
361 * simply by pointing AFSDB/SRV records for two names at the same set of VL
366 * Cells only exist in the sense that (a) a cell's name maps to a set of VL
379 struct rb_node net_node; /* Node in net->cells */
392 #define AFS_CELL_FL_NO_GC 0 /* The cell was added manually, don't auto-gc */
403 struct rw_semaphore vs_lock; /* Lock for server->volumes */
417 char *name; /* Cell name, case-flattened and NUL-padded */
454 char name[]; /* Server name, case-flattened */
483 * This is pointed to by cell->vldb_entries, indexed by name.
489 #define AFS_VLDB_HAS_RW 0 /* - R/W volume exists */
490 #define AFS_VLDB_HAS_RO 1 /* - R/O volume exists */
491 #define AFS_VLDB_HAS_BAK 2 /* - Backup volume exists */
492 #define AFS_VLDB_QUERY_VALID 3 /* - Record is valid */
493 #define AFS_VLDB_QUERY_ERROR 4 /* - VL server returned error */
505 u8 name[AFS_MAXVOLNAME + 1]; /* NUL-padded volume name */
527 #define AFS_ESTATE_RESPONDED 0 /* Set if the server responded */
528 #define AFS_ESTATE_SUPERSEDED 1 /* Set if this record has been superseded */
529 #define AFS_ESTATE_IS_YFS 2 /* Set if probe upgraded to YFS */
530 #define AFS_ESTATE_NOT_YFS 3 /* Set if probe didn't upgrade to YFS */
531 #define AFS_ESTATE_LOCAL_FAILURE 4 /* Set if there was a local failure (eg. ENOMEM) */
545 struct rb_node uuid_rb; /* Link in net->fs_servers */
548 struct list_head probe_link; /* Link in net->fs_probe_list */
549 struct hlist_node addr_link; /* Link in net->fs_addresses6 */
550 struct hlist_node proc_link; /* Link in net->fs_proc */
596 struct list_head slink; /* Link in server->volumes */
597 time64_t cb_expires_at; /* Time at which volume-level callback expires */
599 #define AFS_SE_EXCLUDED 0 /* Set if server is to be excluded in rotation */
600 #define AFS_SE_VOLUME_OFFLINE 1 /* Set if volume offline notice given */
601 #define AFS_SE_VOLUME_BUSY 2 /* Set if volume busy notice given */
608 enum afs_ro_replicating ro_replicating; /* RW->RO update (probably) in progress */
611 unsigned int seq; /* Set to ->servers_seq when installed */
626 struct rb_node cell_node; /* Link in cell->volumes */
627 struct hlist_node proc_link; /* Link in cell->proc_volumes */
631 #define AFS_VOLUME_NEEDS_UPDATE 0 /* - T if an update needs performing */
632 #define AFS_VOLUME_UPDATING 1 /* - T if an update is in progress */
633 #define AFS_VOLUME_WAIT 2 /* - T if users must wait for update */
634 #define AFS_VOLUME_DELETED 3 /* - T if volume appears deleted */
635 #define AFS_VOLUME_MAYBE_NO_IBULK 4 /* - T if some servers don't have InlineBulkStatus */
636 #define AFS_VOLUME_RM_TREE 5 /* - Set if volume removed from cell->volumes */
641 rwlock_t servers_lock; /* Lock for ->servers */
642 unsigned int servers_seq; /* Incremented each time ->servers changes */
652 atomic_t cb_ro_snapshot; /* RO volume update-from-snapshot counter */
653 atomic_t cb_v_break; /* Volume-break event counter. */
654 atomic_t cb_v_check; /* Volume-break has-been-checked counter. */
655 atomic_t cb_scrub; /* Scrub-all-data event counter. */
661 char type_force; /* force volume type (suppress R/O -> R/W) */
663 u8 name[AFS_MAXVOLNAME + 1]; /* NUL-padded volume name */
697 #define AFS_VNODE_IO_LOCK 0 /* Set if the I/O serialisation lock is held */
698 #define AFS_VNODE_UNSET 1 /* set if vnode attributes not yet set */
699 #define AFS_VNODE_DIR_VALID 2 /* Set if dir contents are valid */
700 #define AFS_VNODE_ZAP_DATA 3 /* set if vnode's data should be invalidated */
701 #define AFS_VNODE_DELETED 4 /* set if vnode deleted on server */
702 #define AFS_VNODE_MOUNTPOINT 5 /* set if vnode is a mountpoint symlink */
703 #define AFS_VNODE_AUTOCELL 6 /* set if Vnode is an auto mount point */
704 #define AFS_VNODE_PSEUDODIR 7 /* set if Vnode is a pseudo directory */
705 #define AFS_VNODE_NEW_CONTENT 8 /* Set if file has new content (create/trunc-0) */
706 #define AFS_VNODE_SILLY_DELETED 9 /* Set if file has been silly-deleted */
707 #define AFS_VNODE_MODIFYING 10 /* Set if we're performing a modification op */
708 #define AFS_VNODE_DIR_READ 11 /* Set if we've read a dir's contents */
719 unsigned int directory_size; /* Amount of space in ->directory */
723 struct list_head cb_mmap_link; /* Link in cell->fs_open_mmaps */
726 unsigned int cb_ro_snapshot; /* RO volume release counter on ->volume */
727 unsigned int cb_scrub; /* Scrub counter on ->volume */
729 unsigned int cb_v_check; /* Break check counter on ->volume */
730 seqlock_t cb_lock; /* Lock for ->cb_server, ->status, ->cb_*break */
739 return netfs_i_cookie(&vnode->netfs); in afs_vnode_cache()
749 vnode->netfs.cache = cookie; in afs_vnode_set_cache()
751 mapping_set_release_always(vnode->netfs.inode.i_mapping); in afs_vnode_set_cache()
784 bool aborted; /* T if ->error is from an abort */
788 * Cursor for iterating over a set of volume location servers.
805 #define AFS_VL_CURSOR_STOP 0x0001 /* Set to cease iteration */
806 #define AFS_VL_CURSOR_RETRY 0x0002 /* Set to do a retry */
807 #define AFS_VL_CURSOR_RETRIED 0x0004 /* Set if started a retry */
852 bool modification:1; /* Set if the content gets modified */
874 struct timespec64 ctime; /* Change time to set */
883 int which; /* Which ->file[] to fetch for */
938 #define AFS_OPERATION_STOP 0x0001 /* Set to cease iteration */
939 #define AFS_OPERATION_VBUSY 0x0002 /* Set if seen VBUSY */
940 #define AFS_OPERATION_VMOVED 0x0004 /* Set if seen VMOVED */
941 #define AFS_OPERATION_VNOVOL 0x0008 /* Set if seen VNOVOL */
942 #define AFS_OPERATION_CUR_ONLY 0x0010 /* Set if current server only (file lock held) */
943 #define AFS_OPERATION_NO_VSLEEP 0x0020 /* Set to prevent sleep on VBUSY, VOFFLINE, ... */
944 #define AFS_OPERATION_UNINTR 0x0040 /* Set if op is uninterruptible */
945 #define AFS_OPERATION_DOWNGRADE 0x0080 /* Set to retry with downgraded opcode */
946 #define AFS_OPERATION_LOCK_0 0x0100 /* Set if have io_lock on file[0] */
947 #define AFS_OPERATION_LOCK_1 0x0200 /* Set if have io_lock on file[1] */
948 #define AFS_OPERATION_TRIED_ALL 0x0400 /* Set if we've tried all the fileservers */
949 #define AFS_OPERATION_RETRY_SERVER 0x0800 /* Set if we should retry the current server */
950 #define AFS_OPERATION_DIR_CONFLICT 0x1000 /* Set if we detected a 3rd-party dir change */
951 #define AFS_OPERATION_ASYNC 0x2000 /* Set if should run asynchronously */
964 aux->data_version = cpu_to_be64(vnode->status.data_version); in afs_set_cache_aux()
973 i_size_read(&vnode->netfs.inode), flags); in afs_invalidate_cache()
1030 return vnode->cb_break + vnode->cb_ro_snapshot + vnode->cb_scrub; in afs_calc_vnode_cb_break()
1036 return cb_break != (vnode->cb_break + in afs_cb_is_broken()
1037 atomic_read(&vnode->volume->cb_ro_snapshot) + in afs_cb_is_broken()
1038 atomic_read(&vnode->volume->cb_scrub)); in afs_cb_is_broken()
1074 __acquires(&dvnode->validate_lock);
1193 op->file[n].vnode = vnode; in afs_op_set_vnode()
1194 op->file[n].need_io_lock = true; in afs_op_set_vnode()
1200 op->file[n].fid = *fid; in afs_op_set_fid()
1253 return afs_net(AFS_FS_S(sb)->net_ns); in afs_sb2net()
1258 return afs_sb2net(dentry->d_sb); in afs_d2net()
1263 return afs_sb2net(inode->i_sb); in afs_i2net()
1268 return afs_i2net(&vnode->netfs.inode); in afs_v2net()
1281 #define afs_stat_v(vnode, n) __afs_stat(&afs_v2net(vnode)->n)
1291 op->cumul_error.error = -ENOMEM; in afs_op_nomem()
1296 return op->cumul_error.error; in afs_op_error()
1301 return op->cumul_error.abort_code; in afs_op_abort_code()
1306 return op->cumul_error.error = error; in afs_op_set_error()
1311 afs_prioritise_error(&op->cumul_error, error, abort_code); in afs_op_accumulate_error()
1375 __refcount_inc(&call->ref, &r); in afs_get_call()
1377 trace_afs_call(call->debug_id, why, r + 1, in afs_get_call()
1378 atomic_read(&call->net->nr_outstanding_calls), in afs_get_call()
1385 int r = refcount_read(&call->ref); in afs_see_call()
1387 trace_afs_call(call->debug_id, why, r, in afs_see_call()
1388 atomic_read(&call->net->nr_outstanding_calls), in afs_see_call()
1395 struct afs_addr_list *alist = op->estate->addresses; in afs_make_op_call()
1397 op->call = call; in afs_make_op_call()
1398 op->type = call->type; in afs_make_op_call()
1399 call->op = op; in afs_make_op_call()
1400 call->key = op->key; in afs_make_op_call()
1401 call->intr = !(op->flags & AFS_OPERATION_UNINTR); in afs_make_op_call()
1402 call->peer = rxrpc_kernel_get_peer(alist->addrs[op->addr_index].peer); in afs_make_op_call()
1403 call->service_id = op->server->service_id; in afs_make_op_call()
1409 call->iov_len = size; in afs_extract_begin()
1410 call->kvec[0].iov_base = buf; in afs_extract_begin()
1411 call->kvec[0].iov_len = size; in afs_extract_begin()
1412 iov_iter_kvec(&call->def_iter, ITER_DEST, call->kvec, 1, size); in afs_extract_begin()
1417 call->iov_len = sizeof(call->tmp); in afs_extract_to_tmp()
1418 afs_extract_begin(call, &call->tmp, sizeof(call->tmp)); in afs_extract_to_tmp()
1423 call->iov_len = sizeof(call->tmp64); in afs_extract_to_tmp64()
1424 afs_extract_begin(call, &call->tmp64, sizeof(call->tmp64)); in afs_extract_to_tmp64()
1429 call->iov_len = size; in afs_extract_discard()
1430 iov_iter_discard(&call->def_iter, ITER_DEST, size); in afs_extract_discard()
1435 call->iov_len = size; in afs_extract_to_buf()
1436 afs_extract_begin(call, call->buffer, size); in afs_extract_to_buf()
1447 return READ_ONCE(call->state) == state; in afs_check_call_state()
1456 spin_lock_bh(&call->state_lock); in afs_set_call_state()
1457 if (call->state == from) { in afs_set_call_state()
1458 call->state = to; in afs_set_call_state()
1462 spin_unlock_bh(&call->state_lock); in afs_set_call_state()
1472 spin_lock_bh(&call->state_lock); in afs_set_call_complete()
1473 state = call->state; in afs_set_call_complete()
1475 call->abort_code = remote_abort; in afs_set_call_complete()
1476 call->error = error; in afs_set_call_complete()
1477 call->state = AFS_CALL_COMPLETE; in afs_set_call_complete()
1482 spin_unlock_bh(&call->state_lock); in afs_set_call_complete()
1486 /* Asynchronous calls have two refs to release - one from the alloc and in afs_set_call_complete()
1487 * one queued with the work item - and we can't just deallocate the in afs_set_call_complete()
1490 if (call->drop_ref) in afs_set_call_complete()
1529 atomic_inc(&net->servers_outstanding); in afs_inc_servers_outstanding()
1534 if (atomic_dec_and_test(&net->servers_outstanding)) in afs_dec_servers_outstanding()
1535 wake_up_var(&net->servers_outstanding); in afs_dec_servers_outstanding()
1540 return list_empty(&server->probe_link); in afs_is_probing_server()
1548 refcount_inc(&slist->usage); in afs_get_serverlist()
1616 refcount_inc(&vlserver->ref); in afs_get_vlserver()
1623 refcount_inc(&vllist->ref); in afs_get_vlserverlist()
1687 u32 num_cleaned; /* Number of ACEs removed due to subject removal */
1689 #define YFS_ACL_WANT_ACL 0x01 /* Set if caller wants ->acl */
1690 #define YFS_ACL_WANT_VOL_ACL 0x02 /* Set if caller wants ->vol_acl */
1707 return &vnode->netfs.inode; in AFS_VNODE_TO_I()
1711 * Note that a dentry got changed. We need to set d_fsdata to the data version
1719 if (!op->cumul_error.error) in afs_update_dentry_version()
1720 dentry->d_fsdata = in afs_update_dentry_version()
1721 (void *)(unsigned long)dir_vp->scb.status.data_version; in afs_update_dentry_version()
1725 * Set the file size and block count. Estimate the number of 512 bytes blocks
1730 i_size_write(&vnode->netfs.inode, size); in afs_set_i_size()
1731 vnode->netfs.inode.i_blocks = ((size + 1023) >> 10) << 1; in afs_set_i_size()
1742 if (dvp->dv_before + dvp->dv_delta != dvp->scb.status.data_version) in afs_check_dir_conflict()
1743 op->flags |= AFS_OPERATION_DIR_CONFLICT; in afs_check_dir_conflict()
1748 trace_afs_io_error(call->debug_id, -EIO, where); in afs_io_error()
1749 return -EIO; in afs_io_error()
1754 trace_afs_file_error(vnode, -EIO, where); in afs_bad()
1755 return -EIO; in afs_bad()
1759 * Set the callback promise on a vnode.
1764 atomic64_set(&vnode->cb_expires_at, expires_at); in afs_set_cb_promise()
1775 return atomic64_xchg(&vnode->cb_expires_at, AFS_NO_CB_PROMISE) != AFS_NO_CB_PROMISE; in afs_clear_cb_promise()
1784 if (test_and_clear_bit(AFS_VNODE_DIR_VALID, &dvnode->flags)) { in afs_invalidate_dir()
1797 printk("[%-6.6s] "FMT"\n", current->comm ,##__VA_ARGS__)