4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 only,
8 * as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License version 2 for more details (a copy is included
14 * in the LICENSE file that accompanied this code).
16 * You should have received a copy of the GNU General Public License
17 * version 2 along with this program; If not, see
18 * http://www.gnu.org/licenses/gpl-2.0.html
23 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Use is subject to license terms.
26 * Copyright (c) 2011, 2015, Intel Corporation.
29 * This file is part of Lustre, http://www.lustre.org/
30 * Lustre is a trademark of Sun Microsystems, Inc.
33 #ifndef LLITE_INTERNAL_H
34 #define LLITE_INTERNAL_H
35 #include "../include/lustre_debug.h"
36 #include "../include/lustre_ver.h"
37 #include "../include/lustre_disk.h" /* for s2sbi */
38 #include "../include/lustre_eacl.h"
39 #include "../include/lustre_linkea.h"
41 /* for struct cl_lock_descr and struct cl_io */
42 #include "../include/lustre_patchless_compat.h"
43 #include "../include/lustre_compat.h"
44 #include "../include/cl_object.h"
45 #include "../include/lustre_lmv.h"
46 #include "../include/lustre_mdc.h"
47 #include "../include/lustre_intent.h"
48 #include <linux/compat.h>
49 #include <linux/namei.h>
50 #include <linux/xattr.h>
51 #include <linux/posix_acl_xattr.h>
52 #include "vvp_internal.h"
53 #include "range_lock.h"
59 #ifndef VM_FAULT_RETRY
60 #define VM_FAULT_RETRY 0
63 /** Only used on client-side for indicating the tail of dir hash/offset. */
64 #define LL_DIR_END_OFF 0x7fffffffffffffffULL
65 #define LL_DIR_END_OFF_32BIT 0x7fffffffUL
67 /* 4UL * 1024 * 1024 */
68 #define LL_MAX_BLKSIZE_BITS 22
70 #define LL_IT2STR(it) ((it) ? ldlm_it2str((it)->it_op) : "0")
71 #define LUSTRE_FPRIVATE(file) ((file)->private_data)
73 struct ll_dentry_data {
74 struct lookup_intent *lld_it;
75 unsigned int lld_sa_generation;
76 unsigned int lld_invalid:1;
77 unsigned int lld_nfs_dentry:1;
78 struct rcu_head lld_rcu_head;
81 #define ll_d2d(de) ((struct ll_dentry_data *)((de)->d_fsdata))
83 #define LLI_INODE_MAGIC 0x111d0de5
84 #define LLI_INODE_DEAD 0xdeadd00d
86 struct ll_getname_data {
87 struct dir_context ctx;
88 char *lgd_name; /* points to a buffer with NAME_MAX+1 size */
89 struct lu_fid lgd_fid; /* target fid we are looking for */
90 int lgd_found; /* inode matched? */
94 struct lu_env *lg_env;
96 struct cl_lock *lg_lock;
101 /* MDS has an authority for the Size-on-MDS attributes. */
102 LLIF_MDS_SIZE_LOCK = (1 << 0),
103 /* Epoch close is postponed. */
104 LLIF_EPOCH_PENDING = (1 << 1),
105 /* DONE WRITING is allowed. */
106 LLIF_DONE_WRITING = (1 << 2),
107 /* Sizeon-on-MDS attributes are changed. An attribute update needs to
110 LLIF_SOM_DIRTY = (1 << 3),
111 /* File data is modified. */
112 LLIF_DATA_MODIFIED = (1 << 4),
113 /* File is being restored */
114 LLIF_FILE_RESTORING = (1 << 5),
115 /* Xattr cache is attached to the file */
116 LLIF_XATTR_CACHE = (1 << 6),
119 struct ll_inode_info {
120 __u32 lli_inode_magic;
125 struct posix_acl *lli_posix_acl;
127 /* identifying fields for both metadata and data stacks. */
128 struct lu_fid lli_fid;
129 /* master inode fid for stripe directory */
130 struct lu_fid lli_pfid;
132 struct list_head lli_close_list;
134 /* handle is to be sent to MDS later on done_writing and setattr.
135 * Open handle data are needed for the recovery to reconstruct
136 * the inode state on the MDS. XXX: recovery is not ready yet.
138 struct obd_client_handle *lli_pending_och;
140 /* We need all three because every inode may be opened in different
143 struct obd_client_handle *lli_mds_read_och;
144 struct obd_client_handle *lli_mds_write_och;
145 struct obd_client_handle *lli_mds_exec_och;
146 __u64 lli_open_fd_read_count;
147 __u64 lli_open_fd_write_count;
148 __u64 lli_open_fd_exec_count;
149 /* Protects access to och pointers and their usage counters */
150 struct mutex lli_och_mutex;
152 struct inode lli_vfs_inode;
154 /* the most recent timestamps obtained from mds */
158 spinlock_t lli_agl_lock;
160 /* Try to make the d::member and f::member are aligned. Before using
161 * these members, make clear whether it is directory or not.
166 /* serialize normal readdir and statahead-readdir. */
167 struct mutex lli_readdir_mutex;
169 /* metadata statahead */
170 /* since parent-child threads can share the same @file
171 * struct, "opendir_key" is the token when dir close for
172 * case of parent exit before child -- it is me should
173 * cleanup the dir readahead.
175 void *lli_opendir_key;
176 struct ll_statahead_info *lli_sai;
177 /* protect statahead stuff. */
178 spinlock_t lli_sa_lock;
179 /* "opendir_pid" is the token when lookup/revalidate
180 * -- I am the owner of dir statahead.
182 pid_t lli_opendir_pid;
183 /* stat will try to access statahead entries or start
184 * statahead if this flag is set, and this flag will be
185 * set upon dir open, and cleared when dir is closed,
186 * statahead hit ratio is too low, or start statahead
189 unsigned int lli_sa_enabled:1;
190 /* generation for statahead */
191 unsigned int lli_sa_generation;
192 /* directory stripe information */
193 struct lmv_stripe_md *lli_lsm_md;
194 /* striped directory size */
195 loff_t lli_stripe_dir_size;
196 u64 lli_stripe_dir_nlink;
199 /* for non-directory */
201 struct mutex lli_size_mutex;
202 char *lli_symlink_name;
205 * struct rw_semaphore {
206 * signed long count; // align d.d_def_acl
207 * spinlock_t wait_lock; // align d.d_sa_lock
208 * struct list_head wait_list;
211 struct rw_semaphore lli_trunc_sem;
212 struct range_lock_tree lli_write_tree;
214 struct rw_semaphore lli_glimpse_sem;
215 unsigned long lli_glimpse_time;
216 struct list_head lli_agl_list;
219 /* for writepage() only to communicate to fsync */
223 * whenever a process try to read/write the file, the
224 * jobid of the process will be saved here, and it'll
225 * be packed into the write PRC when flush later.
227 * so the read/write statistics for jobid will not be
228 * accurate if the file is shared by different jobs.
230 char lli_jobid[LUSTRE_JOBID_SIZE];
234 /* XXX: For following frequent used members, although they maybe special
235 * used for non-directory object, it is some time-wasting to check
236 * whether the object is directory or not before using them. On the
237 * other hand, currently, sizeof(f) > sizeof(d), it cannot reduce
238 * the "ll_inode_info" size even if moving those members into u.f.
239 * So keep them out side.
241 * In the future, if more members are added only for directory,
242 * some of the following members can be moved into u.f.
245 struct cl_object *lli_clob;
247 /* mutex to request for layout lock exclusively. */
248 struct mutex lli_layout_mutex;
249 /* Layout version, protected by lli_layout_lock */
250 __u32 lli_layout_gen;
251 spinlock_t lli_layout_lock;
253 struct rw_semaphore lli_xattrs_list_rwsem;
254 struct mutex lli_xattrs_enq_lock;
255 struct list_head lli_xattrs;/* ll_xattr_entry->xe_list */
258 static inline __u32 ll_layout_version_get(struct ll_inode_info *lli)
262 spin_lock(&lli->lli_layout_lock);
263 gen = lli->lli_layout_gen;
264 spin_unlock(&lli->lli_layout_lock);
269 static inline void ll_layout_version_set(struct ll_inode_info *lli, __u32 gen)
271 spin_lock(&lli->lli_layout_lock);
272 lli->lli_layout_gen = gen;
273 spin_unlock(&lli->lli_layout_lock);
276 int ll_xattr_cache_destroy(struct inode *inode);
278 int ll_xattr_cache_get(struct inode *inode, const char *name,
279 char *buffer, size_t size, __u64 valid);
282 * Locking to guarantee consistency of non-atomic updates to long long i_size,
283 * consistency between file size and KMS.
285 * Implemented by ->lli_size_mutex and ->lsm_lock, nested in that order.
288 void ll_inode_size_lock(struct inode *inode);
289 void ll_inode_size_unlock(struct inode *inode);
291 /* FIXME: replace the name of this with LL_I to conform to kernel stuff */
292 /* static inline struct ll_inode_info *LL_I(struct inode *inode) */
293 static inline struct ll_inode_info *ll_i2info(struct inode *inode)
295 return container_of(inode, struct ll_inode_info, lli_vfs_inode);
298 /* default to about 40meg of readahead on a given system. That much tied
299 * up in 512k readahead requests serviced at 40ms each is about 1GB/s.
301 #define SBI_DEFAULT_READAHEAD_MAX (40UL << (20 - PAGE_SHIFT))
303 /* default to read-ahead full files smaller than 2MB on the second read */
304 #define SBI_DEFAULT_READAHEAD_WHOLE_MAX (2UL << (20 - PAGE_SHIFT))
309 RA_STAT_DISTANT_READPAGE,
310 RA_STAT_MISS_IN_WINDOW,
311 RA_STAT_FAILED_GRAB_PAGE,
312 RA_STAT_FAILED_MATCH,
317 RA_STAT_MAX_IN_FLIGHT,
318 RA_STAT_WRONG_GRAB_PAGE,
319 RA_STAT_FAILED_REACH_END,
324 atomic_t ra_cur_pages;
325 unsigned long ra_max_pages;
326 unsigned long ra_max_pages_per_file;
327 unsigned long ra_max_read_ahead_whole_pages;
330 /* ra_io_arg will be filled in the beginning of ll_readahead with
331 * ras_lock, then the following ll_read_ahead_pages will read RA
332 * pages according to this arg, all the items in this structure are
333 * counted by page index.
336 unsigned long ria_start; /* start offset of read-ahead*/
337 unsigned long ria_end; /* end offset of read-ahead*/
338 /* If stride read pattern is detected, ria_stoff means where
339 * stride read is started. Note: for normal read-ahead, the
340 * value here is meaningless, and also it will not be accessed
343 /* ria_length and ria_pages are the length and pages length in the
344 * stride I/O mode. And they will also be used to check whether
345 * it is stride I/O read-ahead in the read-ahead pages
347 unsigned long ria_length;
348 unsigned long ria_pages;
351 /* LL_HIST_MAX=32 causes an overflow */
352 #define LL_HIST_MAX 28
353 #define LL_HIST_START 12 /* buckets start at 2^12 = 4k */
354 #define LL_PROCESS_HIST_MAX 10
355 struct per_process_info {
357 struct obd_histogram pp_r_hist;
358 struct obd_histogram pp_w_hist;
361 /* pp_extents[LL_PROCESS_HIST_MAX] will hold the combined process info */
362 struct ll_rw_extents_info {
363 struct per_process_info pp_extents[LL_PROCESS_HIST_MAX + 1];
366 #define LL_OFFSET_HIST_MAX 100
367 struct ll_rw_process_info {
370 loff_t rw_range_start;
372 loff_t rw_last_file_pos;
374 size_t rw_smallest_extent;
375 size_t rw_largest_extent;
376 struct ll_file_data *rw_last_file;
379 enum stats_track_type {
380 STATS_TRACK_ALL = 0, /* track all processes */
381 STATS_TRACK_PID, /* track process with this pid */
382 STATS_TRACK_PPID, /* track processes with this ppid */
383 STATS_TRACK_GID, /* track processes with this gid */
387 /* flags for sbi->ll_flags */
388 #define LL_SBI_NOLCK 0x01 /* DLM locking disabled (directio-only) */
389 #define LL_SBI_CHECKSUM 0x02 /* checksum each page as it's written */
390 #define LL_SBI_FLOCK 0x04
391 #define LL_SBI_USER_XATTR 0x08 /* support user xattr */
392 #define LL_SBI_ACL 0x10 /* support ACL */
393 /* LL_SBI_RMT_CLIENT 0x40 remote client */
394 #define LL_SBI_MDS_CAPA 0x80 /* support mds capa, obsolete */
395 #define LL_SBI_OSS_CAPA 0x100 /* support oss capa, obsolete */
396 #define LL_SBI_LOCALFLOCK 0x200 /* Local flocks support by kernel */
397 #define LL_SBI_LRU_RESIZE 0x400 /* lru resize support */
398 #define LL_SBI_LAZYSTATFS 0x800 /* lazystatfs mount option */
399 #define LL_SBI_SOM_PREVIEW 0x1000 /* SOM preview mount option */
400 #define LL_SBI_32BIT_API 0x2000 /* generate 32 bit inodes. */
401 #define LL_SBI_64BIT_HASH 0x4000 /* support 64-bits dir hash/offset */
402 #define LL_SBI_AGL_ENABLED 0x8000 /* enable agl */
403 #define LL_SBI_VERBOSE 0x10000 /* verbose mount/umount */
404 #define LL_SBI_LAYOUT_LOCK 0x20000 /* layout lock support */
405 #define LL_SBI_USER_FID2PATH 0x40000 /* allow fid2path by unprivileged users */
406 #define LL_SBI_XATTR_CACHE 0x80000 /* support for xattr cache */
407 #define LL_SBI_NOROOTSQUASH 0x100000 /* do not apply root squash */
409 #define LL_SBI_FLAGS { \
434 * This is embedded into llite super-blocks to keep track of connect
435 * flags (capabilities) supported by all imports given mount is
438 struct lustre_client_ocd {
440 * This is conjunction of connect_flags across all imports
441 * (LOVs) this mount is connected to. This field is updated by
442 * cl_ocd_update() under ->lco_lock.
445 struct mutex lco_lock;
446 struct obd_export *lco_md_exp;
447 struct obd_export *lco_dt_exp;
451 /* this protects pglist and ra_info. It isn't safe to
452 * grab from interrupt contexts
455 spinlock_t ll_pp_extent_lock; /* pp_extent entry*/
456 spinlock_t ll_process_lock; /* ll_rw_process_info */
457 struct obd_uuid ll_sb_uuid;
458 struct obd_export *ll_md_exp;
459 struct obd_export *ll_dt_exp;
460 struct dentry *ll_debugfs_entry;
461 struct lu_fid ll_root_fid; /* root object fid */
464 unsigned int ll_umounting:1,
465 ll_xattr_cache_enabled:1;
466 struct lustre_client_ocd ll_lco;
468 struct ll_close_queue *ll_lcq;
470 struct lprocfs_stats *ll_stats; /* lprocfs stats counter */
473 * Used to track "unstable" pages on a client, and maintain a
474 * LRU list of clean pages. An "unstable" page is defined as
475 * any page which is sent to a server as part of a bulk request,
476 * but is uncommitted to stable storage.
478 struct cl_client_cache *ll_cache;
480 struct lprocfs_stats *ll_ra_stats;
482 struct ll_ra_info ll_ra_info;
483 unsigned int ll_namelen;
484 struct file_operations *ll_fop;
486 unsigned int ll_md_brw_pages; /* readdir pages per RPC */
488 struct lu_site *ll_site;
489 struct cl_device *ll_cl;
491 struct ll_rw_extents_info ll_rw_extents_info;
492 int ll_extent_process_count;
493 struct ll_rw_process_info ll_rw_process_info[LL_PROCESS_HIST_MAX];
494 unsigned int ll_offset_process_count;
495 struct ll_rw_process_info ll_rw_offset_info[LL_OFFSET_HIST_MAX];
496 unsigned int ll_rw_offset_entry_count;
497 int ll_stats_track_id;
498 enum stats_track_type ll_stats_track_type;
501 /* metadata stat-ahead */
502 unsigned int ll_sa_max; /* max statahead RPCs */
503 atomic_t ll_sa_total; /* statahead thread started
506 atomic_t ll_sa_wrong; /* statahead thread stopped for
509 atomic_t ll_sa_running; /* running statahead thread
512 atomic_t ll_agl_total; /* AGL thread started count */
514 dev_t ll_sdev_orig; /* save s_dev before assign for
518 struct root_squash_info ll_squash;
520 __kernel_fsid_t ll_fsid;
521 struct kobject ll_kobj; /* sysfs object */
522 struct super_block *ll_sb; /* struct super_block (for sysfs code)*/
523 struct completion ll_kobj_unregister;
527 * per file-descriptor read-ahead data.
529 struct ll_readahead_state {
532 * index of the last page that read(2) needed and that wasn't in the
533 * cache. Used by ras_update() to detect seeks.
535 * XXX nikita: if access seeks into cached region, Lustre doesn't see
538 unsigned long ras_last_readpage;
540 * number of pages read after last read-ahead window reset. As window
541 * is reset on each seek, this is effectively a number of consecutive
542 * accesses. Maybe ->ras_accessed_in_window is better name.
544 * XXX nikita: window is also reset (by ras_update()) when Lustre
545 * believes that memory pressure evicts read-ahead pages. In that
546 * case, it probably doesn't make sense to expand window to
547 * PTLRPC_MAX_BRW_PAGES on the third access.
549 unsigned long ras_consecutive_pages;
551 * number of read requests after the last read-ahead window reset
552 * As window is reset on each seek, this is effectively the number
553 * on consecutive read request and is used to trigger read-ahead.
555 unsigned long ras_consecutive_requests;
557 * Parameters of current read-ahead window. Handled by
558 * ras_update(). On the initial access to the file or after a seek,
559 * window is reset to 0. After 3 consecutive accesses, window is
560 * expanded to PTLRPC_MAX_BRW_PAGES. Afterwards, window is enlarged by
561 * PTLRPC_MAX_BRW_PAGES chunks up to ->ra_max_pages.
563 unsigned long ras_window_start, ras_window_len;
565 * Where next read-ahead should start at. This lies within read-ahead
566 * window. Read-ahead window is read in pieces rather than at once
567 * because: 1. lustre limits total number of pages under read-ahead by
568 * ->ra_max_pages (see ll_ra_count_get()), 2. client cannot read pages
569 * not covered by DLM lock.
571 unsigned long ras_next_readahead;
573 * Total number of ll_file_read requests issued, reads originating
574 * due to mmap are not counted in this total. This value is used to
575 * trigger full file read-ahead after multiple reads to a small file.
577 unsigned long ras_requests;
579 * Page index with respect to the current request, these value
580 * will not be accurate when dealing with reads issued via mmap.
582 unsigned long ras_request_index;
584 * The following 3 items are used for detecting the stride I/O
586 * In stride I/O mode,
587 * ...............|-----data-----|****gap*****|--------|******|....
588 * offset |-stride_pages-|-stride_gap-|
589 * ras_stride_offset = offset;
590 * ras_stride_length = stride_pages + stride_gap;
591 * ras_stride_pages = stride_pages;
592 * Note: all these three items are counted by pages.
594 unsigned long ras_stride_length;
595 unsigned long ras_stride_pages;
596 pgoff_t ras_stride_offset;
598 * number of consecutive stride request count, and it is similar as
599 * ras_consecutive_requests, but used for stride I/O mode.
600 * Note: only more than 2 consecutive stride request are detected,
601 * stride read-ahead will be enable
603 unsigned long ras_consecutive_stride_requests;
606 extern struct kmem_cache *ll_file_data_slab;
607 struct lustre_handle;
608 struct ll_file_data {
609 struct ll_readahead_state fd_ras;
610 struct ll_grouplock fd_grouplock;
614 /* openhandle if lease exists for this file.
615 * Borrow lli->lli_och_mutex to protect assignment
617 struct obd_client_handle *fd_lease_och;
618 struct obd_client_handle *fd_och;
619 struct file *fd_file;
620 /* Indicate whether need to report failure when close.
621 * true: failure is known, not report again.
622 * false: unknown failure, should report.
624 bool fd_write_failed;
625 rwlock_t fd_lock; /* protect lcc list */
626 struct list_head fd_lccs; /* list of ll_cl_context */
629 struct lov_stripe_md;
631 extern struct dentry *llite_root;
632 extern struct kset *llite_kset;
634 static inline struct inode *ll_info2i(struct ll_inode_info *lli)
636 return &lli->lli_vfs_inode;
639 __u32 ll_i2suppgid(struct inode *i);
640 void ll_i2gids(__u32 *suppgids, struct inode *i1, struct inode *i2);
642 static inline int ll_need_32bit_api(struct ll_sb_info *sbi)
644 #if BITS_PER_LONG == 32
646 #elif defined(CONFIG_COMPAT)
647 return unlikely(in_compat_syscall() || (sbi->ll_flags & LL_SBI_32BIT_API));
649 return unlikely(sbi->ll_flags & LL_SBI_32BIT_API);
653 void ll_ras_enter(struct file *f);
655 /* llite/lcommon_misc.c */
656 int cl_init_ea_size(struct obd_export *md_exp, struct obd_export *dt_exp);
657 int cl_ocd_update(struct obd_device *host,
658 struct obd_device *watched,
659 enum obd_notify_event ev, void *owner, void *data);
660 int cl_get_grouplock(struct cl_object *obj, unsigned long gid, int nonblock,
661 struct ll_grouplock *cg);
662 void cl_put_grouplock(struct ll_grouplock *cg);
664 /* llite/lproc_llite.c */
665 int ldebugfs_register_mountpoint(struct dentry *parent,
666 struct super_block *sb, char *osc, char *mdc);
667 void ldebugfs_unregister_mountpoint(struct ll_sb_info *sbi);
668 void ll_stats_ops_tally(struct ll_sb_info *sbi, int op, int count);
669 void lprocfs_llite_init_vars(struct lprocfs_static_vars *lvars);
670 void ll_rw_stats_tally(struct ll_sb_info *sbi, pid_t pid,
671 struct ll_file_data *file, loff_t pos,
672 size_t count, int rw);
676 LPROC_LL_DIRTY_MISSES,
678 LPROC_LL_WRITE_BYTES,
703 LPROC_LL_ALLOC_INODE,
706 LPROC_LL_GETXATTR_HITS,
708 LPROC_LL_REMOVEXATTR,
710 LPROC_LL_FILE_OPCODES
714 extern const struct file_operations ll_dir_operations;
715 extern const struct inode_operations ll_dir_inode_operations;
716 int ll_dir_read(struct inode *inode, __u64 *ppos, struct md_op_data *op_data,
717 struct dir_context *ctx);
718 int ll_get_mdt_idx(struct inode *inode);
719 int ll_get_mdt_idx_by_fid(struct ll_sb_info *sbi, const struct lu_fid *fid);
720 struct page *ll_get_dir_page(struct inode *dir, struct md_op_data *op_data,
722 void ll_release_page(struct inode *inode, struct page *page, bool remove);
725 extern const struct inode_operations ll_special_inode_operations;
727 struct inode *ll_iget(struct super_block *sb, ino_t hash,
728 struct lustre_md *lic);
729 int ll_test_inode_by_fid(struct inode *inode, void *opaque);
730 int ll_md_blocking_ast(struct ldlm_lock *, struct ldlm_lock_desc *,
731 void *data, int flag);
732 struct dentry *ll_splice_alias(struct inode *inode, struct dentry *de);
733 void ll_update_times(struct ptlrpc_request *request, struct inode *inode);
736 int ll_writepage(struct page *page, struct writeback_control *wbc);
737 int ll_writepages(struct address_space *, struct writeback_control *wbc);
738 int ll_readpage(struct file *file, struct page *page);
739 void ll_readahead_init(struct inode *inode, struct ll_readahead_state *ras);
740 int ll_readahead(const struct lu_env *env, struct cl_io *io,
741 struct cl_page_list *queue, struct ll_readahead_state *ras,
743 struct ll_cl_context *ll_cl_find(struct file *file);
744 void ll_cl_add(struct file *file, const struct lu_env *env, struct cl_io *io);
745 void ll_cl_remove(struct file *file, const struct lu_env *env);
747 extern const struct address_space_operations ll_aops;
750 extern struct file_operations ll_file_operations;
751 extern struct file_operations ll_file_operations_flock;
752 extern struct file_operations ll_file_operations_noflock;
753 extern const struct inode_operations ll_file_inode_operations;
754 int ll_have_md_lock(struct inode *inode, __u64 *bits,
755 enum ldlm_mode l_req_mode);
756 enum ldlm_mode ll_take_md_lock(struct inode *inode, __u64 bits,
757 struct lustre_handle *lockh, __u64 flags,
758 enum ldlm_mode mode);
759 int ll_file_open(struct inode *inode, struct file *file);
760 int ll_file_release(struct inode *inode, struct file *file);
761 int ll_glimpse_ioctl(struct ll_sb_info *sbi,
762 struct lov_stripe_md *lsm, lstat_t *st);
763 void ll_ioepoch_open(struct ll_inode_info *lli, __u64 ioepoch);
764 int ll_release_openhandle(struct inode *, struct lookup_intent *);
765 int ll_md_real_close(struct inode *inode, fmode_t fmode);
766 void ll_ioepoch_close(struct inode *inode, struct md_op_data *op_data,
767 struct obd_client_handle **och, unsigned long flags);
768 void ll_done_writing_attr(struct inode *inode, struct md_op_data *op_data);
769 int ll_som_update(struct inode *inode, struct md_op_data *op_data);
770 int ll_inode_getattr(struct inode *inode, struct obdo *obdo,
771 __u64 ioepoch, int sync);
772 void ll_pack_inode2opdata(struct inode *inode, struct md_op_data *op_data,
773 struct lustre_handle *fh);
774 int ll_getattr(struct vfsmount *mnt, struct dentry *de, struct kstat *stat);
775 struct posix_acl *ll_get_acl(struct inode *inode, int type);
776 int ll_migrate(struct inode *parent, struct file *file, int mdtidx,
777 const char *name, int namelen);
778 int ll_get_fid_by_name(struct inode *parent, const char *name,
779 int namelen, struct lu_fid *fid);
780 int ll_inode_permission(struct inode *inode, int mask);
782 int ll_lov_setstripe_ea_info(struct inode *inode, struct dentry *dentry,
783 __u64 flags, struct lov_user_md *lum,
785 int ll_lov_getstripe_ea_info(struct inode *inode, const char *filename,
786 struct lov_mds_md **lmm, int *lmm_size,
787 struct ptlrpc_request **request);
788 int ll_dir_setstripe(struct inode *inode, struct lov_user_md *lump,
790 int ll_dir_getstripe(struct inode *inode, void **lmmp, int *lmm_size,
791 struct ptlrpc_request **request, u64 valid);
792 int ll_fsync(struct file *file, loff_t start, loff_t end, int data);
793 int ll_merge_attr(const struct lu_env *env, struct inode *inode);
794 int ll_fid2path(struct inode *inode, void __user *arg);
795 int ll_data_version(struct inode *inode, __u64 *data_version, int flags);
796 int ll_hsm_release(struct inode *inode);
800 int ll_d_init(struct dentry *de);
801 extern const struct dentry_operations ll_d_ops;
802 void ll_intent_drop_lock(struct lookup_intent *);
803 void ll_intent_release(struct lookup_intent *);
804 void ll_invalidate_aliases(struct inode *);
805 void ll_lookup_finish_locks(struct lookup_intent *it, struct inode *inode);
806 int ll_revalidate_it_finish(struct ptlrpc_request *request,
807 struct lookup_intent *it, struct inode *inode);
809 /* llite/llite_lib.c */
810 extern struct super_operations lustre_super_operations;
812 void ll_lli_init(struct ll_inode_info *lli);
813 int ll_fill_super(struct super_block *sb, struct vfsmount *mnt);
814 void ll_put_super(struct super_block *sb);
815 void ll_kill_super(struct super_block *sb);
816 struct inode *ll_inode_from_resource_lock(struct ldlm_lock *lock);
817 void ll_clear_inode(struct inode *inode);
818 int ll_setattr_raw(struct dentry *dentry, struct iattr *attr, bool hsm_import);
819 int ll_setattr(struct dentry *de, struct iattr *attr);
820 int ll_statfs(struct dentry *de, struct kstatfs *sfs);
821 int ll_statfs_internal(struct super_block *sb, struct obd_statfs *osfs,
822 __u64 max_age, __u32 flags);
823 int ll_update_inode(struct inode *inode, struct lustre_md *md);
824 int ll_read_inode2(struct inode *inode, void *opaque);
825 void ll_delete_inode(struct inode *inode);
826 int ll_iocontrol(struct inode *inode, struct file *file,
827 unsigned int cmd, unsigned long arg);
828 int ll_flush_ctx(struct inode *inode);
829 void ll_umount_begin(struct super_block *sb);
830 int ll_remount_fs(struct super_block *sb, int *flags, char *data);
831 int ll_show_options(struct seq_file *seq, struct dentry *dentry);
832 void ll_dirty_page_discard_warn(struct page *page, int ioret);
833 int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req,
834 struct super_block *, struct lookup_intent *);
835 int ll_obd_statfs(struct inode *inode, void __user *arg);
836 int ll_get_max_mdsize(struct ll_sb_info *sbi, int *max_mdsize);
837 int ll_get_default_mdsize(struct ll_sb_info *sbi, int *default_mdsize);
838 int ll_process_config(struct lustre_cfg *lcfg);
841 LUSTRE_OPC_MKDIR = 0,
842 LUSTRE_OPC_SYMLINK = 1,
843 LUSTRE_OPC_MKNOD = 2,
844 LUSTRE_OPC_CREATE = 3,
848 struct md_op_data *ll_prep_md_op_data(struct md_op_data *op_data,
849 struct inode *i1, struct inode *i2,
850 const char *name, size_t namelen,
851 u32 mode, __u32 opc, void *data);
852 void ll_finish_md_op_data(struct md_op_data *op_data);
853 int ll_get_obd_name(struct inode *inode, unsigned int cmd, unsigned long arg);
854 char *ll_get_fsname(struct super_block *sb, char *buf, int buflen);
855 void ll_compute_rootsquash_state(struct ll_sb_info *sbi);
856 void ll_open_cleanup(struct super_block *sb, struct ptlrpc_request *open_req);
857 ssize_t ll_copy_user_md(const struct lov_user_md __user *md,
858 struct lov_user_md **kbuf);
860 /* Compute expected user md size when passing in a md from user space */
861 static inline ssize_t ll_lov_user_md_size(const struct lov_user_md *lum)
863 switch (lum->lmm_magic) {
864 case LOV_USER_MAGIC_V1:
865 return sizeof(struct lov_user_md_v1);
866 case LOV_USER_MAGIC_V3:
867 return sizeof(struct lov_user_md_v3);
868 case LOV_USER_MAGIC_SPECIFIC:
869 if (lum->lmm_stripe_count > LOV_MAX_STRIPE_COUNT)
872 return lov_user_md_size(lum->lmm_stripe_count,
873 LOV_USER_MAGIC_SPECIFIC);
878 /* llite/llite_nfs.c */
879 extern const struct export_operations lustre_export_operations;
880 __u32 get_uuid2int(const char *name, int len);
881 void get_uuid2fsid(const char *name, int len, __kernel_fsid_t *fsid);
882 struct inode *search_inode_for_lustre(struct super_block *sb,
883 const struct lu_fid *fid);
884 int ll_dir_get_parent_fid(struct inode *dir, struct lu_fid *parent_fid);
886 /* llite/symlink.c */
887 extern const struct inode_operations ll_fast_symlink_inode_operations;
889 /* llite/llite_close.c */
890 struct ll_close_queue {
892 struct list_head lcq_head;
893 wait_queue_head_t lcq_waitq;
894 struct completion lcq_comp;
898 void vvp_write_pending(struct vvp_object *club, struct vvp_page *page);
899 void vvp_write_complete(struct vvp_object *club, struct vvp_page *page);
902 * IO arguments for various VFS I/O interfaces.
906 enum vvp_io_subtype via_io_subtype;
910 struct kiocb *via_iocb;
911 struct iov_iter *via_iter;
914 struct pipe_inode_info *via_pipe;
915 unsigned int via_flags;
920 struct ll_cl_context {
921 struct list_head lcc_list;
923 const struct lu_env *lcc_env;
924 struct cl_io *lcc_io;
925 struct cl_page *lcc_page;
928 struct ll_thread_info {
929 struct vvp_io_args lti_args;
930 struct ra_io_arg lti_ria;
931 struct ll_cl_context lti_io_ctx;
934 extern struct lu_context_key ll_thread_key;
935 static inline struct ll_thread_info *ll_env_info(const struct lu_env *env)
937 struct ll_thread_info *lti;
939 lti = lu_context_key_get(&env->le_ctx, &ll_thread_key);
944 static inline struct vvp_io_args *ll_env_args(const struct lu_env *env,
945 enum vvp_io_subtype type)
947 struct vvp_io_args *via = &ll_env_info(env)->lti_args;
949 via->via_io_subtype = type;
954 void ll_queue_done_writing(struct inode *inode, unsigned long flags);
955 void ll_close_thread_shutdown(struct ll_close_queue *lcq);
956 int ll_close_thread_start(struct ll_close_queue **lcq_ret);
958 /* llite/llite_mmap.c */
960 int ll_teardown_mmaps(struct address_space *mapping, __u64 first, __u64 last);
961 int ll_file_mmap(struct file *file, struct vm_area_struct *vma);
962 void policy_from_vma(ldlm_policy_data_t *policy, struct vm_area_struct *vma,
963 unsigned long addr, size_t count);
964 struct vm_area_struct *our_vma(struct mm_struct *mm, unsigned long addr,
967 static inline void ll_invalidate_page(struct page *vmpage)
969 struct address_space *mapping = vmpage->mapping;
970 loff_t offset = vmpage->index << PAGE_SHIFT;
972 LASSERT(PageLocked(vmpage));
977 * truncate_complete_page() calls
978 * a_ops->invalidatepage()->cl_page_delete()->vvp_page_delete().
980 ll_teardown_mmaps(mapping, offset, offset + PAGE_SIZE);
981 truncate_complete_page(mapping, vmpage);
984 #define ll_s2sbi(sb) (s2lsi(sb)->lsi_llsbi)
986 /* don't need an addref as the sb_info should be holding one */
987 static inline struct obd_export *ll_s2dtexp(struct super_block *sb)
989 return ll_s2sbi(sb)->ll_dt_exp;
992 /* don't need an addref as the sb_info should be holding one */
993 static inline struct obd_export *ll_s2mdexp(struct super_block *sb)
995 return ll_s2sbi(sb)->ll_md_exp;
998 static inline struct client_obd *sbi2mdc(struct ll_sb_info *sbi)
1000 struct obd_device *obd = sbi->ll_md_exp->exp_obd;
1007 /* FIXME: replace the name of this with LL_SB to conform to kernel stuff */
1008 static inline struct ll_sb_info *ll_i2sbi(struct inode *inode)
1010 return ll_s2sbi(inode->i_sb);
1013 static inline struct obd_export *ll_i2dtexp(struct inode *inode)
1015 return ll_s2dtexp(inode->i_sb);
1018 static inline struct obd_export *ll_i2mdexp(struct inode *inode)
1020 return ll_s2mdexp(inode->i_sb);
1023 static inline struct lu_fid *ll_inode2fid(struct inode *inode)
1028 fid = &ll_i2info(inode)->lli_fid;
1033 static inline __u64 ll_file_maxbytes(struct inode *inode)
1035 return ll_i2info(inode)->lli_maxbytes;
1039 extern const struct xattr_handler *ll_xattr_handlers[];
1041 #define XATTR_USER_T 1
1042 #define XATTR_TRUSTED_T 2
1043 #define XATTR_SECURITY_T 3
1044 #define XATTR_ACL_ACCESS_T 4
1045 #define XATTR_ACL_DEFAULT_T 5
1046 #define XATTR_LUSTRE_T 6
1047 #define XATTR_OTHER_T 7
1049 ssize_t ll_listxattr(struct dentry *dentry, char *buffer, size_t size);
1050 int ll_xattr_list(struct inode *inode, const char *name, int type,
1051 void *buffer, size_t size, __u64 valid);
1054 * Common IO arguments for various VFS I/O interfaces.
1056 int cl_sb_init(struct super_block *sb);
1057 int cl_sb_fini(struct super_block *sb);
1058 void ll_io_init(struct cl_io *io, const struct file *file, int write);
1060 void ras_update(struct ll_sb_info *sbi, struct inode *inode,
1061 struct ll_readahead_state *ras, unsigned long index,
1063 void ll_ra_count_put(struct ll_sb_info *sbi, unsigned long len);
1064 void ll_ra_stats_inc(struct inode *inode, enum ra_stat which);
1067 #define LL_SA_RPC_MIN 2
1068 #define LL_SA_RPC_DEF 32
1069 #define LL_SA_RPC_MAX 8192
1071 #define LL_SA_CACHE_BIT 5
1072 #define LL_SA_CACHE_SIZE (1 << LL_SA_CACHE_BIT)
1073 #define LL_SA_CACHE_MASK (LL_SA_CACHE_SIZE - 1)
1075 /* per inode struct, for dir only */
1076 struct ll_statahead_info {
1077 struct dentry *sai_dentry;
1078 atomic_t sai_refcount; /* when access this struct, hold
1081 unsigned int sai_max; /* max ahead of lookup */
1082 __u64 sai_sent; /* stat requests sent count */
1083 __u64 sai_replied; /* stat requests which received
1086 __u64 sai_index; /* index of statahead entry */
1087 __u64 sai_index_wait; /* index of entry which is the
1088 * caller is waiting for
1090 __u64 sai_hit; /* hit count */
1091 __u64 sai_miss; /* miss count:
1092 * for "ls -al" case, it includes
1093 * hidden dentry miss;
1094 * for "ls -l" case, it does not
1095 * include hidden dentry miss.
1096 * "sai_miss_hidden" is used for
1099 unsigned int sai_consecutive_miss; /* consecutive miss */
1100 unsigned int sai_miss_hidden;/* "ls -al", but first dentry
1101 * is not a hidden one
1103 unsigned int sai_skip_hidden;/* skipped hidden dentry count */
1104 unsigned int sai_ls_all:1, /* "ls -al", do stat-ahead for
1107 sai_agl_valid:1,/* AGL is valid for the dir */
1108 sai_in_readpage:1;/* statahead is in readdir() */
1109 wait_queue_head_t sai_waitq; /* stat-ahead wait queue */
1110 struct ptlrpc_thread sai_thread; /* stat-ahead thread */
1111 struct ptlrpc_thread sai_agl_thread; /* AGL thread */
1112 struct list_head sai_interim_entries; /* entries which got async
1113 * stat reply, but not
1116 struct list_head sai_entries; /* completed entries */
1117 struct list_head sai_agls; /* AGLs to be sent */
1118 struct list_head sai_cache[LL_SA_CACHE_SIZE];
1119 spinlock_t sai_cache_lock[LL_SA_CACHE_SIZE];
1120 atomic_t sai_cache_count; /* entry count in cache */
1123 int ll_statahead(struct inode *dir, struct dentry **dentry, bool unplug);
1124 void ll_authorize_statahead(struct inode *dir, void *key);
1125 void ll_deauthorize_statahead(struct inode *dir, void *key);
1127 blkcnt_t dirty_cnt(struct inode *inode);
1129 int cl_glimpse_size0(struct inode *inode, int agl);
1130 int cl_glimpse_lock(const struct lu_env *env, struct cl_io *io,
1131 struct inode *inode, struct cl_object *clob, int agl);
1133 static inline int cl_glimpse_size(struct inode *inode)
1135 return cl_glimpse_size0(inode, 0);
1138 static inline int cl_agl(struct inode *inode)
1140 return cl_glimpse_size0(inode, 1);
1143 static inline int ll_glimpse_size(struct inode *inode)
1145 struct ll_inode_info *lli = ll_i2info(inode);
1148 down_read(&lli->lli_glimpse_sem);
1149 rc = cl_glimpse_size(inode);
1150 lli->lli_glimpse_time = cfs_time_current();
1151 up_read(&lli->lli_glimpse_sem);
1156 * dentry may statahead when statahead is enabled and current process has opened
1157 * parent directory, and this dentry hasn't accessed statahead cache before
1160 dentry_may_statahead(struct inode *dir, struct dentry *dentry)
1162 struct ll_inode_info *lli;
1163 struct ll_dentry_data *ldd;
1165 if (ll_i2sbi(dir)->ll_sa_max == 0)
1168 lli = ll_i2info(dir);
1171 * statahead is not allowed for this dir, there may be three causes:
1172 * 1. dir is not opened.
1173 * 2. statahead hit ratio is too low.
1174 * 3. previous stat started statahead thread failed.
1176 if (!lli->lli_sa_enabled)
1179 /* not the same process, don't statahead */
1180 if (lli->lli_opendir_pid != current_pid())
1184 * When stating a dentry, kernel may trigger 'revalidate' or 'lookup'
1185 * multiple times, eg. for 'getattr', 'getxattr' and etc.
1186 * For patchless client, lookup intent is not accurate, which may
1187 * misguide statahead. For example:
1188 * The 'revalidate' call for 'getattr' and 'getxattr' of a dentry will
1189 * have the same intent -- IT_GETATTR, while one dentry should access
1190 * statahead cache once, otherwise statahead windows is messed up.
1191 * The solution is as following:
1192 * Assign 'lld_sa_generation' with 'lli_sa_generation' when a dentry
1193 * IT_GETATTR for the first time, and subsequent IT_GETATTR will
1194 * bypass interacting with statahead cache by checking
1195 * 'lld_sa_generation == lli->lli_sa_generation'.
1197 ldd = ll_d2d(dentry);
1198 if (ldd && ldd->lld_sa_generation == lli->lli_sa_generation)
1204 /* llite ioctl register support routine */
1210 #define LLIOC_MAX_CMD 256
1213 * Rules to write a callback function:
1216 * @magic: Dynamic ioctl call routine will feed this value with the pointer
1217 * returned to ll_iocontrol_register. Callback functions should use this
1218 * data to check the potential collasion of ioctl cmd. If collasion is
1219 * found, callback function should return LLIOC_CONT.
1220 * @rcp: The result of ioctl command.
1223 * If @magic matches the pointer returned by ll_iocontrol_data, the
1224 * callback should return LLIOC_STOP; return LLIOC_STOP otherwise.
1226 typedef enum llioc_iter (*llioc_callback_t)(struct inode *inode,
1227 struct file *file, unsigned int cmd, unsigned long arg,
1228 void *magic, int *rcp);
1230 /* export functions */
1231 /* Register ioctl block dynamatically for a regular file.
1233 * @cmd: the array of ioctl command set
1234 * @count: number of commands in the @cmd
1235 * @cb: callback function, it will be called if an ioctl command is found to
1236 * belong to the command list @cmd.
1239 * A magic pointer will be returned if success;
1240 * otherwise, NULL will be returned.
1242 void *ll_iocontrol_register(llioc_callback_t cb, int count, unsigned int *cmd);
1243 void ll_iocontrol_unregister(void *magic);
1245 int cl_sync_file_range(struct inode *inode, loff_t start, loff_t end,
1246 enum cl_fsync_mode mode, int ignore_layout);
1248 /** direct write pages */
1249 struct ll_dio_pages {
1250 /** page array to be written. we don't support
1251 * partial pages except the last one.
1253 struct page **ldp_pages;
1254 /* offset of each page */
1255 loff_t *ldp_offsets;
1256 /** if ldp_offsets is NULL, it means a sequential
1257 * pages to be written, then this is the file offset
1258 * of the first page.
1260 loff_t ldp_start_offset;
1261 /** how many bytes are to be written. */
1263 /** # of pages in the array. */
1267 static inline void cl_stats_tally(struct cl_device *dev, enum cl_req_type crt,
1270 int opc = (crt == CRT_READ) ? LPROC_LL_OSC_READ :
1273 ll_stats_ops_tally(ll_s2sbi(cl2vvp_dev(dev)->vdv_sb), opc, rc);
1276 ssize_t ll_direct_rw_pages(const struct lu_env *env, struct cl_io *io,
1277 int rw, struct inode *inode,
1278 struct ll_dio_pages *pv);
1280 static inline int ll_file_nolock(const struct file *file)
1282 struct ll_file_data *fd = LUSTRE_FPRIVATE(file);
1283 struct inode *inode = file_inode(file);
1285 return ((fd->fd_flags & LL_FILE_IGNORE_LOCK) ||
1286 (ll_i2sbi(inode)->ll_flags & LL_SBI_NOLCK));
1289 static inline void ll_set_lock_data(struct obd_export *exp, struct inode *inode,
1290 struct lookup_intent *it, __u64 *bits)
1292 if (!it->it_lock_set) {
1293 struct lustre_handle handle;
1295 /* If this inode is a remote object, it will get two
1296 * separate locks in different namespaces, Master MDT,
1297 * where the name entry is, will grant LOOKUP lock,
1298 * remote MDT, where the object is, will grant
1299 * UPDATE|PERM lock. The inode will be attached to both
1300 * LOOKUP and PERM locks, so revoking either locks will
1301 * case the dcache being cleared
1303 if (it->it_remote_lock_mode) {
1304 handle.cookie = it->it_remote_lock_handle;
1305 CDEBUG(D_DLMTRACE, "setting l_data to inode "DFID"%p for remote lock %#llx\n",
1306 PFID(ll_inode2fid(inode)), inode,
1308 md_set_lock_data(exp, &handle, inode, NULL);
1311 handle.cookie = it->it_lock_handle;
1313 CDEBUG(D_DLMTRACE, "setting l_data to inode "DFID"%p for lock %#llx\n",
1314 PFID(ll_inode2fid(inode)), inode, handle.cookie);
1316 md_set_lock_data(exp, &handle, inode, &it->it_lock_bits);
1317 it->it_lock_set = 1;
1321 *bits = it->it_lock_bits;
1324 static inline int d_lustre_invalid(const struct dentry *dentry)
1326 struct ll_dentry_data *lld = ll_d2d(dentry);
1328 return !lld || lld->lld_invalid;
1331 static inline void __d_lustre_invalidate(struct dentry *dentry)
1333 struct ll_dentry_data *lld = ll_d2d(dentry);
1336 lld->lld_invalid = 1;
1340 * Mark dentry INVALID, if dentry refcount is zero (this is normally case for
1341 * ll_md_blocking_ast), unhash this dentry, and let dcache to reclaim it later;
1342 * else dput() of the last refcount will unhash this dentry and kill it.
1344 static inline void d_lustre_invalidate(struct dentry *dentry, int nested)
1346 CDEBUG(D_DENTRY, "invalidate dentry %pd (%p) parent %p inode %p refc %d\n",
1348 dentry->d_parent, d_inode(dentry), d_count(dentry));
1350 spin_lock_nested(&dentry->d_lock,
1351 nested ? DENTRY_D_LOCK_NESTED : DENTRY_D_LOCK_NORMAL);
1352 __d_lustre_invalidate(dentry);
1354 * We should be careful about dentries created by d_obtain_alias().
1355 * These dentries are not put in the dentry tree, instead they are
1356 * linked to sb->s_anon through dentry->d_hash.
1357 * shrink_dcache_for_umount() shrinks the tree and sb->s_anon list.
1358 * If we unhashed such a dentry, unmount would not be able to find
1359 * it and busy inodes would be reported.
1361 if (d_count(dentry) == 0 && !(dentry->d_flags & DCACHE_DISCONNECTED))
1363 spin_unlock(&dentry->d_lock);
1366 static inline void d_lustre_revalidate(struct dentry *dentry)
1368 spin_lock(&dentry->d_lock);
1369 LASSERT(ll_d2d(dentry));
1370 ll_d2d(dentry)->lld_invalid = 0;
1371 spin_unlock(&dentry->d_lock);
1375 LL_LAYOUT_GEN_NONE = ((__u32)-2), /* layout lock was cancelled */
1376 LL_LAYOUT_GEN_EMPTY = ((__u32)-1) /* for empty layout */
1379 int ll_layout_conf(struct inode *inode, const struct cl_object_conf *conf);
1380 int ll_layout_refresh(struct inode *inode, __u32 *gen);
1381 int ll_layout_restore(struct inode *inode, loff_t start, __u64 length);
1383 int ll_xattr_init(void);
1384 void ll_xattr_fini(void);
1386 int ll_page_sync_io(const struct lu_env *env, struct cl_io *io,
1387 struct cl_page *page, enum cl_req_type crt);
1389 int ll_getparent(struct file *file, struct getparent __user *arg);
1392 int cl_setattr_ost(struct inode *inode, const struct iattr *attr);
1394 extern struct lu_env *cl_inode_fini_env;
1395 extern int cl_inode_fini_refcheck;
1397 int cl_file_inode_init(struct inode *inode, struct lustre_md *md);
1398 void cl_inode_fini(struct inode *inode);
1399 int cl_local_size(struct inode *inode);
1401 __u64 cl_fid_build_ino(const struct lu_fid *fid, int api32);
1402 __u32 cl_fid_build_gen(const struct lu_fid *fid);
1404 #endif /* LLITE_INTERNAL_H */