fs/smb/client/dfs_cache.h
Source file repositories/reference/linux-study-clean/fs/smb/client/dfs_cache.h
File Facts
- System
- Linux kernel
- Corpus path
fs/smb/client/dfs_cache.h- Extension
.h- Size
- 2982 bytes
- Lines
- 111
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/nls.hlinux/list.hlinux/uuid.hcifsglob.h
Detected Declarations
struct dfs_cache_tgt_liststruct dfs_cache_tgt_iteratorfunction dfs_cache_get_next_tgtfunction dfs_cache_get_tgt_iteratorfunction dfs_cache_free_tgtsfunction dfs_cache_get_tgt_namefunction dfs_cache_get_nr_tgtsfunction dfs_cache_get_ttl
Annotated Snippet
struct dfs_cache_tgt_list {
int tl_numtgts;
struct list_head tl_list;
};
struct dfs_cache_tgt_iterator {
char *it_name;
int it_path_consumed;
struct list_head it_list;
};
int dfs_cache_init(void);
void dfs_cache_destroy(void);
extern const struct proc_ops dfscache_proc_ops;
int dfs_cache_find(const unsigned int xid, struct cifs_ses *ses,
const struct nls_table *cp, int remap, const char *path,
struct dfs_info3_param *ref,
struct dfs_cache_tgt_list *tgt_list);
int dfs_cache_noreq_find(const char *path, struct dfs_info3_param *ref,
struct dfs_cache_tgt_list *tgt_list);
void dfs_cache_noreq_update_tgthint(const char *path,
const struct dfs_cache_tgt_iterator *it);
int dfs_cache_get_tgt_referral(const char *path,
const struct dfs_cache_tgt_iterator *it,
struct dfs_info3_param *ref);
int dfs_cache_get_tgt_share(char *path,
const struct dfs_cache_tgt_iterator *it,
char **share, char **prefix);
char *dfs_cache_canonical_path(const char *path, const struct nls_table *cp,
int remap);
int dfs_cache_remount_fs(struct cifs_sb_info *cifs_sb);
void dfs_cache_refresh(struct work_struct *work);
static inline struct dfs_cache_tgt_iterator *
dfs_cache_get_next_tgt(struct dfs_cache_tgt_list *tl,
struct dfs_cache_tgt_iterator *it)
{
if (!tl || !tl->tl_numtgts || list_empty(&tl->tl_list) ||
!it || list_is_last(&it->it_list, &tl->tl_list))
return NULL;
return list_next_entry(it, it_list);
}
static inline struct dfs_cache_tgt_iterator *
dfs_cache_get_tgt_iterator(struct dfs_cache_tgt_list *tl)
{
if (!tl)
return NULL;
return list_first_entry_or_null(&tl->tl_list,
struct dfs_cache_tgt_iterator,
it_list);
}
static inline void dfs_cache_free_tgts(struct dfs_cache_tgt_list *tl)
{
struct dfs_cache_tgt_iterator *it, *nit;
if (!tl || !tl->tl_numtgts || list_empty(&tl->tl_list))
return;
list_for_each_entry_safe(it, nit, &tl->tl_list, it_list) {
list_del(&it->it_list);
kfree(it->it_name);
kfree(it);
}
tl->tl_numtgts = 0;
}
static inline const char *
dfs_cache_get_tgt_name(const struct dfs_cache_tgt_iterator *it)
{
return it ? it->it_name : NULL;
}
static inline int
dfs_cache_get_nr_tgts(const struct dfs_cache_tgt_list *tl)
{
return tl ? tl->tl_numtgts : 0;
}
static inline int dfs_cache_get_ttl(void)
{
return atomic_read(&dfs_cache_ttl);
}
#endif /* _CIFS_DFS_CACHE_H */
Annotation
- Immediate include surface: `linux/nls.h`, `linux/list.h`, `linux/uuid.h`, `cifsglob.h`.
- Detected declarations: `struct dfs_cache_tgt_list`, `struct dfs_cache_tgt_iterator`, `function dfs_cache_get_next_tgt`, `function dfs_cache_get_tgt_iterator`, `function dfs_cache_free_tgts`, `function dfs_cache_get_tgt_name`, `function dfs_cache_get_nr_tgts`, `function dfs_cache_get_ttl`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.