3 * Copyright (C) 2002, 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
12 #include <linux/compiler.h>
13 #include <linux/kernel.h>
14 #include <linux/ktime.h>
16 #include <linux/pagemap.h>
17 #include <linux/rxrpc.h>
18 #include <linux/key.h>
19 #include <linux/workqueue.h>
20 #include <linux/sched.h>
21 #include <linux/fscache.h>
22 #include <linux/backing-dev.h>
23 #include <linux/uuid.h>
24 #include <linux/mm_types.h>
25 #include <net/net_namespace.h>
26 #include <net/netns/generic.h>
28 #include <net/af_rxrpc.h>
33 #define AFS_CELL_MAX_ADDRS 15
38 struct afs_mount_params
{
39 bool rwpath
; /* T if the parent should be considered R/W */
40 bool force
; /* T to force cell type */
41 bool autocell
; /* T if set auto mount operation */
42 bool dyn_root
; /* T if dynamic root */
43 afs_voltype_t type
; /* type of volume requested */
44 int volnamesz
; /* size of volume name */
45 const char *volname
; /* name of volume to mount */
46 struct net
*net_ns
; /* Network namespace in effect */
47 struct afs_net
*net
; /* the AFS net namespace stuff */
48 struct afs_cell
*cell
; /* cell in which to find volume */
49 struct afs_volume
*volume
; /* volume record */
50 struct key
*key
; /* key to use for secure mounting */
53 struct afs_iget_data
{
55 struct afs_volume
*volume
; /* volume on which resides */
59 AFS_CALL_CL_REQUESTING
, /* Client: Request is being sent */
60 AFS_CALL_CL_AWAIT_REPLY
, /* Client: Awaiting reply */
61 AFS_CALL_CL_PROC_REPLY
, /* Client: rxrpc call complete; processing reply */
62 AFS_CALL_SV_AWAIT_OP_ID
, /* Server: Awaiting op ID */
63 AFS_CALL_SV_AWAIT_REQUEST
, /* Server: Awaiting request data */
64 AFS_CALL_SV_REPLYING
, /* Server: Replying */
65 AFS_CALL_SV_AWAIT_ACK
, /* Server: Awaiting final ACK */
66 AFS_CALL_COMPLETE
, /* Completed or failed */
70 * List of server addresses.
72 struct afs_addr_list
{
73 struct rcu_head rcu
; /* Must be first */
75 u32 version
; /* Version */
76 unsigned char max_addrs
;
77 unsigned char nr_addrs
;
78 unsigned char index
; /* Address currently in use */
79 unsigned char nr_ipv4
; /* Number of IPv4 addresses */
80 unsigned long probed
; /* Mask of servers that have been probed */
81 unsigned long yfs
; /* Mask of servers that are YFS */
82 struct sockaddr_rxrpc addrs
[];
83 #define AFS_MAX_ADDRESSES ((unsigned int)(sizeof(unsigned long) * 8))
87 * a record of an in-progress RxRPC call
90 const struct afs_call_type
*type
; /* type of call */
91 wait_queue_head_t waitq
; /* processes awaiting completion */
92 struct work_struct async_work
; /* async I/O processor */
93 struct work_struct work
; /* actual work processor */
94 struct rxrpc_call
*rxcall
; /* RxRPC call handle */
95 struct key
*key
; /* security for this call */
96 struct afs_net
*net
; /* The network namespace */
97 struct afs_server
*cm_server
; /* Server affected by incoming CM call */
98 struct afs_cb_interest
*cbi
; /* Callback interest for server used */
99 void *request
; /* request data (first part) */
100 struct address_space
*mapping
; /* Pages being written from */
101 struct iov_iter iter
; /* Buffer iterator */
102 struct iov_iter
*_iter
; /* Iterator currently in use */
103 union { /* Convenience for ->iter */
105 struct bio_vec bvec
[1];
107 void *buffer
; /* reply receive buffer */
108 void *reply
[4]; /* Where to put the reply */
109 pgoff_t first
; /* first page in mapping to deal with */
110 pgoff_t last
; /* last page in mapping to deal with */
112 enum afs_call_state state
;
113 spinlock_t state_lock
;
114 int error
; /* error code */
115 u32 abort_code
; /* Remote abort ID or 0 */
116 unsigned request_size
; /* size of request data */
117 unsigned reply_max
; /* maximum size of reply */
118 unsigned first_offset
; /* offset into mapping[first] */
119 unsigned int cb_break
; /* cb_break + cb_s_break before the call */
121 unsigned last_to
; /* amount of mapping[last] */
122 unsigned count2
; /* count used in unmarshalling */
124 unsigned char unmarshall
; /* unmarshalling phase */
125 bool incoming
; /* T if incoming call */
126 bool send_pages
; /* T if data from mapping should be sent */
127 bool need_attention
; /* T if RxRPC poked us */
128 bool async
; /* T if asynchronous */
129 bool ret_reply0
; /* T if should return reply[0] on success */
130 bool upgrade
; /* T to request service upgrade */
131 u16 service_id
; /* Actual service ID (after upgrade) */
132 unsigned int debug_id
; /* Trace ID */
133 u32 operation_ID
; /* operation ID for an incoming call */
134 u32 count
; /* count for use in unmarshalling */
135 union { /* place to extract temporary data */
139 } __attribute__((packed
));
142 afs_dataversion_t expected_version
; /* Updated version expected from store */
143 afs_dataversion_t expected_version_2
; /* 2nd updated version expected from store */
146 struct afs_call_type
{
148 unsigned int op
; /* Really enum afs_fs_operation */
150 /* deliver request or reply data to an call
151 * - returning an error will cause the call to be aborted
153 int (*deliver
)(struct afs_call
*call
);
155 /* clean up a call */
156 void (*destructor
)(struct afs_call
*call
);
159 void (*work
)(struct work_struct
*work
);
163 * Key available for writeback on a file.
168 struct list_head vnode_link
; /* Link in vnode->wb_keys */
172 * AFS open file information record. Pointed to by file->private_data.
175 struct key
*key
; /* The key this file was opened with */
176 struct afs_wb_key
*wb
; /* Writeback key record for this file */
179 static inline struct key
*afs_file_key(struct file
*file
)
181 struct afs_file
*af
= file
->private_data
;
187 * Record of an outstanding read operation on a vnode.
190 loff_t pos
; /* Where to start reading */
191 loff_t len
; /* How much we're asking for */
192 loff_t actual_len
; /* How much we're actually getting */
193 loff_t remain
; /* Amount remaining */
194 loff_t file_size
; /* File size returned by server */
195 afs_dataversion_t data_version
; /* Version number returned by server */
197 unsigned int index
; /* Which page we're reading into */
198 unsigned int nr_pages
;
199 unsigned int offset
; /* offset into current page */
200 void (*page_done
)(struct afs_call
*, struct afs_read
*);
202 struct page
*array
[];
206 * AFS superblock private data
207 * - there's one superblock per volume
209 struct afs_super_info
{
210 struct net
*net_ns
; /* Network namespace */
211 struct afs_cell
*cell
; /* The cell in which the volume resides */
212 struct afs_volume
*volume
; /* volume record */
213 bool dyn_root
; /* True if dynamic root */
216 static inline struct afs_super_info
*AFS_FS_S(struct super_block
*sb
)
218 return sb
->s_fs_info
;
221 extern struct file_system_type afs_fs_type
;
224 * Set of substitutes for @sys.
226 struct afs_sysnames
{
227 #define AFS_NR_SYSNAME 16
228 char *subs
[AFS_NR_SYSNAME
];
235 * AFS network namespace record.
238 struct net
*net
; /* Backpointer to the owning net namespace */
239 struct afs_uuid uuid
;
240 bool live
; /* F if this namespace is being removed */
242 /* AF_RXRPC I/O stuff */
243 struct socket
*socket
;
244 struct afs_call
*spare_incoming_call
;
245 struct work_struct charge_preallocation_work
;
246 struct mutex socket_mutex
;
247 atomic_t nr_outstanding_calls
;
248 atomic_t nr_superblocks
;
251 struct rb_root cells
;
252 struct afs_cell __rcu
*ws_cell
;
253 struct work_struct cells_manager
;
254 struct timer_list cells_timer
;
255 atomic_t cells_outstanding
;
256 seqlock_t cells_lock
;
258 struct mutex proc_cells_lock
;
259 struct hlist_head proc_cells
;
261 /* Known servers. Theoretically each fileserver can only be in one
262 * cell, but in practice, people create aliases and subsets and there's
263 * no easy way to distinguish them.
265 seqlock_t fs_lock
; /* For fs_servers */
266 struct rb_root fs_servers
; /* afs_server (by server UUID or address) */
267 struct list_head fs_updates
; /* afs_server (by update_at) */
268 struct hlist_head fs_proc
; /* procfs servers list */
270 struct hlist_head fs_addresses4
; /* afs_server (by lowest IPv4 addr) */
271 struct hlist_head fs_addresses6
; /* afs_server (by lowest IPv6 addr) */
272 seqlock_t fs_addr_lock
; /* For fs_addresses[46] */
274 struct work_struct fs_manager
;
275 struct timer_list fs_timer
;
276 atomic_t servers_outstanding
;
278 /* File locking renewal management */
279 struct mutex lock_manager_mutex
;
282 struct super_block
*dynroot_sb
; /* Dynamic root mount superblock */
283 struct proc_dir_entry
*proc_afs
; /* /proc/net/afs directory */
284 struct afs_sysnames
*sysnames
;
285 rwlock_t sysnames_lock
;
287 /* Statistics counters */
288 atomic_t n_lookup
; /* Number of lookups done */
289 atomic_t n_reval
; /* Number of dentries needing revalidation */
290 atomic_t n_inval
; /* Number of invalidations by the server */
291 atomic_t n_relpg
; /* Number of invalidations by releasepage */
292 atomic_t n_read_dir
; /* Number of directory pages read */
293 atomic_t n_dir_cr
; /* Number of directory entry creation edits */
294 atomic_t n_dir_rm
; /* Number of directory entry removal edits */
295 atomic_t n_stores
; /* Number of store ops */
296 atomic_long_t n_store_bytes
; /* Number of bytes stored */
297 atomic_long_t n_fetch_bytes
; /* Number of bytes fetched */
298 atomic_t n_fetches
; /* Number of data fetch ops */
301 extern const char afs_init_sysname
[];
303 enum afs_cell_state
{
307 AFS_CELL_DEACTIVATING
,
315 * This is a tricky concept to get right as it is possible to create aliases
316 * simply by pointing AFSDB/SRV records for two names at the same set of VL
317 * servers; it is also possible to do things like setting up two sets of VL
318 * servers, one of which provides a superset of the volumes provided by the
319 * other (for internal/external division, for example).
321 * Cells only exist in the sense that (a) a cell's name maps to a set of VL
322 * servers and (b) a cell's name is used by the client to select the key to use
323 * for authentication and encryption. The cell name is not typically used in
326 * There is no easy way to determine if two cells are aliases or one is a
332 struct rb_node net_node
; /* Node in net->cells */
335 struct key
*anonymous_key
; /* anonymous user key for this cell */
336 struct work_struct manager
; /* Manager for init/deinit/dns */
337 struct hlist_node proc_link
; /* /proc cell list link */
338 #ifdef CONFIG_AFS_FSCACHE
339 struct fscache_cookie
*cache
; /* caching cookie */
341 time64_t dns_expiry
; /* Time AFSDB/SRV record expires */
342 time64_t last_inactive
; /* Time of last drop of usage count */
345 #define AFS_CELL_FL_NOT_READY 0 /* The cell record is not ready for use */
346 #define AFS_CELL_FL_NO_GC 1 /* The cell was added manually, don't auto-gc */
347 #define AFS_CELL_FL_NOT_FOUND 2 /* Permanent DNS error */
348 #define AFS_CELL_FL_DNS_FAIL 3 /* Failed to access DNS */
349 #define AFS_CELL_FL_NO_LOOKUP_YET 4 /* Not completed first DNS lookup yet */
350 enum afs_cell_state state
;
353 /* Active fileserver interaction state. */
354 struct list_head proc_volumes
; /* procfs volume list */
357 /* VL server list. */
358 rwlock_t vl_addrs_lock
; /* Lock on vl_addrs */
359 struct afs_addr_list __rcu
*vl_addrs
; /* List of VL servers */
360 u8 name_len
; /* Length of name */
361 char name
[64 + 1]; /* Cell name, case-flattened and NUL-padded */
367 * This is pointed to by cell->vldb_entries, indexed by name.
369 struct afs_vldb_entry
{
370 afs_volid_t vid
[3]; /* Volume IDs for R/W, R/O and Bak volumes */
373 #define AFS_VLDB_HAS_RW 0 /* - R/W volume exists */
374 #define AFS_VLDB_HAS_RO 1 /* - R/O volume exists */
375 #define AFS_VLDB_HAS_BAK 2 /* - Backup volume exists */
376 #define AFS_VLDB_QUERY_VALID 3 /* - Record is valid */
377 #define AFS_VLDB_QUERY_ERROR 4 /* - VL server returned error */
379 uuid_t fs_server
[AFS_NMAXNSERVERS
];
380 u8 fs_mask
[AFS_NMAXNSERVERS
];
381 #define AFS_VOL_VTM_RW 0x01 /* R/W version of the volume is available (on this server) */
382 #define AFS_VOL_VTM_RO 0x02 /* R/O version of the volume is available (on this server) */
383 #define AFS_VOL_VTM_BAK 0x04 /* backup version of the volume is available (on this server) */
385 u8 nr_servers
; /* Number of server records */
387 u8 name
[AFS_MAXVOLNAME
+ 1]; /* NUL-padded volume name */
391 * Record of fileserver with which we're actively communicating.
396 uuid_t uuid
; /* Server ID */
397 struct afs_uuid _uuid
;
400 struct afs_addr_list __rcu
*addresses
;
401 struct rb_node uuid_rb
; /* Link in net->servers */
402 struct hlist_node addr4_link
; /* Link in net->fs_addresses4 */
403 struct hlist_node addr6_link
; /* Link in net->fs_addresses6 */
404 struct hlist_node proc_link
; /* Link in net->fs_proc */
405 struct afs_server
*gc_next
; /* Next server in manager's list */
406 time64_t put_time
; /* Time at which last put */
407 time64_t update_at
; /* Time at which to next update the record */
409 #define AFS_SERVER_FL_NEW 0 /* New server, don't inc cb_s_break */
410 #define AFS_SERVER_FL_NOT_READY 1 /* The record is not ready for use */
411 #define AFS_SERVER_FL_NOT_FOUND 2 /* VL server says no such server */
412 #define AFS_SERVER_FL_VL_FAIL 3 /* Failed to access VL server */
413 #define AFS_SERVER_FL_UPDATING 4
414 #define AFS_SERVER_FL_PROBED 5 /* The fileserver has been probed */
415 #define AFS_SERVER_FL_PROBING 6 /* Fileserver is being probed */
416 #define AFS_SERVER_FL_NO_IBULK 7 /* Fileserver doesn't support FS.InlineBulkStatus */
417 #define AFS_SERVER_FL_MAY_HAVE_CB 8 /* May have callbacks on this fileserver */
419 u32 addr_version
; /* Address list version */
421 /* file service access */
422 rwlock_t fs_lock
; /* access lock */
424 /* callback promise management */
425 struct hlist_head cb_volumes
; /* List of volume interests on this server */
426 unsigned cb_s_break
; /* Break-everything counter. */
427 rwlock_t cb_break_lock
; /* Volume finding lock */
431 * Volume collation in the server's callback interest list.
433 struct afs_vol_interest
{
434 struct hlist_node srv_link
; /* Link in server->cb_volumes */
435 struct hlist_head cb_interests
; /* List of callback interests on the server */
436 afs_volid_t vid
; /* Volume ID to match */
441 * Interest by a superblock on a server.
443 struct afs_cb_interest
{
444 struct hlist_node cb_vlink
; /* Link in vol_interest->cb_interests */
445 struct afs_vol_interest
*vol_interest
;
446 struct afs_server
*server
; /* Server on which this interest resides */
447 struct super_block
*sb
; /* Superblock on which inodes reside */
448 afs_volid_t vid
; /* Volume ID to match */
453 * Replaceable server list.
455 struct afs_server_entry
{
456 struct afs_server
*server
;
457 struct afs_cb_interest
*cb_interest
;
460 struct afs_server_list
{
462 unsigned short nr_servers
;
463 unsigned short index
; /* Server currently in use */
464 unsigned short vnovol_mask
; /* Servers to be skipped due to VNOVOL */
465 unsigned int seq
; /* Set to ->servers_seq when installed */
467 struct afs_server_entry servers
[];
471 * Live AFS volume management.
474 afs_volid_t vid
; /* volume ID */
476 time64_t update_at
; /* Time at which to next update */
477 struct afs_cell
*cell
; /* Cell to which belongs (pins ref) */
478 struct list_head proc_link
; /* Link in cell->vl_proc */
480 #define AFS_VOLUME_NEEDS_UPDATE 0 /* - T if an update needs performing */
481 #define AFS_VOLUME_UPDATING 1 /* - T if an update is in progress */
482 #define AFS_VOLUME_WAIT 2 /* - T if users must wait for update */
483 #define AFS_VOLUME_DELETED 3 /* - T if volume appears deleted */
484 #define AFS_VOLUME_OFFLINE 4 /* - T if volume offline notice given */
485 #define AFS_VOLUME_BUSY 5 /* - T if volume busy notice given */
486 #ifdef CONFIG_AFS_FSCACHE
487 struct fscache_cookie
*cache
; /* caching cookie */
489 struct afs_server_list
*servers
; /* List of servers on which volume resides */
490 rwlock_t servers_lock
; /* Lock for ->servers */
491 unsigned int servers_seq
; /* Incremented each time ->servers changes */
493 unsigned cb_v_break
; /* Break-everything counter. */
494 rwlock_t cb_break_lock
;
496 afs_voltype_t type
; /* type of volume */
498 char type_force
; /* force volume type (suppress R/O -> R/W) */
500 u8 name
[AFS_MAXVOLNAME
+ 1]; /* NUL-padded volume name */
503 enum afs_lock_state
{
504 AFS_VNODE_LOCK_NONE
, /* The vnode has no lock on the server */
505 AFS_VNODE_LOCK_WAITING_FOR_CB
, /* We're waiting for the server to break the callback */
506 AFS_VNODE_LOCK_SETTING
, /* We're asking the server for a lock */
507 AFS_VNODE_LOCK_GRANTED
, /* We have a lock on the server */
508 AFS_VNODE_LOCK_EXTENDING
, /* We're extending a lock on the server */
509 AFS_VNODE_LOCK_NEED_UNLOCK
, /* We need to unlock on the server */
510 AFS_VNODE_LOCK_UNLOCKING
, /* We're telling the server to unlock */
514 * AFS inode private data.
516 * Note that afs_alloc_inode() *must* reset anything that could incorrectly
517 * leak from one inode to another.
520 struct inode vfs_inode
; /* the VFS's inode record */
522 struct afs_volume
*volume
; /* volume on which vnode resides */
523 struct afs_fid fid
; /* the file identifier for this inode */
524 struct afs_file_status status
; /* AFS status info for this file */
525 afs_dataversion_t invalid_before
; /* Child dentries are invalid before this */
526 #ifdef CONFIG_AFS_FSCACHE
527 struct fscache_cookie
*cache
; /* caching cookie */
529 struct afs_permits __rcu
*permit_cache
; /* cache of permits so far obtained */
530 struct mutex io_lock
; /* Lock for serialising I/O on this mutex */
531 struct rw_semaphore validate_lock
; /* lock for validating this vnode */
532 spinlock_t wb_lock
; /* lock for wb_keys */
533 spinlock_t lock
; /* waitqueue/flags lock */
535 #define AFS_VNODE_CB_PROMISED 0 /* Set if vnode has a callback promise */
536 #define AFS_VNODE_UNSET 1 /* set if vnode attributes not yet set */
537 #define AFS_VNODE_DIR_VALID 2 /* Set if dir contents are valid */
538 #define AFS_VNODE_ZAP_DATA 3 /* set if vnode's data should be invalidated */
539 #define AFS_VNODE_DELETED 4 /* set if vnode deleted on server */
540 #define AFS_VNODE_MOUNTPOINT 5 /* set if vnode is a mountpoint symlink */
541 #define AFS_VNODE_AUTOCELL 6 /* set if Vnode is an auto mount point */
542 #define AFS_VNODE_PSEUDODIR 7 /* set if Vnode is a pseudo directory */
543 #define AFS_VNODE_NEW_CONTENT 8 /* Set if file has new content (create/trunc-0) */
545 struct list_head wb_keys
; /* List of keys available for writeback */
546 struct list_head pending_locks
; /* locks waiting to be granted */
547 struct list_head granted_locks
; /* locks granted on this file */
548 struct delayed_work lock_work
; /* work to be done in locking */
549 struct key
*lock_key
; /* Key to be used in lock ops */
550 enum afs_lock_state lock_state
: 8;
551 afs_lock_type_t lock_type
: 8;
553 /* outstanding callback notification on this file */
554 struct afs_cb_interest
*cb_interest
; /* Server on which this resides */
555 unsigned int cb_s_break
; /* Mass break counter on ->server */
556 unsigned int cb_v_break
; /* Mass break counter on ->volume */
557 unsigned int cb_break
; /* Break counter on vnode */
558 seqlock_t cb_lock
; /* Lock for ->cb_interest, ->status, ->cb_*break */
560 time64_t cb_expires_at
; /* time at which callback expires */
561 unsigned cb_version
; /* callback version */
562 afs_callback_type_t cb_type
; /* type of callback */
565 static inline struct fscache_cookie
*afs_vnode_cache(struct afs_vnode
*vnode
)
567 #ifdef CONFIG_AFS_FSCACHE
575 * cached security record for one user's attempt to access a vnode
578 struct key
*key
; /* RxRPC ticket holding a security context */
579 afs_access_t access
; /* CallerAccess value for this key */
583 * Immutable cache of CallerAccess records from attempts to access vnodes.
584 * These may be shared between multiple vnodes.
588 struct hlist_node hash_node
; /* Link in hash */
589 unsigned long h
; /* Hash value for this permit list */
591 unsigned short nr_permits
; /* Number of records */
592 bool invalidated
; /* Invalidated due to key change */
593 struct afs_permit permits
[]; /* List of permits sorted by key pointer */
597 * record of one of a system's set of network interfaces
599 struct afs_interface
{
600 struct in_addr address
; /* IPv4 address bound to interface */
601 struct in_addr netmask
; /* netmask applied to address */
602 unsigned mtu
; /* MTU of interface */
606 * Cursor for iterating over a server's address list.
608 struct afs_addr_cursor
{
609 struct afs_addr_list
*alist
; /* Current address list (pins ref) */
610 struct sockaddr_rxrpc
*addr
;
612 unsigned short start
; /* Starting point in alist->addrs[] */
613 unsigned short index
; /* Wrapping offset from start to current addr */
615 bool begun
; /* T if we've begun iteration */
616 bool responded
; /* T if the current address responded */
620 * Cursor for iterating over a set of fileservers.
622 struct afs_fs_cursor
{
623 struct afs_addr_cursor ac
;
624 struct afs_vnode
*vnode
;
625 struct afs_server_list
*server_list
; /* Current server list (pins ref) */
626 struct afs_cb_interest
*cbi
; /* Server on which this resides (pins ref) */
627 struct key
*key
; /* Key for the server */
628 unsigned int cb_break
; /* cb_break + cb_s_break before the call */
629 unsigned int cb_break_2
; /* cb_break + cb_s_break (2nd vnode) */
630 unsigned char start
; /* Initial index in server list */
631 unsigned char index
; /* Number of servers tried beyond start */
632 unsigned short flags
;
633 #define AFS_FS_CURSOR_STOP 0x0001 /* Set to cease iteration */
634 #define AFS_FS_CURSOR_VBUSY 0x0002 /* Set if seen VBUSY */
635 #define AFS_FS_CURSOR_VMOVED 0x0004 /* Set if seen VMOVED */
636 #define AFS_FS_CURSOR_VNOVOL 0x0008 /* Set if seen VNOVOL */
637 #define AFS_FS_CURSOR_CUR_ONLY 0x0010 /* Set if current server only (file lock held) */
638 #define AFS_FS_CURSOR_NO_VSLEEP 0x0020 /* Set to prevent sleep on VBUSY, VOFFLINE, ... */
642 * Cache auxiliary data.
644 struct afs_vnode_cache_aux
{
648 #include <trace/events/afs.h>
650 /*****************************************************************************/
654 static inline struct afs_addr_list
*afs_get_addrlist(struct afs_addr_list
*alist
)
657 refcount_inc(&alist
->usage
);
660 extern struct afs_addr_list
*afs_alloc_addrlist(unsigned int,
663 extern void afs_put_addrlist(struct afs_addr_list
*);
664 extern struct afs_addr_list
*afs_parse_text_addrs(const char *, size_t, char,
665 unsigned short, unsigned short);
666 extern struct afs_addr_list
*afs_dns_query(struct afs_cell
*, time64_t
*);
667 extern bool afs_iterate_addresses(struct afs_addr_cursor
*);
668 extern int afs_end_cursor(struct afs_addr_cursor
*);
669 extern int afs_set_vl_cursor(struct afs_addr_cursor
*, struct afs_cell
*);
671 extern void afs_merge_fs_addr4(struct afs_addr_list
*, __be32
, u16
);
672 extern void afs_merge_fs_addr6(struct afs_addr_list
*, __be32
*, u16
);
677 #ifdef CONFIG_AFS_FSCACHE
678 extern struct fscache_netfs afs_cache_netfs
;
679 extern struct fscache_cookie_def afs_cell_cache_index_def
;
680 extern struct fscache_cookie_def afs_volume_cache_index_def
;
681 extern struct fscache_cookie_def afs_vnode_cache_index_def
;
683 #define afs_cell_cache_index_def (*(struct fscache_cookie_def *) NULL)
684 #define afs_volume_cache_index_def (*(struct fscache_cookie_def *) NULL)
685 #define afs_vnode_cache_index_def (*(struct fscache_cookie_def *) NULL)
691 extern void afs_init_callback_state(struct afs_server
*);
692 extern void afs_break_callback(struct afs_vnode
*);
693 extern void afs_break_callbacks(struct afs_server
*, size_t, struct afs_callback_break
*);
695 extern int afs_register_server_cb_interest(struct afs_vnode
*,
696 struct afs_server_list
*, unsigned int);
697 extern void afs_put_cb_interest(struct afs_net
*, struct afs_cb_interest
*);
698 extern void afs_clear_callback_interests(struct afs_net
*, struct afs_server_list
*);
700 static inline struct afs_cb_interest
*afs_get_cb_interest(struct afs_cb_interest
*cbi
)
703 refcount_inc(&cbi
->usage
);
707 static inline unsigned int afs_calc_vnode_cb_break(struct afs_vnode
*vnode
)
709 return vnode
->cb_break
+ vnode
->cb_s_break
+ vnode
->cb_v_break
;
712 static inline unsigned int afs_cb_break_sum(struct afs_vnode
*vnode
,
713 struct afs_cb_interest
*cbi
)
715 return vnode
->cb_break
+ cbi
->server
->cb_s_break
+ vnode
->volume
->cb_v_break
;
721 extern int afs_cell_init(struct afs_net
*, const char *);
722 extern struct afs_cell
*afs_lookup_cell_rcu(struct afs_net
*, const char *, unsigned);
723 extern struct afs_cell
*afs_lookup_cell(struct afs_net
*, const char *, unsigned,
725 extern struct afs_cell
*afs_get_cell(struct afs_cell
*);
726 extern void afs_put_cell(struct afs_net
*, struct afs_cell
*);
727 extern void afs_manage_cells(struct work_struct
*);
728 extern void afs_cells_timer(struct timer_list
*);
729 extern void __net_exit
afs_cell_purge(struct afs_net
*);
734 extern bool afs_cm_incoming_call(struct afs_call
*);
739 extern const struct file_operations afs_dir_file_operations
;
740 extern const struct inode_operations afs_dir_inode_operations
;
741 extern const struct address_space_operations afs_dir_aops
;
742 extern const struct dentry_operations afs_fs_dentry_operations
;
744 extern void afs_d_release(struct dentry
*);
749 extern void afs_edit_dir_add(struct afs_vnode
*, struct qstr
*, struct afs_fid
*,
750 enum afs_edit_dir_reason
);
751 extern void afs_edit_dir_remove(struct afs_vnode
*, struct qstr
*, enum afs_edit_dir_reason
);
756 extern const struct file_operations afs_dynroot_file_operations
;
757 extern const struct inode_operations afs_dynroot_inode_operations
;
758 extern const struct dentry_operations afs_dynroot_dentry_operations
;
760 extern struct inode
*afs_try_auto_mntpt(struct dentry
*, struct inode
*);
761 extern int afs_dynroot_mkdir(struct afs_net
*, struct afs_cell
*);
762 extern void afs_dynroot_rmdir(struct afs_net
*, struct afs_cell
*);
763 extern int afs_dynroot_populate(struct super_block
*);
764 extern void afs_dynroot_depopulate(struct super_block
*);
769 extern const struct address_space_operations afs_fs_aops
;
770 extern const struct inode_operations afs_file_inode_operations
;
771 extern const struct file_operations afs_file_operations
;
773 extern int afs_cache_wb_key(struct afs_vnode
*, struct afs_file
*);
774 extern void afs_put_wb_key(struct afs_wb_key
*);
775 extern int afs_open(struct inode
*, struct file
*);
776 extern int afs_release(struct inode
*, struct file
*);
777 extern int afs_fetch_data(struct afs_vnode
*, struct key
*, struct afs_read
*);
778 extern int afs_page_filler(void *, struct page
*);
779 extern void afs_put_read(struct afs_read
*);
784 extern struct workqueue_struct
*afs_lock_manager
;
786 extern void afs_lock_work(struct work_struct
*);
787 extern void afs_lock_may_be_available(struct afs_vnode
*);
788 extern int afs_lock(struct file
*, int, struct file_lock
*);
789 extern int afs_flock(struct file
*, int, struct file_lock
*);
794 #define AFS_VNODE_NOT_YET_SET 0x01
795 #define AFS_VNODE_META_CHANGED 0x02
796 #define AFS_VNODE_DATA_CHANGED 0x04
797 extern void afs_update_inode_from_status(struct afs_vnode
*, struct afs_file_status
*,
798 const afs_dataversion_t
*, u8
);
800 extern int afs_fs_fetch_file_status(struct afs_fs_cursor
*, struct afs_volsync
*, bool);
801 extern int afs_fs_give_up_callbacks(struct afs_net
*, struct afs_server
*);
802 extern int afs_fs_fetch_data(struct afs_fs_cursor
*, struct afs_read
*);
803 extern int afs_fs_create(struct afs_fs_cursor
*, const char *, umode_t
, u64
,
804 struct afs_fid
*, struct afs_file_status
*, struct afs_callback
*);
805 extern int afs_fs_remove(struct afs_fs_cursor
*, const char *, bool, u64
);
806 extern int afs_fs_link(struct afs_fs_cursor
*, struct afs_vnode
*, const char *, u64
);
807 extern int afs_fs_symlink(struct afs_fs_cursor
*, const char *, const char *, u64
,
808 struct afs_fid
*, struct afs_file_status
*);
809 extern int afs_fs_rename(struct afs_fs_cursor
*, const char *,
810 struct afs_vnode
*, const char *, u64
, u64
);
811 extern int afs_fs_store_data(struct afs_fs_cursor
*, struct address_space
*,
812 pgoff_t
, pgoff_t
, unsigned, unsigned);
813 extern int afs_fs_setattr(struct afs_fs_cursor
*, struct iattr
*);
814 extern int afs_fs_get_volume_status(struct afs_fs_cursor
*, struct afs_volume_status
*);
815 extern int afs_fs_set_lock(struct afs_fs_cursor
*, afs_lock_type_t
);
816 extern int afs_fs_extend_lock(struct afs_fs_cursor
*);
817 extern int afs_fs_release_lock(struct afs_fs_cursor
*);
818 extern int afs_fs_give_up_all_callbacks(struct afs_net
*, struct afs_server
*,
819 struct afs_addr_cursor
*, struct key
*);
820 extern int afs_fs_get_capabilities(struct afs_net
*, struct afs_server
*,
821 struct afs_addr_cursor
*, struct key
*);
822 extern int afs_fs_inline_bulk_status(struct afs_fs_cursor
*, struct afs_net
*,
823 struct afs_fid
*, struct afs_file_status
*,
824 struct afs_callback
*, unsigned int,
825 struct afs_volsync
*);
826 extern int afs_fs_fetch_status(struct afs_fs_cursor
*, struct afs_net
*,
827 struct afs_fid
*, struct afs_file_status
*,
828 struct afs_callback
*, struct afs_volsync
*);
833 extern int afs_fetch_status(struct afs_vnode
*, struct key
*, bool);
834 extern int afs_iget5_test(struct inode
*, void *);
835 extern struct inode
*afs_iget_pseudo_dir(struct super_block
*, bool);
836 extern struct inode
*afs_iget(struct super_block
*, struct key
*,
837 struct afs_fid
*, struct afs_file_status
*,
838 struct afs_callback
*,
839 struct afs_cb_interest
*);
840 extern void afs_zap_data(struct afs_vnode
*);
841 extern int afs_validate(struct afs_vnode
*, struct key
*);
842 extern int afs_getattr(const struct path
*, struct kstat
*, u32
, unsigned int);
843 extern int afs_setattr(struct dentry
*, struct iattr
*);
844 extern void afs_evict_inode(struct inode
*);
845 extern int afs_drop_inode(struct inode
*);
850 extern struct workqueue_struct
*afs_wq
;
851 extern int afs_net_id
;
853 static inline struct afs_net
*afs_net(struct net
*net
)
855 return net_generic(net
, afs_net_id
);
858 static inline struct afs_net
*afs_sb2net(struct super_block
*sb
)
860 return afs_net(AFS_FS_S(sb
)->net_ns
);
863 static inline struct afs_net
*afs_d2net(struct dentry
*dentry
)
865 return afs_sb2net(dentry
->d_sb
);
868 static inline struct afs_net
*afs_i2net(struct inode
*inode
)
870 return afs_sb2net(inode
->i_sb
);
873 static inline struct afs_net
*afs_v2net(struct afs_vnode
*vnode
)
875 return afs_i2net(&vnode
->vfs_inode
);
878 static inline struct afs_net
*afs_sock2net(struct sock
*sk
)
880 return net_generic(sock_net(sk
), afs_net_id
);
883 static inline void __afs_stat(atomic_t
*s
)
888 #define afs_stat_v(vnode, n) __afs_stat(&afs_v2net(vnode)->n)
893 extern int afs_abort_to_error(u32
);
898 extern const struct inode_operations afs_mntpt_inode_operations
;
899 extern const struct inode_operations afs_autocell_inode_operations
;
900 extern const struct file_operations afs_mntpt_file_operations
;
902 extern struct vfsmount
*afs_d_automount(struct path
*);
903 extern void afs_mntpt_kill_timer(void);
908 extern int afs_get_ipv4_interfaces(struct afs_net
*, struct afs_interface
*,
914 #ifdef CONFIG_PROC_FS
915 extern int __net_init
afs_proc_init(struct afs_net
*);
916 extern void __net_exit
afs_proc_cleanup(struct afs_net
*);
917 extern int afs_proc_cell_setup(struct afs_cell
*);
918 extern void afs_proc_cell_remove(struct afs_cell
*);
919 extern void afs_put_sysnames(struct afs_sysnames
*);
921 static inline int afs_proc_init(struct afs_net
*net
) { return 0; }
922 static inline void afs_proc_cleanup(struct afs_net
*net
) {}
923 static inline int afs_proc_cell_setup(struct afs_cell
*cell
) { return 0; }
924 static inline void afs_proc_cell_remove(struct afs_cell
*cell
) {}
925 static inline void afs_put_sysnames(struct afs_sysnames
*sysnames
) {}
931 extern bool afs_begin_vnode_operation(struct afs_fs_cursor
*, struct afs_vnode
*,
933 extern bool afs_select_fileserver(struct afs_fs_cursor
*);
934 extern bool afs_select_current_fileserver(struct afs_fs_cursor
*);
935 extern int afs_end_vnode_operation(struct afs_fs_cursor
*);
940 extern struct workqueue_struct
*afs_async_calls
;
942 extern int __net_init
afs_open_socket(struct afs_net
*);
943 extern void __net_exit
afs_close_socket(struct afs_net
*);
944 extern void afs_charge_preallocation(struct work_struct
*);
945 extern void afs_put_call(struct afs_call
*);
946 extern int afs_queue_call_work(struct afs_call
*);
947 extern long afs_make_call(struct afs_addr_cursor
*, struct afs_call
*, gfp_t
, bool);
948 extern struct afs_call
*afs_alloc_flat_call(struct afs_net
*,
949 const struct afs_call_type
*,
951 extern void afs_flat_call_destructor(struct afs_call
*);
952 extern void afs_send_empty_reply(struct afs_call
*);
953 extern void afs_send_simple_reply(struct afs_call
*, const void *, size_t);
954 extern int afs_extract_data(struct afs_call
*, bool);
955 extern int afs_protocol_error(struct afs_call
*, int, enum afs_eproto_cause
);
957 static inline void afs_extract_begin(struct afs_call
*call
, void *buf
, size_t size
)
959 call
->kvec
[0].iov_base
= buf
;
960 call
->kvec
[0].iov_len
= size
;
961 iov_iter_kvec(&call
->iter
, READ
, call
->kvec
, 1, size
);
964 static inline void afs_extract_to_tmp(struct afs_call
*call
)
966 afs_extract_begin(call
, &call
->tmp
, sizeof(call
->tmp
));
969 static inline void afs_extract_to_tmp64(struct afs_call
*call
)
971 afs_extract_begin(call
, &call
->tmp64
, sizeof(call
->tmp64
));
974 static inline void afs_extract_discard(struct afs_call
*call
, size_t size
)
976 iov_iter_discard(&call
->iter
, READ
, size
);
979 static inline void afs_extract_to_buf(struct afs_call
*call
, size_t size
)
981 afs_extract_begin(call
, call
->buffer
, size
);
984 static inline int afs_transfer_reply(struct afs_call
*call
)
986 return afs_extract_data(call
, false);
989 static inline bool afs_check_call_state(struct afs_call
*call
,
990 enum afs_call_state state
)
992 return READ_ONCE(call
->state
) == state
;
995 static inline bool afs_set_call_state(struct afs_call
*call
,
996 enum afs_call_state from
,
997 enum afs_call_state to
)
1001 spin_lock_bh(&call
->state_lock
);
1002 if (call
->state
== from
) {
1004 trace_afs_call_state(call
, from
, to
, 0, 0);
1007 spin_unlock_bh(&call
->state_lock
);
1011 static inline void afs_set_call_complete(struct afs_call
*call
,
1012 int error
, u32 remote_abort
)
1014 enum afs_call_state state
;
1017 spin_lock_bh(&call
->state_lock
);
1018 state
= call
->state
;
1019 if (state
!= AFS_CALL_COMPLETE
) {
1020 call
->abort_code
= remote_abort
;
1021 call
->error
= error
;
1022 call
->state
= AFS_CALL_COMPLETE
;
1023 trace_afs_call_state(call
, state
, AFS_CALL_COMPLETE
,
1024 error
, remote_abort
);
1027 spin_unlock_bh(&call
->state_lock
);
1029 trace_afs_call_done(call
);
1035 extern void afs_put_permits(struct afs_permits
*);
1036 extern void afs_clear_permits(struct afs_vnode
*);
1037 extern void afs_cache_permit(struct afs_vnode
*, struct key
*, unsigned int);
1038 extern void afs_zap_permits(struct rcu_head
*);
1039 extern struct key
*afs_request_key(struct afs_cell
*);
1040 extern int afs_check_permit(struct afs_vnode
*, struct key
*, afs_access_t
*);
1041 extern int afs_permission(struct inode
*, int);
1042 extern void __exit
afs_clean_up_permit_cache(void);
1047 extern spinlock_t afs_server_peer_lock
;
1049 static inline struct afs_server
*afs_get_server(struct afs_server
*server
)
1051 atomic_inc(&server
->usage
);
1055 extern struct afs_server
*afs_find_server(struct afs_net
*,
1056 const struct sockaddr_rxrpc
*);
1057 extern struct afs_server
*afs_find_server_by_uuid(struct afs_net
*, const uuid_t
*);
1058 extern struct afs_server
*afs_lookup_server(struct afs_cell
*, struct key
*, const uuid_t
*);
1059 extern void afs_put_server(struct afs_net
*, struct afs_server
*);
1060 extern void afs_manage_servers(struct work_struct
*);
1061 extern void afs_servers_timer(struct timer_list
*);
1062 extern void __net_exit
afs_purge_servers(struct afs_net
*);
1063 extern bool afs_probe_fileserver(struct afs_fs_cursor
*);
1064 extern bool afs_check_server_record(struct afs_fs_cursor
*, struct afs_server
*);
1069 static inline struct afs_server_list
*afs_get_serverlist(struct afs_server_list
*slist
)
1071 refcount_inc(&slist
->usage
);
1075 extern void afs_put_serverlist(struct afs_net
*, struct afs_server_list
*);
1076 extern struct afs_server_list
*afs_alloc_server_list(struct afs_cell
*, struct key
*,
1077 struct afs_vldb_entry
*,
1079 extern bool afs_annotate_server_list(struct afs_server_list
*, struct afs_server_list
*);
1084 extern int __init
afs_fs_init(void);
1085 extern void afs_fs_exit(void);
1090 extern struct afs_vldb_entry
*afs_vl_get_entry_by_name_u(struct afs_net
*,
1091 struct afs_addr_cursor
*,
1092 struct key
*, const char *, int);
1093 extern struct afs_addr_list
*afs_vl_get_addrs_u(struct afs_net
*, struct afs_addr_cursor
*,
1094 struct key
*, const uuid_t
*);
1095 extern int afs_vl_get_capabilities(struct afs_net
*, struct afs_addr_cursor
*, struct key
*);
1096 extern struct afs_addr_list
*afs_yfsvl_get_endpoints(struct afs_net
*, struct afs_addr_cursor
*,
1097 struct key
*, const uuid_t
*);
1102 static inline struct afs_volume
*__afs_get_volume(struct afs_volume
*volume
)
1105 atomic_inc(&volume
->usage
);
1109 extern struct afs_volume
*afs_create_volume(struct afs_mount_params
*);
1110 extern void afs_activate_volume(struct afs_volume
*);
1111 extern void afs_deactivate_volume(struct afs_volume
*);
1112 extern void afs_put_volume(struct afs_cell
*, struct afs_volume
*);
1113 extern int afs_check_volume_status(struct afs_volume
*, struct key
*);
1118 extern int afs_set_page_dirty(struct page
*);
1119 extern int afs_write_begin(struct file
*file
, struct address_space
*mapping
,
1120 loff_t pos
, unsigned len
, unsigned flags
,
1121 struct page
**pagep
, void **fsdata
);
1122 extern int afs_write_end(struct file
*file
, struct address_space
*mapping
,
1123 loff_t pos
, unsigned len
, unsigned copied
,
1124 struct page
*page
, void *fsdata
);
1125 extern int afs_writepage(struct page
*, struct writeback_control
*);
1126 extern int afs_writepages(struct address_space
*, struct writeback_control
*);
1127 extern void afs_pages_written_back(struct afs_vnode
*, struct afs_call
*);
1128 extern ssize_t
afs_file_write(struct kiocb
*, struct iov_iter
*);
1129 extern int afs_fsync(struct file
*, loff_t
, loff_t
, int);
1130 extern vm_fault_t
afs_page_mkwrite(struct vm_fault
*vmf
);
1131 extern void afs_prune_wb_keys(struct afs_vnode
*);
1132 extern int afs_launder_page(struct page
*);
1137 extern const struct xattr_handler
*afs_xattr_handlers
[];
1138 extern ssize_t
afs_listxattr(struct dentry
*, char *, size_t);
1142 * Miscellaneous inline functions.
1144 static inline struct afs_vnode
*AFS_FS_I(struct inode
*inode
)
1146 return container_of(inode
, struct afs_vnode
, vfs_inode
);
1149 static inline struct inode
*AFS_VNODE_TO_I(struct afs_vnode
*vnode
)
1151 return &vnode
->vfs_inode
;
1154 static inline void afs_vnode_commit_status(struct afs_fs_cursor
*fc
,
1155 struct afs_vnode
*vnode
,
1156 unsigned int cb_break
)
1158 if (fc
->ac
.error
== 0)
1159 afs_cache_permit(vnode
, fc
->key
, cb_break
);
1162 static inline void afs_check_for_remote_deletion(struct afs_fs_cursor
*fc
,
1163 struct afs_vnode
*vnode
)
1165 if (fc
->ac
.error
== -ENOENT
) {
1166 set_bit(AFS_VNODE_DELETED
, &vnode
->flags
);
1167 afs_break_callback(vnode
);
1172 /*****************************************************************************/
1176 extern unsigned afs_debug
;
1178 #define dbgprintk(FMT,...) \
1179 printk("[%-6.6s] "FMT"\n", current->comm ,##__VA_ARGS__)
1181 #define kenter(FMT,...) dbgprintk("==> %s("FMT")",__func__ ,##__VA_ARGS__)
1182 #define kleave(FMT,...) dbgprintk("<== %s()"FMT"",__func__ ,##__VA_ARGS__)
1183 #define kdebug(FMT,...) dbgprintk(" "FMT ,##__VA_ARGS__)
1186 #if defined(__KDEBUG)
1187 #define _enter(FMT,...) kenter(FMT,##__VA_ARGS__)
1188 #define _leave(FMT,...) kleave(FMT,##__VA_ARGS__)
1189 #define _debug(FMT,...) kdebug(FMT,##__VA_ARGS__)
1191 #elif defined(CONFIG_AFS_DEBUG)
1192 #define AFS_DEBUG_KENTER 0x01
1193 #define AFS_DEBUG_KLEAVE 0x02
1194 #define AFS_DEBUG_KDEBUG 0x04
1196 #define _enter(FMT,...) \
1198 if (unlikely(afs_debug & AFS_DEBUG_KENTER)) \
1199 kenter(FMT,##__VA_ARGS__); \
1202 #define _leave(FMT,...) \
1204 if (unlikely(afs_debug & AFS_DEBUG_KLEAVE)) \
1205 kleave(FMT,##__VA_ARGS__); \
1208 #define _debug(FMT,...) \
1210 if (unlikely(afs_debug & AFS_DEBUG_KDEBUG)) \
1211 kdebug(FMT,##__VA_ARGS__); \
1215 #define _enter(FMT,...) no_printk("==> %s("FMT")",__func__ ,##__VA_ARGS__)
1216 #define _leave(FMT,...) no_printk("<== %s()"FMT"",__func__ ,##__VA_ARGS__)
1217 #define _debug(FMT,...) no_printk(" "FMT ,##__VA_ARGS__)
1221 * debug assertion checking
1223 #if 1 // defined(__KDEBUGALL)
1227 if (unlikely(!(X))) { \
1228 printk(KERN_ERR "\n"); \
1229 printk(KERN_ERR "AFS: Assertion failed\n"); \
1234 #define ASSERTCMP(X, OP, Y) \
1236 if (unlikely(!((X) OP (Y)))) { \
1237 printk(KERN_ERR "\n"); \
1238 printk(KERN_ERR "AFS: Assertion failed\n"); \
1239 printk(KERN_ERR "%lu " #OP " %lu is false\n", \
1240 (unsigned long)(X), (unsigned long)(Y)); \
1241 printk(KERN_ERR "0x%lx " #OP " 0x%lx is false\n", \
1242 (unsigned long)(X), (unsigned long)(Y)); \
1247 #define ASSERTRANGE(L, OP1, N, OP2, H) \
1249 if (unlikely(!((L) OP1 (N)) || !((N) OP2 (H)))) { \
1250 printk(KERN_ERR "\n"); \
1251 printk(KERN_ERR "AFS: Assertion failed\n"); \
1252 printk(KERN_ERR "%lu "#OP1" %lu "#OP2" %lu is false\n", \
1253 (unsigned long)(L), (unsigned long)(N), \
1254 (unsigned long)(H)); \
1255 printk(KERN_ERR "0x%lx "#OP1" 0x%lx "#OP2" 0x%lx is false\n", \
1256 (unsigned long)(L), (unsigned long)(N), \
1257 (unsigned long)(H)); \
1262 #define ASSERTIF(C, X) \
1264 if (unlikely((C) && !(X))) { \
1265 printk(KERN_ERR "\n"); \
1266 printk(KERN_ERR "AFS: Assertion failed\n"); \
1271 #define ASSERTIFCMP(C, X, OP, Y) \
1273 if (unlikely((C) && !((X) OP (Y)))) { \
1274 printk(KERN_ERR "\n"); \
1275 printk(KERN_ERR "AFS: Assertion failed\n"); \
1276 printk(KERN_ERR "%lu " #OP " %lu is false\n", \
1277 (unsigned long)(X), (unsigned long)(Y)); \
1278 printk(KERN_ERR "0x%lx " #OP " 0x%lx is false\n", \
1279 (unsigned long)(X), (unsigned long)(Y)); \
1290 #define ASSERTCMP(X, OP, Y) \
1294 #define ASSERTRANGE(L, OP1, N, OP2, H) \
1298 #define ASSERTIF(C, X) \
1302 #define ASSERTIFCMP(C, X, OP, Y) \
1306 #endif /* __KDEBUGALL */