1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
5 #ifndef LLITE_INTERNAL_H
6 #define LLITE_INTERNAL_H
8 #ifdef CONFIG_FS_POSIX_ACL
11 # include <linux/xattr_acl.h>
13 #ifdef HAVE_LINUX_POSIX_ACL_XATTR_H
14 # include <linux/posix_acl_xattr.h>
18 #include <lustre_debug.h>
19 #include <lustre_ver.h>
20 #include <linux/lustre_version.h>
21 #include <lustre_disk.h> /* for s2sbi */
24 struct lustre_intent_data {
25 __u64 it_lock_handle[2];
31 /* If there is no FMODE_EXEC defined, make it to match nothing */
36 #define LL_IT2STR(it) ((it) ? ldlm_it2str((it)->it_op) : "0")
37 #define LUSTRE_FPRIVATE(file) ((file)->private_data)
39 #ifdef LUSTRE_KERNEL_VERSION
40 static inline struct lookup_intent *ll_nd2it(struct nameidata *nd)
42 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
50 struct ll_dentry_data {
53 struct obd_client_handle lld_cwd_och;
54 struct obd_client_handle lld_mnt_och;
55 #ifndef LUSTRE_KERNEL_VERSION
56 struct lookup_intent *lld_it;
60 #define ll_d2d(de) ((struct ll_dentry_data*) de->d_fsdata)
62 extern struct file_operations ll_pgcache_seq_fops;
64 #define LLI_INODE_MAGIC 0x111d0de5
65 #define LLI_INODE_DEAD 0xdeadd00d
66 #define LLI_F_HAVE_OST_SIZE_LOCK 0
67 #define LLI_F_HAVE_MDS_SIZE_LOCK 1
69 struct ll_inode_info {
71 struct semaphore lli_size_sem;
72 void *lli_size_sem_owner;
73 struct semaphore lli_open_sem;
74 struct semaphore lli_write_sem;
75 struct lov_stripe_md *lli_smd;
76 char *lli_symlink_name;
79 unsigned long lli_flags;
81 /* this lock protects s_d_w and p_w_ll and mmap_cnt */
83 struct list_head lli_pending_write_llaps;
84 int lli_send_done_writing;
85 atomic_t lli_mmap_cnt;
87 struct list_head lli_close_item;
89 /* for writepage() only to communicate to fsync */
92 struct posix_acl *lli_posix_acl;
94 struct list_head lli_dead_list;
96 struct semaphore lli_och_sem; /* Protects access to och pointers
97 and their usage counters */
98 /* We need all three because every inode may be opened in different
100 struct obd_client_handle *lli_mds_read_och;
101 __u64 lli_open_fd_read_count;
102 struct obd_client_handle *lli_mds_write_och;
103 __u64 lli_open_fd_write_count;
104 struct obd_client_handle *lli_mds_exec_och;
105 __u64 lli_open_fd_exec_count;
107 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
108 struct inode lli_vfs_inode;
113 * Locking to guarantee consistency of non-atomic updates to long long i_size,
114 * consistency between file size and KMS, and consistency within
115 * ->lli_smd->lsm_oinfo[]'s.
117 * Implemented by ->lli_size_sem and ->lsm_sem, nested in that order.
120 void ll_inode_size_lock(struct inode *inode, int lock_lsm);
121 void ll_inode_size_unlock(struct inode *inode, int unlock_lsm);
123 // FIXME: replace the name of this with LL_I to conform to kernel stuff
124 // static inline struct ll_inode_info *LL_I(struct inode *inode)
125 static inline struct ll_inode_info *ll_i2info(struct inode *inode)
127 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
128 return container_of(inode, struct ll_inode_info, lli_vfs_inode);
130 return (struct ll_inode_info *)&(inode->u.generic_ip);
134 /* default to about 40meg of readahead on a given system. That much tied
135 * up in 512k readahead requests serviced at 40ms each is about 1GB/s. */
136 #define SBI_DEFAULT_READAHEAD_MAX (40UL << (20 - CFS_PAGE_SHIFT))
138 /* default to read-ahead full files smaller than 2MB on the second read */
139 #define SBI_DEFAULT_READAHEAD_WHOLE_MAX (2UL << (20 - CFS_PAGE_SHIFT))
144 RA_STAT_DISTANT_READPAGE,
145 RA_STAT_MISS_IN_WINDOW,
146 RA_STAT_FAILED_GRAB_PAGE,
147 RA_STAT_FAILED_MATCH,
152 RA_STAT_MAX_IN_FLIGHT,
153 RA_STAT_WRONG_GRAB_PAGE,
158 unsigned long ra_cur_pages;
159 unsigned long ra_max_pages;
160 unsigned long ra_max_read_ahead_whole_pages;
161 unsigned long ra_stats[_NR_RA_STAT];
164 /* LL_HIST_MAX=32 causes an overflow */
165 #define LL_HIST_MAX 28
166 #define LL_HIST_START 12 /* buckets start at 2^12 = 4k */
167 #define LL_PROCESS_HIST_MAX 10
168 struct per_process_info {
170 struct obd_histogram pp_r_hist;
171 struct obd_histogram pp_w_hist;
174 /* pp_extents[LL_PROCESS_HIST_MAX] will hold the combined process info */
175 struct ll_rw_extents_info {
176 struct per_process_info pp_extents[LL_PROCESS_HIST_MAX + 1];
179 #define LL_OFFSET_HIST_MAX 100
180 struct ll_rw_process_info {
183 loff_t rw_range_start;
185 loff_t rw_last_file_pos;
187 size_t rw_smallest_extent;
188 size_t rw_largest_extent;
189 struct file *rw_last_file;
209 VFS_OPS_INODE_PERMISSION,
213 enum vfs_track_type {
214 VFS_TRACK_ALL = 0, /* track all processes */
215 VFS_TRACK_PID, /* track process with this pid */
216 VFS_TRACK_PPID, /* track processes with this ppid */
217 VFS_TRACK_GID, /* track processes with this gid */
221 /* flags for sbi->ll_flags */
222 #define LL_SBI_NOLCK 0x01 /* DLM locking disabled (directio-only) */
223 #define LL_SBI_CHECKSUM 0x02 /* checksum each page as it's written */
224 #define LL_SBI_FLOCK 0x04
225 #define LL_SBI_USER_XATTR 0x08 /* support user xattr */
226 #define LL_SBI_ACL 0x10 /* support ACL */
227 #define LL_SBI_JOIN 0x20 /* support JOIN */
230 struct list_head ll_list;
231 /* this protects pglist and ra_info. It isn't safe to
232 * grab from interrupt contexts */
234 struct obd_uuid ll_sb_uuid;
235 struct obd_export *ll_mdc_exp;
236 struct obd_export *ll_osc_exp;
237 struct proc_dir_entry *ll_proc_root;
238 obd_id ll_rootino; /* number of root inode */
241 struct list_head ll_conn_chain; /* per-conn chain of SBs */
242 struct lustre_client_ocd ll_lco;
244 struct list_head ll_orphan_dentry_list; /*please don't ask -p*/
245 struct ll_close_queue *ll_lcq;
247 struct lprocfs_stats *ll_stats; /* lprocfs stats counter */
249 unsigned long ll_async_page_max;
250 unsigned long ll_async_page_count;
251 unsigned long ll_pglist_gen;
252 struct list_head ll_pglist; /* all pages (llap_pglist_item) */
254 struct ll_ra_info ll_ra_info;
255 unsigned int ll_namelen;
256 struct file_operations *ll_fop;
258 #ifdef HAVE_EXPORT___IGET
259 struct list_head ll_deathrow; /* inodes to be destroyed (b1443) */
260 spinlock_t ll_deathrow_lock;
262 /* =0 - hold lock over whole read/write
263 * >0 - max. chunk to be read/written w/o lock re-acquiring */
264 unsigned long ll_max_rw_chunk;
267 struct ll_rw_extents_info ll_rw_extents_info;
268 int ll_extent_process_count;
269 struct ll_rw_process_info ll_rw_process_info[LL_PROCESS_HIST_MAX];
270 unsigned int ll_offset_process_count;
271 struct ll_rw_process_info ll_rw_offset_info[LL_OFFSET_HIST_MAX];
272 unsigned int ll_rw_offset_entry_count;
273 struct lprocfs_stats *ll_vfs_ops_stats;
274 enum vfs_track_type ll_vfs_track_type;
278 #define LL_DEFAULT_MAX_RW_CHUNK (32 * 1024 * 1024)
283 struct task_struct *lrr_reader;
284 struct list_head lrr_linkage;
288 * per file-descriptor read-ahead data.
290 struct ll_readahead_state {
293 * index of the last page that read(2) needed and that wasn't in the
294 * cache. Used by ras_update() to detect seeks.
296 * XXX nikita: if access seeks into cached region, Lustre doesn't see
299 unsigned long ras_last_readpage;
301 * number of pages read after last read-ahead window reset. As window
302 * is reset on each seek, this is effectively a number of consecutive
303 * accesses. Maybe ->ras_accessed_in_window is better name.
305 * XXX nikita: window is also reset (by ras_update()) when Lustre
306 * believes that memory pressure evicts read-ahead pages. In that
307 * case, it probably doesn't make sense to expand window to
308 * PTLRPC_MAX_BRW_PAGES on the third access.
310 unsigned long ras_consecutive_pages;
312 * number of read requests after the last read-ahead window reset
313 * As window is reset on each seek, this is effectively the number
314 * on consecutive read request and is used to trigger read-ahead.
316 unsigned long ras_consecutive_requests;
318 * Parameters of current read-ahead window. Handled by
319 * ras_update(). On the initial access to the file or after a seek,
320 * window is reset to 0. After 3 consecutive accesses, window is
321 * expanded to PTLRPC_MAX_BRW_PAGES. Afterwards, window is enlarged by
322 * PTLRPC_MAX_BRW_PAGES chunks up to ->ra_max_pages.
324 unsigned long ras_window_start, ras_window_len;
326 * Where next read-ahead should start at. This lies within read-ahead
327 * window. Read-ahead window is read in pieces rather than at once
328 * because: 1. lustre limits total number of pages under read-ahead by
329 * ->ra_max_pages (see ll_ra_count_get()), 2. client cannot read pages
330 * not covered by DLM lock.
332 unsigned long ras_next_readahead;
334 * Total number of ll_file_read requests issued, reads originating
335 * due to mmap are not counted in this total. This value is used to
336 * trigger full file read-ahead after multiple reads to a small file.
338 unsigned long ras_requests;
340 * Page index with respect to the current request, these value
341 * will not be accurate when dealing with reads issued via mmap.
343 unsigned long ras_request_index;
345 * list of struct ll_ra_read's one per read(2) call current in
346 * progress against this file descriptor. Used by read-ahead code,
347 * protected by ->ras_lock.
349 struct list_head ras_read_beads;
352 extern kmem_cache_t *ll_file_data_slab;
353 struct lustre_handle;
354 struct ll_file_data {
355 struct ll_readahead_state fd_ras;
357 struct lustre_handle fd_cwlockh;
358 unsigned long fd_gid;
362 struct lov_stripe_md;
364 extern spinlock_t inode_lock;
366 extern struct proc_dir_entry *proc_lustre_fs_root;
368 static inline struct inode *ll_info2i(struct ll_inode_info *lli)
370 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
371 return &lli->lli_vfs_inode;
373 return list_entry(lli, struct inode, u.generic_ip);
378 struct inode *icbd_parent;
379 struct dentry **icbd_childp;
383 void ll_i2gids(__u32 *suppgids, struct inode *i1,struct inode *i2);
385 #define LLAP_MAGIC 98764321
387 extern kmem_cache_t *ll_async_page_slab;
388 extern size_t ll_async_page_slab_size;
389 struct ll_async_page {
391 /* only trust these if the page lock is providing exclusion */
392 unsigned int llap_write_queued:1,
393 llap_defer_uptodate:1,
398 struct page *llap_page;
399 struct list_head llap_pending_write;
400 struct list_head llap_pglist_item;
401 /* checksum for paranoid I/O debugging */
406 * enumeration of llap_from_page() call-sites. Used to export statistics in
407 * /proc/fs/lustre/llite/fsN/dump_page_cache.
410 LLAP_ORIGIN_UNKNOWN = 0,
411 LLAP_ORIGIN_READPAGE,
412 LLAP_ORIGIN_READAHEAD,
413 LLAP_ORIGIN_COMMIT_WRITE,
414 LLAP_ORIGIN_WRITEPAGE,
415 LLAP_ORIGIN_REMOVEPAGE,
418 extern char *llap_origins[];
420 #ifdef HAVE_REGISTER_CACHE
421 #define ll_register_cache(cache) register_cache(cache)
422 #define ll_unregister_cache(cache) unregister_cache(cache)
424 #define ll_register_cache(cache) do {} while (0)
425 #define ll_unregister_cache(cache) do {} while (0)
428 void ll_ra_read_in(struct file *f, struct ll_ra_read *rar);
429 void ll_ra_read_ex(struct file *f, struct ll_ra_read *rar);
430 struct ll_ra_read *ll_ra_read_get(struct file *f);
432 /* llite/lproc_llite.c */
434 int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
435 struct super_block *sb, char *osc, char *mdc);
436 void lprocfs_unregister_mountpoint(struct ll_sb_info *sbi);
437 void ll_vfs_ops_tally(struct ll_sb_info *sbi, int op);
439 static inline int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
440 struct super_block *sb, char *osc, char *mdc){return 0;}
441 static inline void lprocfs_unregister_mountpoint(struct ll_sb_info *sbi) {}
442 static void ll_vfs_ops_tally(struct ll_sb_info *sbi, int op) {}
447 extern struct file_operations ll_dir_operations;
448 extern struct inode_operations ll_dir_inode_operations;
451 int ll_objects_destroy(struct ptlrpc_request *request, struct inode *dir);
452 struct inode *ll_iget(struct super_block *sb, ino_t hash,
453 struct lustre_md *lic);
454 struct dentry *ll_find_alias(struct inode *, struct dentry *);
455 int ll_mdc_cancel_unused(struct lustre_handle *, struct inode *, int flags,
457 int ll_mdc_blocking_ast(struct ldlm_lock *, struct ldlm_lock_desc *,
458 void *data, int flag);
459 int ll_prepare_mdc_op_data(struct mdc_op_data *,
460 struct inode *i1, struct inode *i2,
461 const char *name, int namelen, int mode);
462 #ifndef LUSTRE_KERNEL_VERSION
463 struct lookup_intent *ll_convert_intent(struct open_intent *oit,
468 int ll_prepare_write(struct file *, struct page *, unsigned from, unsigned to);
469 int ll_commit_write(struct file *, struct page *, unsigned from, unsigned to);
470 int ll_writepage(struct page *page);
471 void ll_inode_fill_obdo(struct inode *inode, int cmd, struct obdo *oa);
472 int ll_ap_completion(void *data, int cmd, struct obdo *oa, int rc);
473 int llap_shrink_cache(struct ll_sb_info *sbi, int shrink_fraction);
474 extern struct cache_definition ll_cache_definition;
475 void ll_removepage(struct page *page);
476 int ll_readpage(struct file *file, struct page *page);
477 struct ll_async_page *llap_from_cookie(void *cookie);
478 struct ll_async_page *llap_cast_private(struct page *page);
479 void ll_readahead_init(struct inode *inode, struct ll_readahead_state *ras);
480 void ll_ra_accounting(struct ll_async_page *llap,struct address_space *mapping);
481 void ll_truncate(struct inode *inode);
482 int ll_sync_page_range(struct inode *, struct address_space *, loff_t, size_t);
485 extern struct file_operations ll_file_operations;
486 extern struct file_operations ll_file_operations_flock;
487 extern struct inode_operations ll_file_inode_operations;
488 extern int ll_inode_revalidate_it(struct dentry *, struct lookup_intent *);
489 extern int ll_have_md_lock(struct inode *inode, __u64 bits);
490 int ll_extent_lock(struct ll_file_data *, struct inode *,
491 struct lov_stripe_md *, int mode, ldlm_policy_data_t *,
492 struct lustre_handle *, int ast_flags);
493 int ll_extent_unlock(struct ll_file_data *, struct inode *,
494 struct lov_stripe_md *, int mode, struct lustre_handle *);
495 int ll_file_open(struct inode *inode, struct file *file);
496 int ll_file_release(struct inode *inode, struct file *file);
497 int ll_lsm_getattr(struct obd_export *, struct lov_stripe_md *, struct obdo *);
498 int ll_glimpse_ioctl(struct ll_sb_info *sbi,
499 struct lov_stripe_md *lsm, lstat_t *st);
500 int ll_glimpse_size(struct inode *inode, int ast_flags);
501 int ll_local_open(struct file *file,
502 struct lookup_intent *it, struct ll_file_data *fd,
503 struct obd_client_handle *och);
504 int ll_release_openhandle(struct dentry *, struct lookup_intent *);
505 int ll_mdc_close(struct obd_export *mdc_exp, struct inode *inode,
507 int ll_mdc_real_close(struct inode *inode, int flags);
508 extern void ll_rw_stats_tally(struct ll_sb_info *sbi, pid_t pid, struct file
509 *file, size_t count, int rw);
510 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
511 int ll_getattr_it(struct vfsmount *mnt, struct dentry *de,
512 struct lookup_intent *it, struct kstat *stat);
513 int ll_getattr(struct vfsmount *mnt, struct dentry *de, struct kstat *stat);
515 struct ll_file_data *ll_file_data_get(void);
516 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
517 int ll_inode_permission(struct inode *inode, int mask, struct nameidata *nd);
519 int ll_inode_permission(struct inode *inode, int mask);
521 int ll_lov_setstripe_ea_info(struct inode *inode, struct file *file,
522 int flags, struct lov_user_md *lum,
524 int ll_lov_getstripe_ea_info(struct inode *inode, const char *filename,
525 struct lov_mds_md **lmm, int *lmm_size,
526 struct ptlrpc_request **request);
527 int ll_dir_setstripe(struct inode *inode, struct lov_user_md *lump);
528 int ll_dir_getstripe(struct inode *inode, struct lov_mds_md **lmm,
529 int *lmm_size, struct ptlrpc_request **request);
532 void ll_intent_drop_lock(struct lookup_intent *);
533 void ll_intent_release(struct lookup_intent *);
534 extern void ll_set_dd(struct dentry *de);
535 int ll_drop_dentry(struct dentry *dentry);
536 void ll_unhash_aliases(struct inode *);
537 void ll_frob_intent(struct lookup_intent **itp, struct lookup_intent *deft);
538 void ll_lookup_finish_locks(struct lookup_intent *it, struct dentry *dentry);
539 int ll_dcompare(struct dentry *parent, struct qstr *d_name, struct qstr *name);
540 int revalidate_it_finish(struct ptlrpc_request *request, int offset,
541 struct lookup_intent *it, struct dentry *de);
543 /* llite/llite_lib.c */
544 extern struct super_operations lustre_super_operations;
546 char *ll_read_opt(const char *opt, char *data);
547 void ll_lli_init(struct ll_inode_info *lli);
548 int ll_fill_super(struct super_block *sb);
549 void ll_put_super(struct super_block *sb);
550 struct inode *ll_inode_from_lock(struct ldlm_lock *lock);
551 void ll_clear_inode(struct inode *inode);
552 int ll_setattr_raw(struct inode *inode, struct iattr *attr);
553 int ll_setattr(struct dentry *de, struct iattr *attr);
554 #ifndef HAVE_STATFS_DENTRY_PARAM
555 int ll_statfs(struct super_block *sb, struct kstatfs *sfs);
557 int ll_statfs(struct dentry *de, struct kstatfs *sfs);
559 int ll_statfs_internal(struct super_block *sb, struct obd_statfs *osfs,
561 void ll_update_inode(struct inode *inode, struct lustre_md *md);
562 void ll_read_inode2(struct inode *inode, void *opaque);
563 int ll_iocontrol(struct inode *inode, struct file *file,
564 unsigned int cmd, unsigned long arg);
565 #ifdef HAVE_UMOUNTBEGIN_VFSMOUNT
566 void ll_umount_begin(struct vfsmount *vfsmnt, int flags);
568 void ll_umount_begin(struct super_block *sb);
570 int ll_remount_fs(struct super_block *sb, int *flags, char *data);
571 int ll_prep_inode(struct obd_export *exp, struct inode **inode,
572 struct ptlrpc_request *req, int offset, struct super_block *);
573 void lustre_dump_dentry(struct dentry *, int recur);
574 void lustre_dump_inode(struct inode *);
575 struct ll_async_page *llite_pglist_next_llap(struct ll_sb_info *sbi,
576 struct list_head *list);
577 int ll_obd_statfs(struct inode *inode, void *arg);
578 int ll_get_max_mdsize(struct ll_sb_info *sbi, int *max_mdsize);
579 int ll_process_config(struct lustre_cfg *lcfg);
581 /* llite/llite_nfs.c */
582 extern struct export_operations lustre_export_operations;
583 __u32 get_uuid2int(const char *name, int len);
584 struct dentry *ll_fh_to_dentry(struct super_block *sb, __u32 *data, int len,
585 int fhtype, int parent);
586 int ll_dentry_to_fh(struct dentry *, __u32 *datap, int *lenp, int need_parent);
588 /* llite/special.c */
589 extern struct inode_operations ll_special_inode_operations;
590 extern struct file_operations ll_special_chr_inode_fops;
591 extern struct file_operations ll_special_chr_file_fops;
592 extern struct file_operations ll_special_blk_inode_fops;
593 extern struct file_operations ll_special_fifo_inode_fops;
594 extern struct file_operations ll_special_fifo_file_fops;
595 extern struct file_operations ll_special_sock_inode_fops;
597 /* llite/symlink.c */
598 extern struct inode_operations ll_fast_symlink_inode_operations;
600 /* llite/llite_close.c */
601 struct ll_close_queue {
603 struct list_head lcq_list;
604 wait_queue_head_t lcq_waitq;
605 struct completion lcq_comp;
608 void llap_write_pending(struct inode *inode, struct ll_async_page *llap);
609 void llap_write_complete(struct inode *inode, struct ll_async_page *llap);
610 void ll_open_complete(struct inode *inode);
611 int ll_is_inode_dirty(struct inode *inode);
612 void ll_try_done_writing(struct inode *inode);
613 void ll_queue_done_writing(struct inode *inode);
614 void ll_close_thread_shutdown(struct ll_close_queue *lcq);
615 int ll_close_thread_start(struct ll_close_queue **lcq_ret);
617 /* llite/llite_mmap.c */
618 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
619 typedef struct rb_root rb_root_t;
620 typedef struct rb_node rb_node_t;
623 struct ll_lock_tree_node;
624 struct ll_lock_tree {
626 struct list_head lt_locked_list;
627 struct ll_file_data *lt_fd;
630 int ll_teardown_mmaps(struct address_space *mapping, __u64 first, __u64 last);
631 int ll_file_mmap(struct file * file, struct vm_area_struct * vma);
632 struct ll_lock_tree_node * ll_node_from_inode(struct inode *inode, __u64 start,
633 __u64 end, ldlm_mode_t mode);
634 int ll_tree_lock(struct ll_lock_tree *tree,
635 struct ll_lock_tree_node *first_node,
636 const char *buf, size_t count, int ast_flags);
637 int ll_tree_unlock(struct ll_lock_tree *tree);
639 #define ll_s2sbi(sb) (s2lsi(sb)->lsi_llsbi)
641 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
642 void __d_rehash(struct dentry * entry, int lock);
643 static inline __u64 ll_ts2u64(struct timespec *time)
645 __u64 t = time->tv_sec;
649 static inline __u64 ll_ts2u64(time_t *time)
655 /* don't need an addref as the sb_info should be holding one */
656 static inline struct obd_export *ll_s2obdexp(struct super_block *sb)
658 return ll_s2sbi(sb)->ll_osc_exp;
661 /* don't need an addref as the sb_info should be holding one */
662 static inline struct obd_export *ll_s2mdcexp(struct super_block *sb)
664 return ll_s2sbi(sb)->ll_mdc_exp;
667 static inline struct client_obd *sbi2mdc(struct ll_sb_info *sbi)
669 struct obd_device *obd = sbi->ll_mdc_exp->exp_obd;
675 // FIXME: replace the name of this with LL_SB to conform to kernel stuff
676 static inline struct ll_sb_info *ll_i2sbi(struct inode *inode)
678 return ll_s2sbi(inode->i_sb);
681 static inline struct obd_export *ll_i2obdexp(struct inode *inode)
683 return ll_s2obdexp(inode->i_sb);
686 static inline struct obd_export *ll_i2mdcexp(struct inode *inode)
688 return ll_s2mdcexp(inode->i_sb);
691 static inline void ll_inode2fid(struct ll_fid *fid, struct inode *inode)
693 mdc_pack_fid(fid, inode->i_ino, inode->i_generation,
694 inode->i_mode & S_IFMT);
697 static inline int ll_mds_max_easize(struct super_block *sb)
699 return sbi2mdc(ll_s2sbi(sb))->cl_max_mds_easize;
702 static inline __u64 ll_file_maxbytes(struct inode *inode)
704 return ll_i2info(inode)->lli_maxbytes;
708 int ll_setxattr(struct dentry *dentry, const char *name,
709 const void *value, size_t size, int flags);
710 ssize_t ll_getxattr(struct dentry *dentry, const char *name,
711 void *buffer, size_t size);
712 ssize_t ll_listxattr(struct dentry *dentry, char *buffer, size_t size);
713 int ll_removexattr(struct dentry *dentry, const char *name);
715 #endif /* LLITE_INTERNAL_H */