Whamcloud - gitweb
- make HEAD from b_post_cmd3
[fs/lustre-release.git] / lustre / mdd / mdd_internal.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *  mdd/mdd_internel.c
4  *
5  *  Copyright (C) 2006 Cluster File Systems, Inc.
6  *   Author: Wang Di <wangdi@clusterfs.com>
7  *
8  *   This file is part of the Lustre file system, http://www.lustre.org
9  *   Lustre is a trademark of Cluster File Systems, Inc.
10  *
11  *   You may have signed or agreed to another license before downloading
12  *   this software.  If so, you are bound by the terms and conditions
13  *   of that agreement, and the following does not apply to you.  See the
14  *   LICENSE file included with this distribution for more information.
15  *
16  *   If you did not agree to a different license, then this copy of Lustre
17  *   is open source software; you can redistribute it and/or modify it
18  *   under the terms of version 2 of the GNU General Public License as
19  *   published by the Free Software Foundation.
20  *
21  *   In either case, Lustre is distributed in the hope that it will be
22  *   useful, but WITHOUT ANY WARRANTY; without even the implied warranty
23  *   of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24  *   license text for more details.
25  */
26
27 #ifndef _MDD_INTERNAL_H
28 #define _MDD_INTERNAL_H
29
30 #include <asm/semaphore.h>
31
32 #include <linux/lustre_acl.h>
33 #include <obd.h>
34 #include <md_object.h>
35 #include <dt_object.h>
36 #include <linux/sched.h>
37 #include <linux/capability.h>
38 #include <linux/dynlocks.h>
39
40 enum mdd_txn_op {
41         MDD_TXN_OBJECT_DESTROY_OP = 0,
42         MDD_TXN_OBJECT_CREATE_OP,
43         MDD_TXN_ATTR_SET_OP,
44         MDD_TXN_XATTR_SET_OP,
45         MDD_TXN_INDEX_INSERT_OP,
46         MDD_TXN_INDEX_DELETE_OP,
47         MDD_TXN_LINK_OP,
48         MDD_TXN_UNLINK_OP,
49         MDD_TXN_RENAME_OP,
50         MDD_TXN_RENAME_TGT_OP,
51         MDD_TXN_CREATE_DATA_OP,
52         MDD_TXN_MKDIR_OP,
53         MDD_TXN_LAST_OP
54 };
55
56 struct mdd_txn_op_descr {
57         enum mdd_txn_op mod_op;
58         unsigned int    mod_credits;
59 };
60
61 struct mdd_device {
62         struct md_device                 mdd_md_dev;
63         struct dt_device                *mdd_child;
64         struct obd_device               *mdd_obd_dev;
65         struct lu_fid                    mdd_root_fid;
66         struct dt_device_param           mdd_dt_conf;
67         struct dt_object                *mdd_orphans;
68         struct dt_txn_callback           mdd_txn_cb;
69         cfs_proc_dir_entry_t            *mdd_proc_entry;
70         struct lprocfs_stats            *mdd_stats;
71         struct mdd_txn_op_descr          mdd_tod[MDD_TXN_LAST_OP];
72 };
73
74 enum mod_flags {
75         /* The dir object has been unlinked */
76         DEAD_OBJ   = 1 << 0,
77         APPEND_OBJ = 1 << 1,
78         IMMUTE_OBJ = 1 << 2,
79         ORPHAN_OBJ = 1 << 3
80 };
81
82 #define LUSTRE_APPEND_FL LDISKFS_APPEND_FL
83 #define LUSTRE_IMMUTABLE_FL LDISKFS_IMMUTABLE_FL
84 #define LUSTRE_DIRSYNC_FL LDISKFS_DIRSYNC_FL
85
86 struct mdd_object {
87         struct md_object  mod_obj;
88         /* open count */
89         __u32             mod_count;
90         __u32             mod_valid;
91         unsigned long     mod_flags;
92         struct dynlock    mod_pdlock;
93 };
94
95 struct orph_key {
96         /* fid of the object*/
97         struct lu_fid ok_fid;
98         /* type of operation: unlink, truncate */
99         __u32         ok_op;
100 } __attribute__((packed));
101
102 struct mdd_thread_info {
103         struct txn_param          mti_param;
104         struct lu_fid             mti_fid;
105         struct lu_attr            mti_la;
106         struct md_attr            mti_ma;
107         struct lu_attr            mti_la_for_fix;
108         struct obd_info           mti_oi;
109         struct orph_key           mti_orph_key;
110         struct obd_trans_info     mti_oti;
111         struct lu_buf             mti_buf;
112         struct obdo               mti_oa;
113         char                      mti_xattr_buf[LUSTRE_POSIX_ACL_MAX_SIZE];
114         struct lu_fid             mti_fid2; /* used for be & cpu converting */
115         struct lu_fid_pack        mti_pack;
116         struct dt_allocation_hint mti_hint;
117         struct lov_mds_md        *mti_max_lmm;
118         int                       mti_max_lmm_size;
119         struct llog_cookie       *mti_max_cookie;
120         int                       mti_max_cookie_size;
121 };
122
123 struct lov_mds_md *mdd_max_lmm_get(const struct lu_env *env,
124                                    struct mdd_device *mdd);
125
126 struct llog_cookie *mdd_max_cookie_get(const struct lu_env *env,
127                                        struct mdd_device *mdd);
128
129 int mdd_init_obd(const struct lu_env *env, struct mdd_device *mdd,
130                  struct lustre_cfg *cfg);
131 int mdd_fini_obd(const struct lu_env *env, struct mdd_device *mdd,
132                  struct lustre_cfg *lcfg);
133 int mdd_xattr_set_txn(const struct lu_env *env, struct mdd_object *obj,
134                       const struct lu_buf *buf, const char *name, int fl,
135                       struct thandle *txn);
136 int mdd_lsm_sanity_check(const struct lu_env *env, struct mdd_object *obj);
137 int mdd_lov_set_md(const struct lu_env *env, struct mdd_object *pobj,
138                    struct mdd_object *child, struct lov_mds_md *lmm,
139                    int lmm_size, struct thandle *handle, int set_stripe);
140 int mdd_lov_create(const struct lu_env *env, struct mdd_device *mdd,
141                    struct mdd_object *parent, struct mdd_object *child,
142                    struct lov_mds_md **lmm, int *lmm_size,
143                    const struct md_op_spec *spec, struct lu_attr *la);
144 void mdd_lov_objid_update(const struct lu_env *env, struct mdd_device *mdd);
145 void mdd_lov_create_finish(const struct lu_env *env, struct mdd_device *mdd,
146                            struct lov_mds_md *lmm, int lmm_size,
147                            const struct md_op_spec *spec);
148 int mdd_get_md(const struct lu_env *env, struct mdd_object *obj,
149                void *md, int *md_size, const char *name);
150 int mdd_get_md_locked(const struct lu_env *env, struct mdd_object *obj,
151                       void *md, int *md_size, const char *name);
152 int mdd_la_get(const struct lu_env *env, struct mdd_object *obj,
153                struct lu_attr *la, struct lustre_capa *capa);
154 int mdd_attr_set_internal(const struct lu_env *env, struct mdd_object *o,
155                           const struct lu_attr *attr, struct thandle *handle,
156                           const int needacl);
157 int mdd_object_kill(const struct lu_env *env, struct mdd_object *obj,
158                     struct md_attr *ma);
159 int mdd_iattr_get(const struct lu_env *env, struct mdd_object *mdd_obj,
160                   struct md_attr *ma);
161 int mdd_attr_get_internal_locked(const struct lu_env *env,
162                                  struct mdd_object *mdd_obj,
163                                  struct md_attr *ma);
164 int mdd_object_create_internal(const struct lu_env *env, struct mdd_object *p,
165                                struct mdd_object *c, struct md_attr *ma,
166                                struct thandle *handle);
167 int mdd_attr_set_internal_locked(const struct lu_env *env,
168                                  struct mdd_object *o,
169                                  const struct lu_attr *attr,
170                                  struct thandle *handle, const int needacl);
171 int mdd_lmm_get_locked(const struct lu_env *env, struct mdd_object *mdd_obj,
172                        struct md_attr *ma);
173 /* mdd_lock.c */
174 void mdd_write_lock(const struct lu_env *env, struct mdd_object *obj);
175 void mdd_read_lock(const struct lu_env *env, struct mdd_object *obj);
176 void mdd_write_unlock(const struct lu_env *env, struct mdd_object *obj);
177 void mdd_read_unlock(const struct lu_env *env, struct mdd_object *obj);
178
179 void mdd_pdlock_init(struct mdd_object *obj);
180 unsigned long mdd_name2hash(const char *name);
181 struct dynlock_handle *mdd_pdo_write_lock(const struct lu_env *env,
182                                           struct mdd_object *obj,
183                                           const char *name);
184 struct dynlock_handle *mdd_pdo_read_lock(const struct lu_env *env,
185                                          struct mdd_object *obj,
186                                          const char *name);
187 void mdd_pdo_write_unlock(const struct lu_env *env, struct mdd_object *obj,
188                           struct dynlock_handle *dlh);
189 void mdd_pdo_read_unlock(const struct lu_env *env, struct mdd_object *obj,
190                          struct dynlock_handle *dlh);
191 /* mdd_dir.c */
192 int mdd_may_create(const struct lu_env *env, struct mdd_object *pobj,
193                    struct mdd_object *cobj, int check_perm, int check_nlink);
194 int mdd_may_unlink(const struct lu_env *env, struct mdd_object *pobj,
195                    const struct md_attr *ma);
196 int mdd_may_delete(const struct lu_env *env, struct mdd_object *pobj,
197                    struct mdd_object *cobj, struct md_attr *ma,
198                    int check_perm, int check_empty);
199 int mdd_unlink_sanity_check(const struct lu_env *env, struct mdd_object *pobj,
200                             struct mdd_object *cobj, struct md_attr *ma);
201 int mdd_finish_unlink(const struct lu_env *env, struct mdd_object *obj,
202                       struct md_attr *ma, struct thandle *th);
203 int mdd_object_initialize(const struct lu_env *env, const struct lu_fid *pfid,
204                           struct mdd_object *child, struct md_attr *ma,
205                           struct thandle *handle);
206 int mdd_link_sanity_check(const struct lu_env *env, struct mdd_object *tgt_obj,
207                           const struct lu_name *lname, struct mdd_object *src_obj);
208 /* mdd_lov.c */
209 int mdd_unlink_log(const struct lu_env *env, struct mdd_device *mdd,
210                    struct mdd_object *mdd_cobj, struct md_attr *ma);
211
212 int mdd_setattr_log(const struct lu_env *env, struct mdd_device *mdd,
213                     const struct md_attr *ma,
214                     struct lov_mds_md *lmm, int lmm_size,
215                     struct llog_cookie *logcookies, int cookies_size);
216
217 int mdd_get_cookie_size(const struct lu_env *env, struct mdd_device *mdd,
218                         struct lov_mds_md *lmm);
219
220 int mdd_lov_setattr_async(const struct lu_env *env, struct mdd_object *obj,
221                           struct lov_mds_md *lmm, int lmm_size,
222                           struct llog_cookie *logcookies);
223
224 struct mdd_thread_info *mdd_env_info(const struct lu_env *env);
225
226 struct lu_buf *mdd_buf_get(const struct lu_env *env, void *area, ssize_t len);
227 const struct lu_buf *mdd_buf_get_const(const struct lu_env *env,
228                                        const void *area, ssize_t len);
229
230 int __mdd_orphan_cleanup(const struct lu_env *env, struct mdd_device *d);
231 int __mdd_orphan_add(const struct lu_env *, struct mdd_object *,
232                      struct thandle *);
233 int __mdd_orphan_del(const struct lu_env *, struct mdd_object *,
234                      struct thandle *);
235 int orph_index_init(const struct lu_env *env, struct mdd_device *mdd);
236 void orph_index_fini(const struct lu_env *env, struct mdd_device *mdd);
237 int mdd_txn_init_credits(const struct lu_env *env, struct mdd_device *mdd);
238
239 int mdd_procfs_init(struct mdd_device *mdd, const char *name);
240 int mdd_procfs_fini(struct mdd_device *mdd);
241 void mdd_lprocfs_time_start(const struct lu_env *env);
242 void mdd_lprocfs_time_end(const struct lu_env *env,
243                           struct mdd_device *mdd, int op);
244
245 int mdd_get_flags(const struct lu_env *env, struct mdd_object *obj);
246
247 extern struct md_dir_operations    mdd_dir_ops;
248 extern struct md_object_operations mdd_obj_ops;
249
250 /* mdd_trans.c */
251 void mdd_txn_param_build(const struct lu_env *env, struct mdd_device *mdd,
252                          enum mdd_txn_op);
253 int mdd_log_txn_param_build(const struct lu_env *env, struct md_object *obj,
254                             struct md_attr *ma, enum mdd_txn_op);
255
256 static inline void mdd_object_put(const struct lu_env *env,
257                                   struct mdd_object *o)
258 {
259         lu_object_put(env, &o->mod_obj.mo_lu);
260 }
261
262 struct thandle* mdd_trans_start(const struct lu_env *env,
263                                        struct mdd_device *);
264
265 void mdd_trans_stop(const struct lu_env *env, struct mdd_device *mdd,
266                     int rc, struct thandle *handle);
267
268 int mdd_txn_start_cb(const struct lu_env *env, struct txn_param *param,
269                      void *cookie);
270
271 int mdd_txn_stop_cb(const struct lu_env *env, struct thandle *txn,
272                     void *cookie);
273
274 int mdd_txn_commit_cb(const struct lu_env *env, struct thandle *txn,
275                       void *cookie);
276 /* mdd_device.c */
277 struct lu_object *mdd_object_alloc(const struct lu_env *env,
278                                    const struct lu_object_header *hdr,
279                                    struct lu_device *d);
280
281 /* mdd_object.c */
282 int accmode(const struct lu_env *env, struct lu_attr *la, int flags);
283 extern struct lu_context_key mdd_thread_key;
284 extern struct lu_device_operations mdd_lu_ops;
285
286 struct mdd_object *mdd_object_find(const struct lu_env *env,
287                                    struct mdd_device *d,
288                                    const struct lu_fid *f);
289 /* mdd_permission.c */
290 #define mdd_cap_t(x) (x)
291
292 #define MDD_CAP_TO_MASK(x) (1 << (x))
293
294 #define mdd_cap_raised(c, flag) (mdd_cap_t(c) & MDD_CAP_TO_MASK(flag))
295
296 /* capable() is copied from linux kernel! */
297 static inline int mdd_capable(struct md_ucred *uc, int cap)
298 {
299         if (mdd_cap_raised(uc->mu_cap, cap))
300                 return 1;
301         return 0;
302 }
303
304 int mdd_in_group_p(struct md_ucred *uc, gid_t grp);
305 int mdd_acl_def_get(const struct lu_env *env, struct mdd_object *mdd_obj,
306                     struct md_attr *ma);
307 int mdd_acl_chmod(const struct lu_env *env, struct mdd_object *o, __u32 mode,
308                   struct thandle *handle);
309 int __mdd_acl_init(const struct lu_env *env, struct mdd_object *obj,
310                    struct lu_buf *buf, __u32 *mode, struct thandle *handle);
311 int mdd_acl_init(const struct lu_env *env, struct mdd_object *pobj,
312                  struct mdd_object *cobj, __u32 *mode, struct thandle *handle);
313 int __mdd_permission_internal(const struct lu_env *env, struct mdd_object *obj,
314                               struct lu_attr *la, int mask, int needlock);
315 int mdd_permission(const struct lu_env *env,
316                    struct md_object *pobj, struct md_object *cobj,
317                    struct md_attr *ma, int mask);
318 int mdd_capa_get(const struct lu_env *env, struct md_object *obj,
319                  struct lustre_capa *capa, int renewal);
320
321 static inline int lu_device_is_mdd(struct lu_device *d)
322 {
323         return ergo(d != NULL && d->ld_ops != NULL, d->ld_ops == &mdd_lu_ops);
324 }
325
326 static inline struct mdd_device* lu2mdd_dev(struct lu_device *d)
327 {
328         LASSERT(lu_device_is_mdd(d));
329         return container_of0(d, struct mdd_device, mdd_md_dev.md_lu_dev);
330 }
331
332 static inline struct lu_device *mdd2lu_dev(struct mdd_device *d)
333 {
334         return (&d->mdd_md_dev.md_lu_dev);
335 }
336
337 static inline struct mdd_object *lu2mdd_obj(struct lu_object *o)
338 {
339         LASSERT(ergo(o != NULL, lu_device_is_mdd(o->lo_dev)));
340         return container_of0(o, struct mdd_object, mod_obj.mo_lu);
341 }
342
343 static inline struct mdd_device* mdo2mdd(struct md_object *mdo)
344 {
345         return lu2mdd_dev(mdo->mo_lu.lo_dev);
346 }
347
348 static inline struct mdd_object* md2mdd_obj(struct md_object *mdo)
349 {
350         return container_of0(mdo, struct mdd_object, mod_obj);
351 }
352
353 static inline struct dt_device_operations *mdd_child_ops(struct mdd_device *d)
354 {
355         return d->mdd_child->dd_ops;
356 }
357
358 static inline struct lu_object *mdd2lu_obj(struct mdd_object *obj)
359 {
360         return &obj->mod_obj.mo_lu;
361 }
362
363 static inline struct dt_object* mdd_object_child(struct mdd_object *o)
364 {
365         return container_of0(lu_object_next(mdd2lu_obj(o)),
366                              struct dt_object, do_lu);
367 }
368
369 static inline struct obd_device *mdd2obd_dev(struct mdd_device *mdd)
370 {
371         return mdd->mdd_obd_dev;
372 }
373
374 static inline struct mdd_device *mdd_obj2mdd_dev(struct mdd_object *obj)
375 {
376         return mdo2mdd(&obj->mod_obj);
377 }
378
379 static inline const struct lu_fid *mdo2fid(const struct mdd_object *obj)
380 {
381         return lu_object_fid(&obj->mod_obj.mo_lu);
382 }
383
384 static inline umode_t mdd_object_type(const struct mdd_object *obj)
385 {
386         return lu_object_attr(&obj->mod_obj.mo_lu);
387 }
388
389 static inline int mdd_lov_mdsize(const struct lu_env *env,
390                                  struct mdd_device *mdd)
391 {
392         struct obd_device *obd = mdd2obd_dev(mdd);
393         return obd->u.mds.mds_max_mdsize;
394 }
395
396 static inline int mdd_lov_cookiesize(const struct lu_env *env,
397                                      struct mdd_device *mdd)
398 {
399         struct obd_device *obd = mdd2obd_dev(mdd);
400         return obd->u.mds.mds_max_cookiesize;
401 }
402
403 static inline int mdd_is_immutable(struct mdd_object *obj)
404 {
405         return obj->mod_flags & IMMUTE_OBJ;
406 }
407
408 static inline int mdd_is_dead_obj(struct mdd_object *obj)
409 {
410         return obj && obj->mod_flags & DEAD_OBJ;
411 }
412
413 static inline int mdd_is_append(struct mdd_object *obj)
414 {
415         return obj->mod_flags & APPEND_OBJ;
416 }
417
418 static inline int mdd_object_exists(struct mdd_object *obj)
419 {
420         return lu_object_exists(mdd2lu_obj(obj));
421 }
422
423 static inline const struct lu_fid *mdd_object_fid(struct mdd_object *obj)
424 {
425         return lu_object_fid(mdd2lu_obj(obj));
426 }
427
428 static inline struct lustre_capa *mdd_object_capa(const struct lu_env *env,
429                                                   const struct mdd_object *obj)
430 {
431         struct md_capainfo *ci = md_capainfo(env);
432         const struct lu_fid *fid = mdo2fid(obj);
433         int i;
434
435         /* NB: in mdt_init0 */
436         if (!ci)
437                 return BYPASS_CAPA;
438         for (i = 0; i < MD_CAPAINFO_MAX; i++)
439                 if (ci->mc_fid[i] && lu_fid_eq(ci->mc_fid[i], fid))
440                         return ci->mc_capa[i];
441         return NULL;
442 }
443
444 static inline void mdd_set_capainfo(const struct lu_env *env, int offset,
445                                     const struct mdd_object *obj,
446                                     struct lustre_capa *capa)
447 {
448         struct md_capainfo *ci = md_capainfo(env);
449         const struct lu_fid *fid = mdo2fid(obj);
450
451         LASSERT(offset >= 0 && offset <= MD_CAPAINFO_MAX);
452         /* NB: in mdt_init0 */
453         if (!ci)
454                 return;
455         ci->mc_fid[offset]  = fid;
456         ci->mc_capa[offset] = capa;
457 }
458
459 enum {
460         LPROC_MDD_NR
461 };
462
463 static inline int mdd_permission_internal(const struct lu_env *env,
464                                           struct mdd_object *obj,
465                                           struct lu_attr *la, int mask)
466 {
467         return __mdd_permission_internal(env, obj, la, mask, 0);
468 }
469
470 static inline int mdd_permission_internal_locked(const struct lu_env *env,
471                                                  struct mdd_object *obj,
472                                                  struct lu_attr *la, int mask)
473 {
474         return __mdd_permission_internal(env, obj, la, mask, 1);
475 }
476
477 /* mdd inline func for calling osd_dt_object ops */
478 static inline int mdo_attr_get(const struct lu_env *env, struct mdd_object *obj,
479                                struct lu_attr *la, struct lustre_capa *capa)
480 {
481         struct dt_object *next = mdd_object_child(obj);
482         return next->do_ops->do_attr_get(env, next, la, capa);
483 }
484
485 static inline int mdo_attr_set(const struct lu_env *env, struct mdd_object *obj,
486                                const struct lu_attr *la, struct thandle *handle,
487                                struct lustre_capa *capa)
488 {
489         struct dt_object *next = mdd_object_child(obj);
490         LASSERT(mdd_object_exists(obj));
491         return next->do_ops->do_attr_set(env, next, la, handle, capa);
492 }
493
494 static inline int mdo_xattr_get(const struct lu_env *env,struct mdd_object *obj,
495                                 struct lu_buf *buf, const char *name,
496                                 struct lustre_capa *capa)
497 {
498         struct dt_object *next = mdd_object_child(obj);
499         return next->do_ops->do_xattr_get(env, next, buf, name, capa);
500 }
501
502 static inline int mdo_xattr_set(const struct lu_env *env,struct mdd_object *obj,
503                                 const struct lu_buf *buf, const char *name,
504                                 int fl, struct thandle *handle, 
505                                 struct lustre_capa *capa)
506 {
507         struct dt_object *next = mdd_object_child(obj);
508         LASSERT(mdd_object_exists(obj));
509         return next->do_ops->do_xattr_set(env, next, buf, name, fl, handle,
510                                           capa);
511 }
512
513 static inline int mdo_xattr_del(const struct lu_env *env,struct mdd_object *obj,
514                                 const char *name, struct thandle *handle,
515                                 struct lustre_capa *capa)
516 {
517         struct dt_object *next = mdd_object_child(obj);
518         LASSERT(mdd_object_exists(obj));
519         return next->do_ops->do_xattr_del(env, next, name, handle, capa);
520 }
521
522 static inline 
523 int mdo_xattr_list(const struct lu_env *env, struct mdd_object *obj,
524                    struct lu_buf *buf, struct lustre_capa *capa)
525 {
526         struct dt_object *next = mdd_object_child(obj);
527         LASSERT(mdd_object_exists(obj));
528         return next->do_ops->do_xattr_list(env, next, buf, capa);
529 }
530
531 static inline 
532 int mdo_index_try(const struct lu_env *env, struct mdd_object *obj,
533                                  const struct dt_index_features *feat)
534 {
535         struct dt_object *next = mdd_object_child(obj);
536         return next->do_ops->do_index_try(env, next, feat);
537 }
538
539 static inline void mdo_ref_add(const struct lu_env *env, struct mdd_object *obj,
540                                struct thandle *handle)
541 {
542         struct dt_object *next = mdd_object_child(obj);
543         LASSERT(mdd_object_exists(obj));
544         return next->do_ops->do_ref_add(env, next, handle);
545 }
546
547 static inline void mdo_ref_del(const struct lu_env *env, struct mdd_object *obj,
548                                struct thandle *handle)
549 {
550         struct dt_object *next = mdd_object_child(obj);
551         LASSERT(mdd_object_exists(obj));
552         return next->do_ops->do_ref_del(env, next, handle);
553 }
554
555 static inline 
556 int mdo_create_obj(const struct lu_env *env, struct mdd_object *o, 
557                    struct lu_attr *attr,
558                    struct dt_allocation_hint *hint,
559                    struct thandle *handle)
560 {
561         struct dt_object *next = mdd_object_child(o);
562         return next->do_ops->do_create(env, next, attr, hint, handle);
563 }
564
565 static inline struct obd_capa *mdo_capa_get(const struct lu_env *env,
566                                             struct mdd_object *obj, 
567                                             struct lustre_capa *old,
568                                             __u32 uid, __u64 opc)
569 {
570         struct dt_object *next = mdd_object_child(obj);
571         LASSERT(mdd_object_exists(obj));
572         return next->do_ops->do_capa_get(env, next, old, uid, opc);
573 }
574
575 #endif