Whamcloud - gitweb
LU-3467 ofd: use unified handler for OST requests
[fs/lustre-release.git] / lustre / ofd / ofd_io.c
1 /*
2  * GPL HEADER START
3  *
4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5  *
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.
9  *
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).
15  *
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.sun.com/software/products/lustre/docs/GPLv2.pdf
19  *
20  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
21  * CA 95054 USA or visit www.sun.com if you need additional information or
22  * have any questions.
23  *
24  * GPL HEADER END
25  */
26 /*
27  * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
28  * Use is subject to license terms.
29  *
30  * Copyright (c) 2012, 2013, Intel Corporation.
31  */
32 /*
33  * This file is part of Lustre, http://www.lustre.org/
34  * Lustre is a trademark of Sun Microsystems, Inc.
35  *
36  * lustre/ofd/ofd_io.c
37  *
38  * Author: Alex Tomas <bzzz@whamcloud.com>
39  */
40
41 #define DEBUG_SUBSYSTEM S_FILTER
42
43 #include "ofd_internal.h"
44
45 static int ofd_preprw_read(const struct lu_env *env, struct obd_export *exp,
46                            struct ofd_device *ofd, struct lu_fid *fid,
47                            struct lu_attr *la, int niocount,
48                            struct niobuf_remote *rnb, int *nr_local,
49                            struct niobuf_local *lnb, char *jobid)
50 {
51         struct ofd_object       *fo;
52         int                      i, j, rc, tot_bytes = 0;
53
54         ENTRY;
55         LASSERT(env != NULL);
56
57         fo = ofd_object_find(env, ofd, fid);
58         if (IS_ERR(fo))
59                 RETURN(PTR_ERR(fo));
60         LASSERT(fo != NULL);
61
62         ofd_read_lock(env, fo);
63         if (!ofd_object_exists(fo))
64                 GOTO(unlock, rc = -ENOENT);
65
66         /* parse remote buffers to local buffers and prepare the latter */
67         *nr_local = 0;
68         for (i = 0, j = 0; i < niocount; i++) {
69                 rc = dt_bufs_get(env, ofd_object_child(fo), rnb + i,
70                                  lnb + j, 0, ofd_object_capa(env, fo));
71                 if (unlikely(rc < 0))
72                         GOTO(buf_put, rc);
73                 LASSERT(rc <= PTLRPC_MAX_BRW_PAGES);
74                 /* correct index for local buffers to continue with */
75                 j += rc;
76                 *nr_local += rc;
77                 LASSERT(j <= PTLRPC_MAX_BRW_PAGES);
78                 tot_bytes += rnb[i].rnb_len;
79         }
80
81         LASSERT(*nr_local > 0 && *nr_local <= PTLRPC_MAX_BRW_PAGES);
82         rc = dt_attr_get(env, ofd_object_child(fo), la,
83                          ofd_object_capa(env, fo));
84         if (unlikely(rc))
85                 GOTO(buf_put, rc);
86
87         rc = dt_read_prep(env, ofd_object_child(fo), lnb, *nr_local);
88         if (unlikely(rc))
89                 GOTO(buf_put, rc);
90
91         ofd_counter_incr(exp, LPROC_OFD_STATS_READ, jobid, tot_bytes);
92         RETURN(0);
93
94 buf_put:
95         dt_bufs_put(env, ofd_object_child(fo), lnb, *nr_local);
96 unlock:
97         ofd_read_unlock(env, fo);
98         ofd_object_put(env, fo);
99         return rc;
100 }
101
102 static int ofd_preprw_write(const struct lu_env *env, struct obd_export *exp,
103                             struct ofd_device *ofd, struct lu_fid *fid,
104                             struct lu_attr *la, struct obdo *oa,
105                             int objcount, struct obd_ioobj *obj,
106                             struct niobuf_remote *rnb, int *nr_local,
107                             struct niobuf_local *lnb, char *jobid)
108 {
109         struct ofd_object       *fo;
110         int                      i, j, k, rc = 0, tot_bytes = 0;
111
112         ENTRY;
113         LASSERT(env != NULL);
114         LASSERT(objcount == 1);
115
116         if (unlikely(exp->exp_obd->obd_recovering)) {
117                 struct ofd_thread_info *info = ofd_info(env);
118
119                 /* copied from ofd_precreate_object */
120                 /* XXX this should be consolidated to use the same code
121                  *     instead of a copy, due to the ongoing risk of bugs. */
122                 memset(&info->fti_attr, 0, sizeof(info->fti_attr));
123                 info->fti_attr.la_valid = LA_TYPE | LA_MODE;
124                 info->fti_attr.la_mode = S_IFREG | S_ISUID | S_ISGID | 0666;
125                 info->fti_attr.la_valid |= LA_ATIME | LA_MTIME | LA_CTIME;
126                 /* Initialize a/c/m time so any client timestamp will always
127                  * be newer and update the inode. ctime = 0 is also handled
128                  * specially in osd_inode_setattr().  See LU-221, LU-1042 */
129                 info->fti_attr.la_atime = 0;
130                 info->fti_attr.la_mtime = 0;
131                 info->fti_attr.la_ctime = 0;
132
133                 fo = ofd_object_find_or_create(env, ofd, fid, &info->fti_attr);
134         } else {
135                 fo = ofd_object_find(env, ofd, fid);
136         }
137
138         if (IS_ERR(fo))
139                 GOTO(out, rc = PTR_ERR(fo));
140         LASSERT(fo != NULL);
141
142         ofd_read_lock(env, fo);
143         if (!ofd_object_exists(fo)) {
144                 CERROR("%s: BRW to missing obj "DOSTID"\n",
145                        exp->exp_obd->obd_name, POSTID(&obj->ioo_oid));
146                 ofd_read_unlock(env, fo);
147                 ofd_object_put(env, fo);
148                 GOTO(out, rc = -ENOENT);
149         }
150
151         /* Process incoming grant info, set OBD_BRW_GRANTED flag and grant some
152          * space back if possible */
153         ofd_grant_prepare_write(env, exp, oa, rnb, obj->ioo_bufcnt);
154
155         /* parse remote buffers to local buffers and prepare the latter */
156         *nr_local = 0;
157         for (i = 0, j = 0; i < obj->ioo_bufcnt; i++) {
158                 rc = dt_bufs_get(env, ofd_object_child(fo),
159                                  rnb + i, lnb + j, 1,
160                                  ofd_object_capa(env, fo));
161                 if (unlikely(rc < 0))
162                         GOTO(err, rc);
163                 LASSERT(rc <= PTLRPC_MAX_BRW_PAGES);
164                 /* correct index for local buffers to continue with */
165                 for (k = 0; k < rc; k++) {
166                         lnb[j+k].lnb_flags = rnb[i].rnb_flags;
167                         if (!(rnb[i].rnb_flags & OBD_BRW_GRANTED))
168                                 lnb[j+k].lnb_rc = -ENOSPC;
169                         /* remote client can't break through quota */
170                         if (exp_connect_rmtclient(exp))
171                                 lnb[j+k].lnb_flags &= ~OBD_BRW_NOQUOTA;
172                 }
173                 j += rc;
174                 *nr_local += rc;
175                 LASSERT(j <= PTLRPC_MAX_BRW_PAGES);
176                 tot_bytes += rnb[i].rnb_len;
177         }
178         LASSERT(*nr_local > 0 && *nr_local <= PTLRPC_MAX_BRW_PAGES);
179
180         rc = dt_write_prep(env, ofd_object_child(fo), lnb, *nr_local);
181         if (unlikely(rc != 0))
182                 GOTO(err, rc);
183
184         ofd_counter_incr(exp, LPROC_OFD_STATS_WRITE, jobid, tot_bytes);
185         RETURN(0);
186 err:
187         dt_bufs_put(env, ofd_object_child(fo), lnb, *nr_local);
188         ofd_read_unlock(env, fo);
189         /* ofd_grant_prepare_write() was called, so we must commit */
190         ofd_grant_commit(env, exp, rc);
191 out:
192         /* let's still process incoming grant information packed in the oa,
193          * but without enforcing grant since we won't proceed with the write.
194          * Just like a read request actually. */
195         ofd_grant_prepare_read(env, exp, oa);
196         return rc;
197 }
198
199 int ofd_preprw(const struct lu_env *env, int cmd, struct obd_export *exp,
200                struct obdo *oa, int objcount, struct obd_ioobj *obj,
201                struct niobuf_remote *rnb, int *nr_local,
202                struct niobuf_local *lnb, struct obd_trans_info *oti,
203                struct lustre_capa *capa)
204 {
205         struct tgt_session_info *tsi = tgt_ses_info(env);
206         struct ofd_device       *ofd = ofd_exp(exp);
207         struct ofd_thread_info  *info;
208         char                    *jobid;
209         int                      rc = 0;
210
211         if (*nr_local > PTLRPC_MAX_BRW_PAGES) {
212                 CERROR("%s: bulk has too many pages %d, which exceeds the"
213                        "maximum pages per RPC of %d\n",
214                        exp->exp_obd->obd_name, *nr_local, PTLRPC_MAX_BRW_PAGES);
215                 RETURN(-EPROTO);
216         }
217
218         if (tgt_ses_req(tsi) == NULL) { /* echo client case */
219                 LASSERT(oti != NULL);
220                 lu_env_refill((struct lu_env *)env);
221                 info = ofd_info_init(env, exp);
222                 ofd_oti2info(info, oti);
223                 jobid = oti->oti_jobid;
224         } else {
225                 info = tsi2ofd_info(tsi);
226                 jobid = tsi->tsi_jobid;
227         }
228
229         LASSERT(oa != NULL);
230
231         if (OBD_FAIL_CHECK(OBD_FAIL_OST_ENOENT)) {
232                 struct ofd_seq          *oseq;
233
234                 oseq = ofd_seq_load(env, ofd, ostid_seq(&oa->o_oi));
235                 if (IS_ERR(oseq)) {
236                         CERROR("%s: Can not find seq for "DOSTID
237                                ": rc = %ld\n", ofd_name(ofd), POSTID(&oa->o_oi),
238                                PTR_ERR(oseq));
239                         RETURN(-EINVAL);
240                 }
241
242                 if (oseq->os_destroys_in_progress == 0) {
243                         /* don't fail lookups for orphan recovery, it causes
244                          * later LBUGs when objects still exist during
245                          * precreate */
246                         ofd_seq_put(env, oseq);
247                         RETURN(-ENOENT);
248                 }
249                 ofd_seq_put(env, oseq);
250         }
251
252         LASSERT(objcount == 1);
253         LASSERT(obj->ioo_bufcnt > 0);
254
255         rc = ostid_to_fid(&info->fti_fid, &oa->o_oi, 0);
256         if (unlikely(rc != 0))
257                 RETURN(rc);
258
259         if (cmd == OBD_BRW_WRITE) {
260                 rc = ofd_auth_capa(exp, &info->fti_fid, ostid_seq(&oa->o_oi),
261                                    capa, CAPA_OPC_OSS_WRITE);
262                 if (rc == 0) {
263                         la_from_obdo(&info->fti_attr, oa, OBD_MD_FLGETATTR);
264                         rc = ofd_preprw_write(env, exp, ofd, &info->fti_fid,
265                                               &info->fti_attr, oa, objcount,
266                                               obj, rnb, nr_local, lnb, jobid);
267                 }
268         } else if (cmd == OBD_BRW_READ) {
269                 rc = ofd_auth_capa(exp, &info->fti_fid, ostid_seq(&oa->o_oi),
270                                    capa, CAPA_OPC_OSS_READ);
271                 if (rc == 0) {
272                         ofd_grant_prepare_read(env, exp, oa);
273                         rc = ofd_preprw_read(env, exp, ofd, &info->fti_fid,
274                                              &info->fti_attr, obj->ioo_bufcnt,
275                                              rnb, nr_local, lnb, jobid);
276                         obdo_from_la(oa, &info->fti_attr, LA_ATIME);
277                 }
278         } else {
279                 CERROR("%s: wrong cmd %d received!\n",
280                        exp->exp_obd->obd_name, cmd);
281                 rc = -EPROTO;
282         }
283         RETURN(rc);
284 }
285
286 static int
287 ofd_commitrw_read(const struct lu_env *env, struct ofd_device *ofd,
288                   struct lu_fid *fid, int objcount, int niocount,
289                   struct niobuf_local *lnb)
290 {
291         struct ofd_object *fo;
292
293         ENTRY;
294
295         LASSERT(niocount > 0);
296
297         fo = ofd_object_find(env, ofd, fid);
298         if (IS_ERR(fo))
299                 RETURN(PTR_ERR(fo));
300         LASSERT(fo != NULL);
301         LASSERT(ofd_object_exists(fo));
302         dt_bufs_put(env, ofd_object_child(fo), lnb, niocount);
303
304         ofd_read_unlock(env, fo);
305         ofd_object_put(env, fo);
306         /* second put is pair to object_get in ofd_preprw_read */
307         ofd_object_put(env, fo);
308
309         RETURN(0);
310 }
311
312 static int
313 ofd_write_attr_set(const struct lu_env *env, struct ofd_device *ofd,
314                    struct ofd_object *ofd_obj, struct lu_attr *la,
315                    struct filter_fid *ff)
316 {
317         struct ofd_thread_info  *info = ofd_info(env);
318         __u64                    valid = la->la_valid;
319         int                      rc;
320         struct thandle          *th;
321         struct dt_object        *dt_obj;
322         int                      ff_needed = 0;
323
324         ENTRY;
325
326         LASSERT(la);
327
328         dt_obj = ofd_object_child(ofd_obj);
329         LASSERT(dt_obj != NULL);
330
331         la->la_valid &= LA_UID | LA_GID;
332
333         rc = ofd_attr_handle_ugid(env, ofd_obj, la, 0 /* !is_setattr */);
334         if (rc != 0)
335                 GOTO(out, rc);
336
337         if (ff != NULL) {
338                 rc = ofd_object_ff_check(env, ofd_obj);
339                 if (rc == -ENODATA)
340                         ff_needed = 1;
341                 else if (rc < 0)
342                         GOTO(out, rc);
343         }
344
345         if (!la->la_valid && !ff_needed)
346                 /* no attributes to set */
347                 GOTO(out, rc = 0);
348
349         th = ofd_trans_create(env, ofd);
350         if (IS_ERR(th))
351                 GOTO(out, rc = PTR_ERR(th));
352
353         if (la->la_valid) {
354                 rc = dt_declare_attr_set(env, dt_obj, la, th);
355                 if (rc)
356                         GOTO(out_tx, rc);
357         }
358
359         if (ff_needed) {
360                 info->fti_buf.lb_buf = ff;
361                 info->fti_buf.lb_len = sizeof(*ff);
362                 rc = dt_declare_xattr_set(env, dt_obj, &info->fti_buf,
363                                           XATTR_NAME_FID, 0, th);
364                 if (rc)
365                         GOTO(out_tx, rc);
366         }
367
368         /* We don't need a transno for this operation which will be re-executed
369          * anyway when the OST_WRITE (with a transno assigned) is replayed */
370         rc = dt_trans_start_local(env, ofd->ofd_osd , th);
371         if (rc)
372                 GOTO(out_tx, rc);
373
374         /* set uid/gid */
375         if (la->la_valid) {
376                 rc = dt_attr_set(env, dt_obj, la, th,
377                                  ofd_object_capa(env, ofd_obj));
378                 if (rc)
379                         GOTO(out_tx, rc);
380         }
381
382         /* set filter fid EA */
383         if (ff_needed) {
384                 rc = dt_xattr_set(env, dt_obj, &info->fti_buf, XATTR_NAME_FID,
385                                   0, th, BYPASS_CAPA);
386                 if (rc)
387                         GOTO(out_tx, rc);
388         }
389
390         EXIT;
391 out_tx:
392         dt_trans_stop(env, ofd->ofd_osd, th);
393 out:
394         la->la_valid = valid;
395         return rc;
396 }
397
398 static int
399 ofd_commitrw_write(const struct lu_env *env, struct ofd_device *ofd,
400                    struct lu_fid *fid, struct lu_attr *la,
401                    struct filter_fid *ff, int objcount,
402                    int niocount, struct niobuf_local *lnb, int old_rc)
403 {
404         struct ofd_thread_info  *info = ofd_info(env);
405         struct ofd_object       *fo;
406         struct dt_object        *o;
407         struct thandle          *th;
408         int                      rc = 0;
409         int                      retries = 0;
410         int                      i;
411
412         ENTRY;
413
414         LASSERT(objcount == 1);
415
416         fo = ofd_object_find(env, ofd, fid);
417         LASSERT(fo != NULL);
418         LASSERT(ofd_object_exists(fo));
419
420         o = ofd_object_child(fo);
421         LASSERT(o != NULL);
422
423         if (old_rc)
424                 GOTO(out, rc = old_rc);
425
426         /*
427          * The first write to each object must set some attributes.  It is
428          * important to set the uid/gid before calling
429          * dt_declare_write_commit() since quota enforcement is now handled in
430          * declare phases.
431          */
432         rc = ofd_write_attr_set(env, ofd, fo, la, ff);
433         if (rc)
434                 GOTO(out, rc);
435
436         la->la_valid &= LA_ATIME | LA_MTIME | LA_CTIME;
437
438 retry:
439         th = ofd_trans_create(env, ofd);
440         if (IS_ERR(th))
441                 GOTO(out, rc = PTR_ERR(th));
442
443         th->th_sync |= ofd->ofd_syncjournal;
444         if (th->th_sync == 0) {
445                 for (i = 0; i < niocount; i++) {
446                         if (!(lnb[i].lnb_flags & OBD_BRW_ASYNC)) {
447                                 th->th_sync = 1;
448                                 break;
449                         }
450                 }
451         }
452
453         if (OBD_FAIL_CHECK(OBD_FAIL_OST_DQACQ_NET))
454                 GOTO(out_stop, rc = -EINPROGRESS);
455
456         rc = dt_declare_write_commit(env, o, lnb, niocount, th);
457         if (rc)
458                 GOTO(out_stop, rc);
459
460         if (la->la_valid) {
461                 /* update [mac]time if needed */
462                 rc = dt_declare_attr_set(env, o, la, th);
463                 if (rc)
464                         GOTO(out_stop, rc);
465         }
466
467         rc = ofd_trans_start(env, ofd, fo, th);
468         if (rc)
469                 GOTO(out_stop, rc);
470
471         rc = dt_write_commit(env, o, lnb, niocount, th);
472         if (rc)
473                 GOTO(out_stop, rc);
474
475         if (la->la_valid) {
476                 rc = dt_attr_set(env, o, la, th, ofd_object_capa(env, fo));
477                 if (rc)
478                         GOTO(out_stop, rc);
479         }
480
481         /* get attr to return */
482         rc = dt_attr_get(env, o, la, ofd_object_capa(env, fo));
483
484 out_stop:
485         /* Force commit to make the just-deleted blocks
486          * reusable. LU-456 */
487         if (rc == -ENOSPC)
488                 th->th_sync = 1;
489
490         ofd_trans_stop(env, ofd, th, rc);
491         if (rc == -ENOSPC && retries++ < 3) {
492                 CDEBUG(D_INODE, "retry after force commit, retries:%d\n",
493                        retries);
494                 goto retry;
495         }
496
497 out:
498         dt_bufs_put(env, o, lnb, niocount);
499         ofd_read_unlock(env, fo);
500         ofd_object_put(env, fo);
501         /* second put is pair to object_get in ofd_preprw_write */
502         ofd_object_put(env, fo);
503         ofd_grant_commit(env, info->fti_exp, old_rc);
504         RETURN(rc);
505 }
506
507 int ofd_commitrw(const struct lu_env *env, int cmd, struct obd_export *exp,
508                  struct obdo *oa, int objcount, struct obd_ioobj *obj,
509                  struct niobuf_remote *rnb, int npages,
510                  struct niobuf_local *lnb, struct obd_trans_info *oti,
511                  int old_rc)
512 {
513         struct ofd_thread_info  *info = ofd_info(env);
514         struct ofd_mod_data     *fmd;
515         __u64                    valid;
516         struct ofd_device       *ofd = ofd_exp(exp);
517         struct filter_fid       *ff = NULL;
518         int                      rc = 0;
519
520         LASSERT(npages > 0);
521
522         rc = ostid_to_fid(&info->fti_fid, &oa->o_oi, 0);
523         if (unlikely(rc != 0))
524                 RETURN(rc);
525         if (cmd == OBD_BRW_WRITE) {
526                 /* Don't update timestamps if this write is older than a
527                  * setattr which modifies the timestamps. b=10150 */
528
529                 /* XXX when we start having persistent reservations this needs
530                  * to be changed to ofd_fmd_get() to create the fmd if it
531                  * doesn't already exist so we can store the reservation handle
532                  * there. */
533                 valid = OBD_MD_FLUID | OBD_MD_FLGID;
534                 fmd = ofd_fmd_find(exp, &info->fti_fid);
535                 if (!fmd || fmd->fmd_mactime_xid < info->fti_xid)
536                         valid |= OBD_MD_FLATIME | OBD_MD_FLMTIME |
537                                  OBD_MD_FLCTIME;
538                 ofd_fmd_put(exp, fmd);
539                 la_from_obdo(&info->fti_attr, oa, valid);
540
541                 if (oa->o_valid & OBD_MD_FLFID) {
542                         ff = &info->fti_mds_fid;
543                         ofd_prepare_fidea(ff, oa);
544                 }
545
546                 rc = ofd_commitrw_write(env, ofd, &info->fti_fid,
547                                         &info->fti_attr, ff, objcount, npages,
548                                         lnb, old_rc);
549                 if (rc == 0)
550                         obdo_from_la(oa, &info->fti_attr,
551                                      OFD_VALID_FLAGS | LA_GID | LA_UID);
552                 else
553                         obdo_from_la(oa, &info->fti_attr, LA_GID | LA_UID);
554
555                 /* don't report overquota flag if we failed before reaching
556                  * commit */
557                 if (old_rc == 0 && (rc == 0 || rc == -EDQUOT)) {
558                         /* return the overquota flags to client */
559                         if (lnb[0].lnb_flags & OBD_BRW_OVER_USRQUOTA) {
560                                 if (oa->o_valid & OBD_MD_FLFLAGS)
561                                         oa->o_flags |= OBD_FL_NO_USRQUOTA;
562                                 else
563                                         oa->o_flags = OBD_FL_NO_USRQUOTA;
564                         }
565
566                         if (lnb[0].lnb_flags & OBD_BRW_OVER_GRPQUOTA) {
567                                 if (oa->o_valid & OBD_MD_FLFLAGS)
568                                         oa->o_flags |= OBD_FL_NO_GRPQUOTA;
569                                 else
570                                         oa->o_flags = OBD_FL_NO_GRPQUOTA;
571                         }
572
573                         oa->o_valid |= OBD_MD_FLFLAGS;
574                         oa->o_valid |= OBD_MD_FLUSRQUOTA | OBD_MD_FLGRPQUOTA;
575                 }
576         } else if (cmd == OBD_BRW_READ) {
577                 struct ldlm_namespace *ns = ofd->ofd_namespace;
578
579                 /* If oa != NULL then ofd_preprw_read updated the inode
580                  * atime and we should update the lvb so that other glimpses
581                  * will also get the updated value. bug 5972 */
582                 if (oa && ns && ns->ns_lvbo && ns->ns_lvbo->lvbo_update) {
583                          struct ldlm_resource *rs = NULL;
584
585                         ost_fid_build_resid(&info->fti_fid, &info->fti_resid);
586                         rs = ldlm_resource_get(ns, NULL, &info->fti_resid,
587                                                LDLM_EXTENT, 0);
588                         if (rs != NULL) {
589                                 ns->ns_lvbo->lvbo_update(rs, NULL, 1);
590                                 ldlm_resource_putref(rs);
591                         }
592                 }
593                 rc = ofd_commitrw_read(env, ofd, &info->fti_fid, objcount,
594                                        npages, lnb);
595                 if (old_rc)
596                         rc = old_rc;
597         } else {
598                 LBUG();
599                 rc = -EPROTO;
600         }
601
602         if (oti != NULL)
603                 ofd_info2oti(info, oti);
604         RETURN(rc);
605 }