1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37#ifndef LLITE_INTERNAL_H
38#define LLITE_INTERNAL_H
39#include <lustre_debug.h>
40#include <lustre_ver.h>
41#include <lustre_disk.h>
42#include <lustre_eacl.h>
43
44
45#include <cl_object.h>
46#include <lclient.h>
47#include <lustre_mdc.h>
48#include <linux/lustre_intent.h>
49
50#ifndef FMODE_EXEC
51#define FMODE_EXEC 0
52#endif
53
54#ifndef VM_FAULT_RETRY
55#define VM_FAULT_RETRY 0
56#endif
57
58
59
60#ifndef LOOKUP_CONTINUE
61#define LOOKUP_CONTINUE LOOKUP_PARENT
62#endif
63
64
65#define LL_DIR_END_OFF 0x7fffffffffffffffULL
66#define LL_DIR_END_OFF_32BIT 0x7fffffffUL
67
68#define LL_IT2STR(it) ((it) ? ldlm_it2str((it)->it_op) : "0")
69#define LUSTRE_FPRIVATE(file) ((file)->private_data)
70
71struct ll_dentry_data {
72 int lld_cwd_count;
73 int lld_mnt_count;
74 struct obd_client_handle lld_cwd_och;
75 struct obd_client_handle lld_mnt_och;
76 struct lookup_intent *lld_it;
77 unsigned int lld_sa_generation;
78 unsigned int lld_invalid:1;
79 struct rcu_head lld_rcu_head;
80};
81
82#define ll_d2d(de) ((struct ll_dentry_data*)((de)->d_fsdata))
83
84extern struct file_operations ll_pgcache_seq_fops;
85
86#define LLI_INODE_MAGIC 0x111d0de5
87#define LLI_INODE_DEAD 0xdeadd00d
88
89
90#define REMOTE_PERM_HASHSIZE 16
91
92struct ll_getname_data {
93 struct dir_context ctx;
94 char *lgd_name;
95 struct lu_fid lgd_fid;
96 int lgd_found;
97};
98
99
100struct ll_remote_perm {
101 struct hlist_node lrp_list;
102 uid_t lrp_uid;
103 gid_t lrp_gid;
104 uid_t lrp_fsuid;
105 gid_t lrp_fsgid;
106 int lrp_access_perm;
107
108
109};
110
111enum lli_flags {
112
113 LLIF_MDS_SIZE_LOCK = (1 << 0),
114
115 LLIF_EPOCH_PENDING = (1 << 1),
116
117 LLIF_DONE_WRITING = (1 << 2),
118
119
120 LLIF_SOM_DIRTY = (1 << 3),
121
122 LLIF_CONTENDED = (1 << 4),
123
124 LLIF_SRVLOCK = (1 << 5),
125
126 LLIF_DATA_MODIFIED = (1 << 6),
127};
128
129struct ll_inode_info {
130 __u32 lli_inode_magic;
131 __u32 lli_flags;
132 __u64 lli_ioepoch;
133
134 spinlock_t lli_lock;
135 struct posix_acl *lli_posix_acl;
136
137 struct hlist_head *lli_remote_perms;
138 struct mutex lli_rmtperm_mutex;
139
140
141 struct lu_fid lli_fid;
142
143
144 struct lu_fid lli_pfid;
145
146 struct list_head lli_close_list;
147 struct list_head lli_oss_capas;
148
149
150 atomic_t lli_open_count;
151 struct obd_capa *lli_mds_capa;
152 cfs_time_t lli_rmtperm_time;
153
154
155
156
157 struct obd_client_handle *lli_pending_och;
158
159
160
161 struct obd_client_handle *lli_mds_read_och;
162 struct obd_client_handle *lli_mds_write_och;
163 struct obd_client_handle *lli_mds_exec_och;
164 __u64 lli_open_fd_read_count;
165 __u64 lli_open_fd_write_count;
166 __u64 lli_open_fd_exec_count;
167
168 struct mutex lli_och_mutex;
169
170 struct inode lli_vfs_inode;
171
172
173 struct ost_lvb lli_lvb;
174 spinlock_t lli_agl_lock;
175
176
177
178 union {
179
180 struct {
181
182 struct mutex d_readdir_mutex;
183
184
185
186
187
188
189 void *d_opendir_key;
190 struct ll_statahead_info *d_sai;
191 struct posix_acl *d_def_acl;
192
193 spinlock_t d_sa_lock;
194
195
196 pid_t d_opendir_pid;
197 } d;
198
199#define lli_readdir_mutex u.d.d_readdir_mutex
200#define lli_opendir_key u.d.d_opendir_key
201#define lli_sai u.d.d_sai
202#define lli_def_acl u.d.d_def_acl
203#define lli_sa_lock u.d.d_sa_lock
204#define lli_opendir_pid u.d.d_opendir_pid
205
206
207 struct {
208 struct semaphore f_size_sem;
209 void *f_size_sem_owner;
210 char *f_symlink_name;
211 __u64 f_maxbytes;
212
213
214
215
216
217
218
219 struct rw_semaphore f_trunc_sem;
220 struct mutex f_write_mutex;
221
222 struct rw_semaphore f_glimpse_sem;
223 cfs_time_t f_glimpse_time;
224 struct list_head f_agl_list;
225 __u64 f_agl_index;
226
227
228 int f_async_rc;
229
230
231
232
233
234 bool f_volatile;
235
236
237
238
239
240
241
242
243 char f_jobid[JOBSTATS_JOBID_SIZE];
244 } f;
245
246#define lli_size_sem u.f.f_size_sem
247#define lli_size_sem_owner u.f.f_size_sem_owner
248#define lli_symlink_name u.f.f_symlink_name
249#define lli_maxbytes u.f.f_maxbytes
250#define lli_trunc_sem u.f.f_trunc_sem
251#define lli_write_mutex u.f.f_write_mutex
252#define lli_glimpse_sem u.f.f_glimpse_sem
253#define lli_glimpse_time u.f.f_glimpse_time
254#define lli_agl_list u.f.f_agl_list
255#define lli_agl_index u.f.f_agl_index
256#define lli_async_rc u.f.f_async_rc
257#define lli_jobid u.f.f_jobid
258#define lli_volatile u.f.f_volatile
259
260 } u;
261
262
263
264
265
266
267
268
269
270
271
272 bool lli_has_smd;
273 struct cl_object *lli_clob;
274
275
276 struct mutex lli_layout_mutex;
277
278 __u32 lli_layout_gen;
279};
280
281
282
283
284
285
286
287
288void ll_inode_size_lock(struct inode *inode);
289void ll_inode_size_unlock(struct inode *inode);
290
291
292
293static inline struct ll_inode_info *ll_i2info(struct inode *inode)
294{
295 return container_of(inode, struct ll_inode_info, lli_vfs_inode);
296}
297
298
299
300#define SBI_DEFAULT_READAHEAD_MAX (40UL << (20 - PAGE_CACHE_SHIFT))
301
302
303#define SBI_DEFAULT_READAHEAD_WHOLE_MAX (2UL << (20 - PAGE_CACHE_SHIFT))
304
305enum ra_stat {
306 RA_STAT_HIT = 0,
307 RA_STAT_MISS,
308 RA_STAT_DISTANT_READPAGE,
309 RA_STAT_MISS_IN_WINDOW,
310 RA_STAT_FAILED_GRAB_PAGE,
311 RA_STAT_FAILED_MATCH,
312 RA_STAT_DISCARDED,
313 RA_STAT_ZERO_LEN,
314 RA_STAT_ZERO_WINDOW,
315 RA_STAT_EOF,
316 RA_STAT_MAX_IN_FLIGHT,
317 RA_STAT_WRONG_GRAB_PAGE,
318 _NR_RA_STAT,
319};
320
321struct ll_ra_info {
322 atomic_t ra_cur_pages;
323 unsigned long ra_max_pages;
324 unsigned long ra_max_pages_per_file;
325 unsigned long ra_max_read_ahead_whole_pages;
326};
327
328
329
330
331
332
333struct ra_io_arg {
334 unsigned long ria_start;
335 unsigned long ria_end;
336
337
338
339 pgoff_t ria_stoff;
340
341
342
343 unsigned long ria_length;
344 unsigned long ria_pages;
345};
346
347
348#define LL_HIST_MAX 28
349#define LL_HIST_START 12
350#define LL_PROCESS_HIST_MAX 10
351struct per_process_info {
352 pid_t pid;
353 struct obd_histogram pp_r_hist;
354 struct obd_histogram pp_w_hist;
355};
356
357
358struct ll_rw_extents_info {
359 struct per_process_info pp_extents[LL_PROCESS_HIST_MAX + 1];
360};
361
362#define LL_OFFSET_HIST_MAX 100
363struct ll_rw_process_info {
364 pid_t rw_pid;
365 int rw_op;
366 loff_t rw_range_start;
367 loff_t rw_range_end;
368 loff_t rw_last_file_pos;
369 loff_t rw_offset;
370 size_t rw_smallest_extent;
371 size_t rw_largest_extent;
372 struct ll_file_data *rw_last_file;
373};
374
375enum stats_track_type {
376 STATS_TRACK_ALL = 0,
377 STATS_TRACK_PID,
378 STATS_TRACK_PPID,
379 STATS_TRACK_GID,
380 STATS_TRACK_LAST,
381};
382
383
384#define LL_SBI_NOLCK 0x01
385#define LL_SBI_CHECKSUM 0x02
386#define LL_SBI_FLOCK 0x04
387#define LL_SBI_USER_XATTR 0x08
388#define LL_SBI_ACL 0x10
389#define LL_SBI_RMT_CLIENT 0x40
390#define LL_SBI_MDS_CAPA 0x80
391#define LL_SBI_OSS_CAPA 0x100
392#define LL_SBI_LOCALFLOCK 0x200
393#define LL_SBI_LRU_RESIZE 0x400
394#define LL_SBI_LAZYSTATFS 0x800
395#define LL_SBI_SOM_PREVIEW 0x1000
396#define LL_SBI_32BIT_API 0x2000
397#define LL_SBI_64BIT_HASH 0x4000
398#define LL_SBI_AGL_ENABLED 0x8000
399#define LL_SBI_VERBOSE 0x10000
400#define LL_SBI_LAYOUT_LOCK 0x20000
401#define LL_SBI_USER_FID2PATH 0x40000
402
403#define LL_SBI_FLAGS { \
404 "nolck", \
405 "checksum", \
406 "flock", \
407 "xattr", \
408 "acl", \
409 "rmt_client", \
410 "mds_capa", \
411 "oss_capa", \
412 "flock", \
413 "lru_resize", \
414 "lazy_statfs", \
415 "som", \
416 "32bit_api", \
417 "64bit_hash", \
418 "agl", \
419 "verbose", \
420 "layout", \
421 "user_fid2path" }
422
423
424#define SBI_DEFAULT_CONTENTION_SECONDS 60
425
426#define SBI_DEFAULT_LOCKLESS_TRUNCATE_ENABLE 1
427#define RCE_HASHES 32
428
429struct rmtacl_ctl_entry {
430 struct list_head rce_list;
431 pid_t rce_key;
432 int rce_ops;
433};
434
435struct rmtacl_ctl_table {
436 spinlock_t rct_lock;
437 struct list_head rct_entries[RCE_HASHES];
438};
439
440#define EE_HASHES 32
441
442struct eacl_table {
443 spinlock_t et_lock;
444 struct list_head et_entries[EE_HASHES];
445};
446
447struct ll_sb_info {
448 struct list_head ll_list;
449
450
451 spinlock_t ll_lock;
452 spinlock_t ll_pp_extent_lock;
453 spinlock_t ll_process_lock;
454 struct obd_uuid ll_sb_uuid;
455 struct obd_export *ll_md_exp;
456 struct obd_export *ll_dt_exp;
457 struct proc_dir_entry* ll_proc_root;
458 struct lu_fid ll_root_fid;
459
460 int ll_flags;
461 int ll_umounting:1;
462 struct list_head ll_conn_chain;
463 struct lustre_client_ocd ll_lco;
464
465 struct list_head ll_orphan_dentry_list;
466 struct ll_close_queue *ll_lcq;
467
468 struct lprocfs_stats *ll_stats;
469
470 struct cl_client_cache ll_cache;
471
472 struct lprocfs_stats *ll_ra_stats;
473
474 struct ll_ra_info ll_ra_info;
475 unsigned int ll_namelen;
476 struct file_operations *ll_fop;
477
478
479
480 unsigned long ll_max_rw_chunk;
481 unsigned int ll_md_brw_size;
482
483 struct lu_site *ll_site;
484 struct cl_device *ll_cl;
485
486 struct ll_rw_extents_info ll_rw_extents_info;
487 int ll_extent_process_count;
488 struct ll_rw_process_info ll_rw_process_info[LL_PROCESS_HIST_MAX];
489 unsigned int ll_offset_process_count;
490 struct ll_rw_process_info ll_rw_offset_info[LL_OFFSET_HIST_MAX];
491 unsigned int ll_rw_offset_entry_count;
492 int ll_stats_track_id;
493 enum stats_track_type ll_stats_track_type;
494 int ll_rw_stats_on;
495
496
497 unsigned int ll_sa_max;
498 atomic_t ll_sa_total;
499
500 atomic_t ll_sa_wrong;
501
502 atomic_t ll_agl_total;
503
504 dev_t ll_sdev_orig;
505
506 struct rmtacl_ctl_table ll_rct;
507 struct eacl_table ll_et;
508 __kernel_fsid_t ll_fsid;
509};
510
511#define LL_DEFAULT_MAX_RW_CHUNK (32 * 1024 * 1024)
512
513struct ll_ra_read {
514 pgoff_t lrr_start;
515 pgoff_t lrr_count;
516 struct task_struct *lrr_reader;
517 struct list_head lrr_linkage;
518};
519
520
521
522
523struct ll_readahead_state {
524 spinlock_t ras_lock;
525
526
527
528
529
530
531
532 unsigned long ras_last_readpage;
533
534
535
536
537
538
539
540
541
542
543 unsigned long ras_consecutive_pages;
544
545
546
547
548
549 unsigned long ras_consecutive_requests;
550
551
552
553
554
555
556
557 unsigned long ras_window_start, ras_window_len;
558
559
560
561
562
563
564
565 unsigned long ras_next_readahead;
566
567
568
569
570
571 unsigned long ras_requests;
572
573
574
575
576 unsigned long ras_request_index;
577
578
579
580
581
582 struct list_head ras_read_beads;
583
584
585
586
587
588
589
590
591
592
593
594 unsigned long ras_stride_length;
595 unsigned long ras_stride_pages;
596 pgoff_t ras_stride_offset;
597
598
599
600
601
602
603 unsigned long ras_consecutive_stride_requests;
604};
605
606extern struct kmem_cache *ll_file_data_slab;
607struct lustre_handle;
608struct ll_file_data {
609 struct ll_readahead_state fd_ras;
610 int fd_omode;
611 struct ccc_grouplock fd_grouplock;
612 __u64 lfd_pos;
613 __u32 fd_flags;
614 struct file *fd_file;
615
616
617
618 bool fd_write_failed;
619};
620
621struct lov_stripe_md;
622
623extern spinlock_t inode_lock;
624
625extern struct proc_dir_entry *proc_lustre_fs_root;
626
627static inline struct inode *ll_info2i(struct ll_inode_info *lli)
628{
629 return &lli->lli_vfs_inode;
630}
631
632struct it_cb_data {
633 struct inode *icbd_parent;
634 struct dentry **icbd_childp;
635 obd_id hash;
636};
637
638__u32 ll_i2suppgid(struct inode *i);
639void ll_i2gids(__u32 *suppgids, struct inode *i1,struct inode *i2);
640
641static inline int ll_need_32bit_api(struct ll_sb_info *sbi)
642{
643#if BITS_PER_LONG == 32
644 return 1;
645#else
646 return unlikely(current_is_32bit() || (sbi->ll_flags & LL_SBI_32BIT_API));
647#endif
648}
649
650#define LLAP_MAGIC 98764321
651
652extern struct kmem_cache *ll_async_page_slab;
653extern size_t ll_async_page_slab_size;
654
655void ll_ra_read_in(struct file *f, struct ll_ra_read *rar);
656void ll_ra_read_ex(struct file *f, struct ll_ra_read *rar);
657struct ll_ra_read *ll_ra_read_get(struct file *f);
658
659
660#ifdef LPROCFS
661int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
662 struct super_block *sb, char *osc, char *mdc);
663void lprocfs_unregister_mountpoint(struct ll_sb_info *sbi);
664void ll_stats_ops_tally(struct ll_sb_info *sbi, int op, int count);
665void lprocfs_llite_init_vars(struct lprocfs_static_vars *lvars);
666#else
667static inline int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
668 struct super_block *sb, char *osc, char *mdc){return 0;}
669static inline void lprocfs_unregister_mountpoint(struct ll_sb_info *sbi) {}
670static void ll_stats_ops_tally(struct ll_sb_info *sbi, int op, int count) {}
671static void lprocfs_llite_init_vars(struct lprocfs_static_vars *lvars)
672{
673 memset(lvars, 0, sizeof(*lvars));
674}
675#endif
676
677
678
679void ll_release_page(struct page *page, int remove);
680extern struct file_operations ll_dir_operations;
681extern struct inode_operations ll_dir_inode_operations;
682struct page *ll_get_dir_page(struct inode *dir, __u64 hash,
683 struct ll_dir_chain *chain);
684int ll_dir_read(struct inode *inode, struct dir_context *ctx);
685
686int ll_get_mdt_idx(struct inode *inode);
687
688int ll_objects_destroy(struct ptlrpc_request *request,
689 struct inode *dir);
690struct inode *ll_iget(struct super_block *sb, ino_t hash,
691 struct lustre_md *lic);
692int ll_md_blocking_ast(struct ldlm_lock *, struct ldlm_lock_desc *,
693 void *data, int flag);
694struct dentry *ll_splice_alias(struct inode *inode, struct dentry *de);
695int ll_rmdir_entry(struct inode *dir, char *name, int namelen);
696
697
698int ll_prepare_write(struct file *, struct page *, unsigned from, unsigned to);
699int ll_commit_write(struct file *, struct page *, unsigned from, unsigned to);
700int ll_writepage(struct page *page, struct writeback_control *wbc);
701int ll_writepages(struct address_space *, struct writeback_control *wbc);
702void ll_removepage(struct page *page);
703int ll_readpage(struct file *file, struct page *page);
704void ll_readahead_init(struct inode *inode, struct ll_readahead_state *ras);
705int ll_file_punch(struct inode *, loff_t, int);
706ssize_t ll_file_lockless_io(struct file *, char *, size_t, loff_t *, int);
707void ll_clear_file_contended(struct inode*);
708int ll_sync_page_range(struct inode *, struct address_space *, loff_t, size_t);
709int ll_readahead(const struct lu_env *env, struct cl_io *io,
710 struct ll_readahead_state *ras, struct address_space *mapping,
711 struct cl_page_list *queue, int flags);
712
713
714extern struct file_operations ll_file_operations;
715extern struct file_operations ll_file_operations_flock;
716extern struct file_operations ll_file_operations_noflock;
717extern struct inode_operations ll_file_inode_operations;
718extern int ll_inode_revalidate_it(struct dentry *, struct lookup_intent *,
719 __u64);
720extern int ll_have_md_lock(struct inode *inode, __u64 *bits,
721 ldlm_mode_t l_req_mode);
722extern ldlm_mode_t ll_take_md_lock(struct inode *inode, __u64 bits,
723 struct lustre_handle *lockh, __u64 flags);
724int __ll_inode_revalidate_it(struct dentry *, struct lookup_intent *,
725 __u64 bits);
726int ll_revalidate_nd(struct dentry *dentry, unsigned int flags);
727int ll_file_open(struct inode *inode, struct file *file);
728int ll_file_release(struct inode *inode, struct file *file);
729int ll_glimpse_ioctl(struct ll_sb_info *sbi,
730 struct lov_stripe_md *lsm, lstat_t *st);
731void ll_ioepoch_open(struct ll_inode_info *lli, __u64 ioepoch);
732int ll_local_open(struct file *file,
733 struct lookup_intent *it, struct ll_file_data *fd,
734 struct obd_client_handle *och);
735int ll_release_openhandle(struct dentry *, struct lookup_intent *);
736int ll_md_close(struct obd_export *md_exp, struct inode *inode,
737 struct file *file);
738int ll_md_real_close(struct inode *inode, int flags);
739void ll_ioepoch_close(struct inode *inode, struct md_op_data *op_data,
740 struct obd_client_handle **och, unsigned long flags);
741void ll_done_writing_attr(struct inode *inode, struct md_op_data *op_data);
742int ll_som_update(struct inode *inode, struct md_op_data *op_data);
743int ll_inode_getattr(struct inode *inode, struct obdo *obdo,
744 __u64 ioepoch, int sync);
745int ll_md_setattr(struct dentry *dentry, struct md_op_data *op_data,
746 struct md_open_data **mod);
747void ll_pack_inode2opdata(struct inode *inode, struct md_op_data *op_data,
748 struct lustre_handle *fh);
749extern void ll_rw_stats_tally(struct ll_sb_info *sbi, pid_t pid,
750 struct ll_file_data *file, loff_t pos,
751 size_t count, int rw);
752int ll_getattr_it(struct vfsmount *mnt, struct dentry *de,
753 struct lookup_intent *it, struct kstat *stat);
754int ll_getattr(struct vfsmount *mnt, struct dentry *de, struct kstat *stat);
755struct ll_file_data *ll_file_data_get(void);
756struct posix_acl * ll_get_acl(struct inode *inode, int type);
757
758int ll_inode_permission(struct inode *inode, int mask);
759
760int ll_lov_setstripe_ea_info(struct inode *inode, struct file *file,
761 int flags, struct lov_user_md *lum,
762 int lum_size);
763int ll_lov_getstripe_ea_info(struct inode *inode, const char *filename,
764 struct lov_mds_md **lmm, int *lmm_size,
765 struct ptlrpc_request **request);
766int ll_dir_setstripe(struct inode *inode, struct lov_user_md *lump,
767 int set_default);
768int ll_dir_getstripe(struct inode *inode, struct lov_mds_md **lmmp,
769 int *lmm_size, struct ptlrpc_request **request);
770int ll_fsync(struct file *file, loff_t start, loff_t end, int data);
771int ll_do_fiemap(struct inode *inode, struct ll_user_fiemap *fiemap,
772 int num_bytes);
773int ll_merge_lvb(const struct lu_env *env, struct inode *inode);
774int ll_get_grouplock(struct inode *inode, struct file *file, unsigned long arg);
775int ll_put_grouplock(struct inode *inode, struct file *file, unsigned long arg);
776int ll_fid2path(struct inode *inode, void *arg);
777int ll_data_version(struct inode *inode, __u64 *data_version, int extent_lock);
778
779
780
781int ll_dops_init(struct dentry *de, int block, int init_sa);
782extern struct dentry_operations ll_d_ops;
783void ll_intent_drop_lock(struct lookup_intent *);
784void ll_intent_release(struct lookup_intent *);
785void ll_invalidate_aliases(struct inode *);
786void ll_frob_intent(struct lookup_intent **itp, struct lookup_intent *deft);
787void ll_lookup_finish_locks(struct lookup_intent *it, struct dentry *dentry);
788int ll_dcompare(const struct dentry *parent, const struct dentry *dentry,
789 unsigned int len, const char *str, const struct qstr *d_name);
790int ll_revalidate_it_finish(struct ptlrpc_request *request,
791 struct lookup_intent *it, struct dentry *de);
792
793
794extern struct super_operations lustre_super_operations;
795
796char *ll_read_opt(const char *opt, char *data);
797void ll_lli_init(struct ll_inode_info *lli);
798int ll_fill_super(struct super_block *sb, struct vfsmount *mnt);
799void ll_put_super(struct super_block *sb);
800void ll_kill_super(struct super_block *sb);
801struct inode *ll_inode_from_resource_lock(struct ldlm_lock *lock);
802struct inode *ll_inode_from_lock(struct ldlm_lock *lock);
803void ll_clear_inode(struct inode *inode);
804int ll_setattr_raw(struct dentry *dentry, struct iattr *attr);
805int ll_setattr(struct dentry *de, struct iattr *attr);
806int ll_statfs(struct dentry *de, struct kstatfs *sfs);
807int ll_statfs_internal(struct super_block *sb, struct obd_statfs *osfs,
808 __u64 max_age, __u32 flags);
809void ll_update_inode(struct inode *inode, struct lustre_md *md);
810void ll_read_inode2(struct inode *inode, void *opaque);
811void ll_delete_inode(struct inode *inode);
812int ll_iocontrol(struct inode *inode, struct file *file,
813 unsigned int cmd, unsigned long arg);
814int ll_flush_ctx(struct inode *inode);
815void ll_umount_begin(struct super_block *sb);
816int ll_remount_fs(struct super_block *sb, int *flags, char *data);
817int ll_show_options(struct seq_file *seq, struct dentry *dentry);
818void ll_dirty_page_discard_warn(struct page *page, int ioret);
819int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req,
820 struct super_block *, struct lookup_intent *);
821void lustre_dump_dentry(struct dentry *, int recur);
822void lustre_dump_inode(struct inode *);
823int ll_obd_statfs(struct inode *inode, void *arg);
824int ll_get_max_mdsize(struct ll_sb_info *sbi, int *max_mdsize);
825int ll_process_config(struct lustre_cfg *lcfg);
826struct md_op_data *ll_prep_md_op_data(struct md_op_data *op_data,
827 struct inode *i1, struct inode *i2,
828 const char *name, int namelen,
829 int mode, __u32 opc, void *data);
830void ll_finish_md_op_data(struct md_op_data *op_data);
831int ll_get_obd_name(struct inode *inode, unsigned int cmd, unsigned long arg);
832char *ll_get_fsname(struct super_block *sb, char *buf, int buflen);
833
834
835extern struct export_operations lustre_export_operations;
836__u32 get_uuid2int(const char *name, int len);
837void get_uuid2fsid(const char *name, int len, __kernel_fsid_t *fsid);
838struct inode *search_inode_for_lustre(struct super_block *sb,
839 const struct lu_fid *fid);
840
841
842extern struct inode_operations ll_special_inode_operations;
843extern struct file_operations ll_special_chr_inode_fops;
844extern struct file_operations ll_special_chr_file_fops;
845extern struct file_operations ll_special_blk_inode_fops;
846extern struct file_operations ll_special_fifo_inode_fops;
847extern struct file_operations ll_special_fifo_file_fops;
848extern struct file_operations ll_special_sock_inode_fops;
849
850
851extern struct inode_operations ll_fast_symlink_inode_operations;
852
853
854struct ll_close_queue {
855 spinlock_t lcq_lock;
856 struct list_head lcq_head;
857 wait_queue_head_t lcq_waitq;
858 struct completion lcq_comp;
859 atomic_t lcq_stop;
860};
861
862struct ccc_object *cl_inode2ccc(struct inode *inode);
863
864
865void vvp_write_pending (struct ccc_object *club, struct ccc_page *page);
866void vvp_write_complete(struct ccc_object *club, struct ccc_page *page);
867
868
869enum vvp_io_subtype {
870
871 IO_NORMAL,
872
873 IO_SENDFILE,
874
875 IO_SPLICE
876};
877
878
879struct vvp_io {
880
881 enum vvp_io_subtype cui_io_subtype;
882
883 union {
884 struct {
885 read_actor_t cui_actor;
886 void *cui_target;
887 } sendfile;
888 struct {
889 struct pipe_inode_info *cui_pipe;
890 unsigned int cui_flags;
891 } splice;
892 struct vvp_fault_io {
893
894
895
896
897 time_t ft_mtime;
898 struct vm_area_struct *ft_vma;
899
900
901
902 struct page *ft_vmpage;
903 struct vm_fault_api {
904
905
906
907 struct vm_fault *ft_vmf;
908
909
910
911 unsigned int ft_flags;
912 } fault;
913 } fault;
914 } u;
915
916
917
918 struct ll_ra_read cui_bead;
919
920
921
922 int cui_ra_window_set;
923
924
925
926
927 struct cl_page *cui_partpage;
928};
929
930
931
932
933struct vvp_io_args {
934
935 enum vvp_io_subtype via_io_subtype;
936
937 union {
938 struct {
939 struct kiocb *via_iocb;
940 struct iovec *via_iov;
941 unsigned long via_nrsegs;
942 } normal;
943 struct {
944 read_actor_t via_actor;
945 void *via_target;
946 } sendfile;
947 struct {
948 struct pipe_inode_info *via_pipe;
949 unsigned int via_flags;
950 } splice;
951 } u;
952};
953
954struct ll_cl_context {
955 void *lcc_cookie;
956 struct cl_io *lcc_io;
957 struct cl_page *lcc_page;
958 struct lu_env *lcc_env;
959 int lcc_refcheck;
960 int lcc_created;
961};
962
963struct vvp_thread_info {
964 struct ost_lvb vti_lvb;
965 struct cl_2queue vti_queue;
966 struct iovec vti_local_iov;
967 struct vvp_io_args vti_args;
968 struct ra_io_arg vti_ria;
969 struct kiocb vti_kiocb;
970 struct ll_cl_context vti_io_ctx;
971};
972
973static inline struct vvp_thread_info *vvp_env_info(const struct lu_env *env)
974{
975 extern struct lu_context_key vvp_key;
976 struct vvp_thread_info *info;
977
978 info = lu_context_key_get(&env->le_ctx, &vvp_key);
979 LASSERT(info != NULL);
980 return info;
981}
982
983static inline struct vvp_io_args *vvp_env_args(const struct lu_env *env,
984 enum vvp_io_subtype type)
985{
986 struct vvp_io_args *ret = &vvp_env_info(env)->vti_args;
987
988 ret->via_io_subtype = type;
989
990 return ret;
991}
992
993struct vvp_session {
994 struct vvp_io vs_ios;
995};
996
997static inline struct vvp_session *vvp_env_session(const struct lu_env *env)
998{
999 extern struct lu_context_key vvp_session_key;
1000 struct vvp_session *ses;
1001
1002 ses = lu_context_key_get(env->le_ses, &vvp_session_key);
1003 LASSERT(ses != NULL);
1004 return ses;
1005}
1006
1007static inline struct vvp_io *vvp_env_io(const struct lu_env *env)
1008{
1009 return &vvp_env_session(env)->vs_ios;
1010}
1011
1012void ll_queue_done_writing(struct inode *inode, unsigned long flags);
1013void ll_close_thread_shutdown(struct ll_close_queue *lcq);
1014int ll_close_thread_start(struct ll_close_queue **lcq_ret);
1015
1016
1017typedef struct rb_root rb_root_t;
1018typedef struct rb_node rb_node_t;
1019
1020struct ll_lock_tree_node;
1021struct ll_lock_tree {
1022 rb_root_t lt_root;
1023 struct list_head lt_locked_list;
1024 struct ll_file_data *lt_fd;
1025};
1026
1027int ll_teardown_mmaps(struct address_space *mapping, __u64 first, __u64 last);
1028int ll_file_mmap(struct file * file, struct vm_area_struct * vma);
1029struct ll_lock_tree_node * ll_node_from_inode(struct inode *inode, __u64 start,
1030 __u64 end, ldlm_mode_t mode);
1031void policy_from_vma(ldlm_policy_data_t *policy,
1032 struct vm_area_struct *vma, unsigned long addr, size_t count);
1033struct vm_area_struct *our_vma(struct mm_struct *mm, unsigned long addr,
1034 size_t count);
1035
1036static inline void ll_invalidate_page(struct page *vmpage)
1037{
1038 struct address_space *mapping = vmpage->mapping;
1039 loff_t offset = vmpage->index << PAGE_CACHE_SHIFT;
1040
1041 LASSERT(PageLocked(vmpage));
1042 if (mapping == NULL)
1043 return;
1044
1045 ll_teardown_mmaps(mapping, offset, offset + PAGE_CACHE_SIZE);
1046 truncate_complete_page(mapping, vmpage);
1047}
1048
1049#define ll_s2sbi(sb) (s2lsi(sb)->lsi_llsbi)
1050
1051
1052static inline struct obd_export *ll_s2dtexp(struct super_block *sb)
1053{
1054 return ll_s2sbi(sb)->ll_dt_exp;
1055}
1056
1057
1058static inline struct obd_export *ll_s2mdexp(struct super_block *sb)
1059{
1060 return ll_s2sbi(sb)->ll_md_exp;
1061}
1062
1063static inline struct client_obd *sbi2mdc(struct ll_sb_info *sbi)
1064{
1065 struct obd_device *obd = sbi->ll_md_exp->exp_obd;
1066 if (obd == NULL)
1067 LBUG();
1068 return &obd->u.cli;
1069}
1070
1071
1072static inline struct ll_sb_info *ll_i2sbi(struct inode *inode)
1073{
1074 return ll_s2sbi(inode->i_sb);
1075}
1076
1077static inline struct obd_export *ll_i2dtexp(struct inode *inode)
1078{
1079 return ll_s2dtexp(inode->i_sb);
1080}
1081
1082static inline struct obd_export *ll_i2mdexp(struct inode *inode)
1083{
1084 return ll_s2mdexp(inode->i_sb);
1085}
1086
1087static inline struct lu_fid *ll_inode2fid(struct inode *inode)
1088{
1089 struct lu_fid *fid;
1090
1091 LASSERT(inode != NULL);
1092 fid = &ll_i2info(inode)->lli_fid;
1093
1094 return fid;
1095}
1096
1097static inline int ll_mds_max_easize(struct super_block *sb)
1098{
1099 return sbi2mdc(ll_s2sbi(sb))->cl_max_mds_easize;
1100}
1101
1102static inline __u64 ll_file_maxbytes(struct inode *inode)
1103{
1104 return ll_i2info(inode)->lli_maxbytes;
1105}
1106
1107
1108int ll_setxattr(struct dentry *dentry, const char *name,
1109 const void *value, size_t size, int flags);
1110ssize_t ll_getxattr(struct dentry *dentry, const char *name,
1111 void *buffer, size_t size);
1112ssize_t ll_listxattr(struct dentry *dentry, char *buffer, size_t size);
1113int ll_removexattr(struct dentry *dentry, const char *name);
1114
1115
1116extern struct kmem_cache *ll_remote_perm_cachep;
1117extern struct kmem_cache *ll_rmtperm_hash_cachep;
1118
1119struct hlist_head *alloc_rmtperm_hash(void);
1120void free_rmtperm_hash(struct hlist_head *hash);
1121int ll_update_remote_perm(struct inode *inode, struct mdt_remote_perm *perm);
1122int lustre_check_remote_perm(struct inode *inode, int mask);
1123
1124
1125extern struct timer_list ll_capa_timer;
1126
1127int ll_capa_thread_start(void);
1128void ll_capa_thread_stop(void);
1129void ll_capa_timer_callback(unsigned long unused);
1130
1131struct obd_capa *ll_add_capa(struct inode *inode, struct obd_capa *ocapa);
1132int ll_update_capa(struct obd_capa *ocapa, struct lustre_capa *capa);
1133
1134void ll_capa_open(struct inode *inode);
1135void ll_capa_close(struct inode *inode);
1136
1137struct obd_capa *ll_mdscapa_get(struct inode *inode);
1138struct obd_capa *ll_osscapa_get(struct inode *inode, __u64 opc);
1139
1140void ll_truncate_free_capa(struct obd_capa *ocapa);
1141void ll_clear_inode_capas(struct inode *inode);
1142void ll_print_capa_stat(struct ll_sb_info *sbi);
1143
1144
1145extern struct lu_device_type vvp_device_type;
1146
1147
1148
1149
1150int cl_sb_init(struct super_block *sb);
1151int cl_sb_fini(struct super_block *sb);
1152enum cl_lock_mode vvp_mode_from_vma(struct vm_area_struct *vma);
1153void ll_io_init(struct cl_io *io, const struct file *file, int write);
1154
1155void ras_update(struct ll_sb_info *sbi, struct inode *inode,
1156 struct ll_readahead_state *ras, unsigned long index,
1157 unsigned hit);
1158void ll_ra_count_put(struct ll_sb_info *sbi, unsigned long len);
1159int ll_is_file_contended(struct file *file);
1160void ll_ra_stats_inc(struct address_space *mapping, enum ra_stat which);
1161
1162
1163#ifdef CONFIG_FS_POSIX_ACL
1164struct eacl_entry {
1165 struct list_head ee_list;
1166 pid_t ee_key;
1167 struct lu_fid ee_fid;
1168 int ee_type;
1169 ext_acl_xattr_header *ee_acl;
1170};
1171
1172obd_valid rce_ops2valid(int ops);
1173struct rmtacl_ctl_entry *rct_search(struct rmtacl_ctl_table *rct, pid_t key);
1174int rct_add(struct rmtacl_ctl_table *rct, pid_t key, int ops);
1175int rct_del(struct rmtacl_ctl_table *rct, pid_t key);
1176void rct_init(struct rmtacl_ctl_table *rct);
1177void rct_fini(struct rmtacl_ctl_table *rct);
1178
1179void ee_free(struct eacl_entry *ee);
1180int ee_add(struct eacl_table *et, pid_t key, struct lu_fid *fid, int type,
1181 ext_acl_xattr_header *header);
1182struct eacl_entry *et_search_del(struct eacl_table *et, pid_t key,
1183 struct lu_fid *fid, int type);
1184void et_search_free(struct eacl_table *et, pid_t key);
1185void et_init(struct eacl_table *et);
1186void et_fini(struct eacl_table *et);
1187#else
1188static inline obd_valid rce_ops2valid(int ops)
1189{
1190 return 0;
1191}
1192#endif
1193
1194
1195
1196#define LL_SA_RPC_MIN 2
1197#define LL_SA_RPC_DEF 32
1198#define LL_SA_RPC_MAX 8192
1199
1200#define LL_SA_CACHE_BIT 5
1201#define LL_SA_CACHE_SIZE (1 << LL_SA_CACHE_BIT)
1202#define LL_SA_CACHE_MASK (LL_SA_CACHE_SIZE - 1)
1203
1204
1205struct ll_statahead_info {
1206 struct inode *sai_inode;
1207 atomic_t sai_refcount;
1208
1209 unsigned int sai_generation;
1210 unsigned int sai_max;
1211 __u64 sai_sent;
1212 __u64 sai_replied;
1213
1214 __u64 sai_index;
1215 __u64 sai_index_wait;
1216
1217 __u64 sai_hit;
1218 __u64 sai_miss;
1219
1220
1221
1222
1223
1224
1225
1226 unsigned int sai_consecutive_miss;
1227 unsigned int sai_miss_hidden;
1228
1229 unsigned int sai_skip_hidden;
1230 unsigned int sai_ls_all:1,
1231
1232 sai_in_readpage:1,
1233 sai_agl_valid:1;
1234 wait_queue_head_t sai_waitq;
1235 struct ptlrpc_thread sai_thread;
1236 struct ptlrpc_thread sai_agl_thread;
1237 struct list_head sai_entries;
1238 struct list_head sai_entries_received;
1239 struct list_head sai_entries_stated;
1240 struct list_head sai_entries_agl;
1241 struct list_head sai_cache[LL_SA_CACHE_SIZE];
1242 spinlock_t sai_cache_lock[LL_SA_CACHE_SIZE];
1243 atomic_t sai_cache_count;
1244};
1245
1246int do_statahead_enter(struct inode *dir, struct dentry **dentry,
1247 int only_unplug);
1248void ll_stop_statahead(struct inode *dir, void *key);
1249
1250static inline int ll_glimpse_size(struct inode *inode)
1251{
1252 struct ll_inode_info *lli = ll_i2info(inode);
1253 int rc;
1254
1255 down_read(&lli->lli_glimpse_sem);
1256 rc = cl_glimpse_size(inode);
1257 lli->lli_glimpse_time = cfs_time_current();
1258 up_read(&lli->lli_glimpse_sem);
1259 return rc;
1260}
1261
1262static inline void
1263ll_statahead_mark(struct inode *dir, struct dentry *dentry)
1264{
1265 struct ll_inode_info *lli = ll_i2info(dir);
1266 struct ll_statahead_info *sai = lli->lli_sai;
1267 struct ll_dentry_data *ldd = ll_d2d(dentry);
1268
1269
1270 if (lli->lli_opendir_pid != current_pid())
1271 return;
1272
1273 if (sai != NULL && ldd != NULL)
1274 ldd->lld_sa_generation = sai->sai_generation;
1275}
1276
1277static inline int
1278ll_need_statahead(struct inode *dir, struct dentry *dentryp)
1279{
1280 struct ll_inode_info *lli;
1281 struct ll_dentry_data *ldd;
1282
1283 if (ll_i2sbi(dir)->ll_sa_max == 0)
1284 return -EAGAIN;
1285
1286 lli = ll_i2info(dir);
1287
1288 if (lli->lli_opendir_pid != current_pid())
1289 return -EAGAIN;
1290
1291
1292 if (lli->lli_opendir_key == NULL)
1293 return -EAGAIN;
1294
1295 ldd = ll_d2d(dentryp);
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311 if (ldd && lli->lli_sai &&
1312 ldd->lld_sa_generation == lli->lli_sai->sai_generation)
1313 return -EAGAIN;
1314
1315 return 1;
1316}
1317
1318static inline int
1319ll_statahead_enter(struct inode *dir, struct dentry **dentryp, int only_unplug)
1320{
1321 int ret;
1322
1323 ret = ll_need_statahead(dir, *dentryp);
1324 if (ret <= 0)
1325 return ret;
1326
1327 return do_statahead_enter(dir, dentryp, only_unplug);
1328}
1329
1330
1331enum llioc_iter {
1332 LLIOC_CONT = 0,
1333 LLIOC_STOP
1334};
1335
1336#define LLIOC_MAX_CMD 256
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352typedef enum llioc_iter (*llioc_callback_t)(struct inode *inode,
1353 struct file *file, unsigned int cmd, unsigned long arg,
1354 void *magic, int *rcp);
1355
1356enum llioc_iter ll_iocontrol_call(struct inode *inode, struct file *file,
1357 unsigned int cmd, unsigned long arg, int *rcp);
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371void *ll_iocontrol_register(llioc_callback_t cb, int count, unsigned int *cmd);
1372void ll_iocontrol_unregister(void *magic);
1373
1374
1375
1376#define cl_inode_info ll_inode_info
1377#define cl_i2info(info) ll_i2info(info)
1378#define cl_inode_mode(inode) ((inode)->i_mode)
1379#define cl_i2sbi ll_i2sbi
1380
1381static inline struct ll_file_data *cl_iattr2fd(struct inode *inode,
1382 const struct iattr *attr)
1383{
1384 LASSERT(attr->ia_valid & ATTR_FILE);
1385 return LUSTRE_FPRIVATE(attr->ia_file);
1386}
1387
1388static inline void cl_isize_lock(struct inode *inode)
1389{
1390 ll_inode_size_lock(inode);
1391}
1392
1393static inline void cl_isize_unlock(struct inode *inode)
1394{
1395 ll_inode_size_unlock(inode);
1396}
1397
1398static inline void cl_isize_write_nolock(struct inode *inode, loff_t kms)
1399{
1400 LASSERT(down_trylock(&ll_i2info(inode)->lli_size_sem) != 0);
1401 i_size_write(inode, kms);
1402}
1403
1404static inline void cl_isize_write(struct inode *inode, loff_t kms)
1405{
1406 ll_inode_size_lock(inode);
1407 i_size_write(inode, kms);
1408 ll_inode_size_unlock(inode);
1409}
1410
1411#define cl_isize_read(inode) i_size_read(inode)
1412
1413static inline int cl_merge_lvb(const struct lu_env *env, struct inode *inode)
1414{
1415 return ll_merge_lvb(env, inode);
1416}
1417
1418#define cl_inode_atime(inode) LTIME_S((inode)->i_atime)
1419#define cl_inode_ctime(inode) LTIME_S((inode)->i_ctime)
1420#define cl_inode_mtime(inode) LTIME_S((inode)->i_mtime)
1421
1422struct obd_capa *cl_capa_lookup(struct inode *inode, enum cl_req_type crt);
1423
1424int cl_sync_file_range(struct inode *inode, loff_t start, loff_t end,
1425 enum cl_fsync_mode mode, int ignore_layout);
1426
1427
1428struct ll_dio_pages {
1429
1430
1431 struct page **ldp_pages;
1432
1433 loff_t *ldp_offsets;
1434
1435
1436
1437 loff_t ldp_start_offset;
1438
1439 size_t ldp_size;
1440
1441 int ldp_nr;
1442};
1443
1444static inline void cl_stats_tally(struct cl_device *dev, enum cl_req_type crt,
1445 int rc)
1446{
1447 int opc = (crt == CRT_READ) ? LPROC_LL_OSC_READ :
1448 LPROC_LL_OSC_WRITE;
1449
1450 ll_stats_ops_tally(ll_s2sbi(cl2ccc_dev(dev)->cdv_sb), opc, rc);
1451}
1452
1453extern ssize_t ll_direct_rw_pages(const struct lu_env *env, struct cl_io *io,
1454 int rw, struct inode *inode,
1455 struct ll_dio_pages *pv);
1456
1457static inline int ll_file_nolock(const struct file *file)
1458{
1459 struct ll_file_data *fd = LUSTRE_FPRIVATE(file);
1460 struct inode *inode = file->f_dentry->d_inode;
1461
1462 LASSERT(fd != NULL);
1463 return ((fd->fd_flags & LL_FILE_IGNORE_LOCK) ||
1464 (ll_i2sbi(inode)->ll_flags & LL_SBI_NOLCK));
1465}
1466
1467static inline void ll_set_lock_data(struct obd_export *exp, struct inode *inode,
1468 struct lookup_intent *it, __u64 *bits)
1469{
1470 if (!it->d.lustre.it_lock_set) {
1471 struct lustre_handle handle;
1472
1473
1474
1475
1476
1477
1478
1479
1480 if (it->d.lustre.it_remote_lock_mode) {
1481 handle.cookie = it->d.lustre.it_remote_lock_handle;
1482 CDEBUG(D_DLMTRACE, "setting l_data to inode %p"
1483 "(%lu/%u) for remote lock "LPX64"\n", inode,
1484 inode->i_ino, inode->i_generation,
1485 handle.cookie);
1486 md_set_lock_data(exp, &handle.cookie, inode, NULL);
1487 }
1488
1489 handle.cookie = it->d.lustre.it_lock_handle;
1490
1491 CDEBUG(D_DLMTRACE, "setting l_data to inode %p (%lu/%u)"
1492 " for lock "LPX64"\n", inode, inode->i_ino,
1493 inode->i_generation, handle.cookie);
1494
1495 md_set_lock_data(exp, &handle.cookie, inode,
1496 &it->d.lustre.it_lock_bits);
1497 it->d.lustre.it_lock_set = 1;
1498 }
1499
1500 if (bits != NULL)
1501 *bits = it->d.lustre.it_lock_bits;
1502}
1503
1504static inline void ll_lock_dcache(struct inode *inode)
1505{
1506 spin_lock(&inode->i_lock);
1507}
1508
1509static inline void ll_unlock_dcache(struct inode *inode)
1510{
1511 spin_unlock(&inode->i_lock);
1512}
1513
1514static inline int d_lustre_invalid(const struct dentry *dentry)
1515{
1516 struct ll_dentry_data *lld = ll_d2d(dentry);
1517
1518 return (lld == NULL) || lld->lld_invalid;
1519}
1520
1521static inline void __d_lustre_invalidate(struct dentry *dentry)
1522{
1523 struct ll_dentry_data *lld = ll_d2d(dentry);
1524
1525 if (lld != NULL)
1526 lld->lld_invalid = 1;
1527}
1528
1529
1530
1531
1532
1533
1534static inline void d_lustre_invalidate(struct dentry *dentry, int nested)
1535{
1536 CDEBUG(D_DENTRY, "invalidate dentry %.*s (%p) parent %p inode %p "
1537 "refc %d\n", dentry->d_name.len, dentry->d_name.name, dentry,
1538 dentry->d_parent, dentry->d_inode, d_count(dentry));
1539
1540 spin_lock_nested(&dentry->d_lock,
1541 nested ? DENTRY_D_LOCK_NESTED : DENTRY_D_LOCK_NORMAL);
1542 __d_lustre_invalidate(dentry);
1543 if (d_count(dentry) == 0)
1544 __d_drop(dentry);
1545 spin_unlock(&dentry->d_lock);
1546}
1547
1548static inline void d_lustre_revalidate(struct dentry *dentry)
1549{
1550 spin_lock(&dentry->d_lock);
1551 LASSERT(ll_d2d(dentry) != NULL);
1552 ll_d2d(dentry)->lld_invalid = 0;
1553 spin_unlock(&dentry->d_lock);
1554}
1555
1556#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 50, 0)
1557
1558struct if_quotactl_18 {
1559 __u32 qc_cmd;
1560 __u32 qc_type;
1561 __u32 qc_id;
1562 __u32 qc_stat;
1563 struct obd_dqinfo qc_dqinfo;
1564 struct obd_dqblk qc_dqblk;
1565 char obd_type[16];
1566 struct obd_uuid obd_uuid;
1567};
1568#define LL_IOC_QUOTACTL_18 _IOWR('f', 162, struct if_quotactl_18 *)
1569
1570#else
1571#warning "remove old LL_IOC_QUOTACTL_18 compatibility code"
1572#endif
1573
1574enum {
1575 LL_LAYOUT_GEN_NONE = ((__u32)-2),
1576 LL_LAYOUT_GEN_EMPTY = ((__u32)-1)
1577};
1578
1579int ll_layout_conf(struct inode *inode, const struct cl_object_conf *conf);
1580int ll_layout_refresh(struct inode *inode, __u32 *gen);
1581
1582#endif
1583