-#if 0
-static int llu_create_obj(struct lustre_handle *conn, struct inode *inode,
- struct lov_stripe_md *lsm)
-{
- struct ptlrpc_request *req = NULL;
- struct llu_inode_info *lli = llu_i2info(inode);
- struct lov_mds_md *lmm = NULL;
- struct obdo *oa;
- struct iattr iattr;
- struct mdc_op_data op_data;
- struct obd_trans_info oti = { 0 };
- int rc, err, lmm_size = 0;;
- ENTRY;
-
- oa = obdo_alloc();
- if (!oa)
- RETURN(-ENOMEM);
-
- LASSERT(S_ISREG(inode->i_mode));
- oa->o_mode = S_IFREG | 0600;
- oa->o_id = lli->lli_st_ino;
- oa->o_generation = lli->lli_st_generation;
- /* Keep these 0 for now, because chown/chgrp does not change the
- * ownership on the OST, and we don't want to allow BA OST NFS
- * users to access these objects by mistake.
- */
- oa->o_uid = 0;
- oa->o_gid = 0;
- oa->o_valid = OBD_MD_FLID | OBD_MD_FLGENER | OBD_MD_FLTYPE |
- OBD_MD_FLMODE | OBD_MD_FLUID | OBD_MD_FLGID;
-
- obdo_from_inode(oa, inode, OBD_MD_FLTYPE|OBD_MD_FLATIME|OBD_MD_FLMTIME|
- OBD_MD_FLCTIME |
- (llu_i2info(inode)->lli_st_size ? OBD_MD_FLSIZE : 0));
-
- rc = obd_create(conn, oa, &lsm, &oti);
- if (rc) {
- CERROR("error creating objects for inode %lu: rc = %d\n",
- lli->lli_st_ino, rc);
- if (rc > 0) {
- CERROR("obd_create returned invalid rc %d\n", rc);
- rc = -EIO;
- }
- GOTO(out_oa, rc);
- }
- obdo_refresh_inode(inode, oa, OBD_MD_FLBLKSZ);
-
- LASSERT(lsm && lsm->lsm_object_id);
- rc = obd_packmd(conn, &lmm, lsm);
- if (rc < 0)
- GOTO(out_destroy, rc);
-
- lmm_size = rc;
-
- /* Save the stripe MD with this file on the MDS */
- memset(&iattr, 0, sizeof(iattr));
- iattr.ia_valid = ATTR_FROM_OPEN;
-
- llu_prepare_mdc_op_data(&op_data, inode, NULL, NULL, 0, 0);
-
- rc = mdc_setattr(&llu_i2sbi(inode)->ll_mdc_conn, &op_data,
- &iattr, lmm, lmm_size, oti.oti_logcookies,
- oti.oti_numcookies * sizeof(oti.oti_onecookie), &req);
- ptlrpc_req_finished(req);
-
- obd_free_diskmd(conn, &lmm);
-
- /* If we couldn't complete mdc_open() and store the stripe MD on the
- * MDS, we need to destroy the objects now or they will be leaked.
- */
- if (rc) {
- CERROR("error: storing stripe MD for %lu: rc %d\n",
- lli->lli_st_ino, rc);
- GOTO(out_destroy, rc);
- }
- lli->lli_smd = lsm;
- lli->lli_maxbytes = lsm->lsm_maxbytes;
-
- EXIT;
-out_oa:
- oti_free_cookies(&oti);
- obdo_free(oa);
- return rc;
-
-out_destroy:
- oa->o_id = lsm->lsm_object_id;
- oa->o_valid = OBD_MD_FLID;
- obdo_from_inode(oa, inode, OBD_MD_FLTYPE);
-
- err = obd_destroy(conn, oa, lsm, NULL);
- obd_free_memmd(conn, &lsm);
- if (err) {
- CERROR("error uncreating inode %lu objects: rc %d\n",
- lli->lli_st_ino, err);
- }
- goto out_oa;
-}
-#endif
-
-static int llu_local_open(struct llu_inode_info *lli, struct lookup_intent *it)