* vim:expandtab:shiftwidth=8:tabstop=8:
*
* lustre lite cluster file system
- *
+ *
* This code is issued under the GNU General Public License.
* See the file COPYING in this distribution
- *
+ *
* Copyright (C) 2002 Cluster File Systems, Inc. <info@clusterfs.com>
*/
struct lustre_handle ll_mdc_conn;
struct lustre_handle ll_osc_conn;
obd_id ll_rootino; /* number of root inode */
-
+
int ll_flags;
wait_queue_head_t ll_commitcbd_waitq;
wait_queue_head_t ll_commitcbd_ctl_waitq;
/* rw.c */
struct page *ll_getpage(struct inode *inode, unsigned long offset,
- int create, int locked);
+ int create, int locked);
void ll_truncate(struct inode *inode);
+/* super.c */
+void ll_update_inode(struct inode *, struct mds_body *);
+
/* symlink.c */
extern struct inode_operations ll_fast_symlink_inode_operations;
extern struct inode_operations ll_symlink_inode_operations;
oa.o_id = lsm->lsm_object_id;
oa.o_mode = S_IFREG;
- oa.o_valid = OBD_MD_FLID|OBD_MD_FLMODE|OBD_MD_FLSIZE|OBD_MD_FLBLOCKS;
+ oa.o_valid = OBD_MD_FLID|OBD_MD_FLSIZE|OBD_MD_FLBLOCKS;
rc = obd_getattr(&sbi->ll_osc_conn, &oa, lsm);
if (!rc)
obdo_to_inode(inode, &oa, oa.o_valid);
static int ll_find_inode(struct inode *inode, unsigned long ino, void *opaque)
{
struct ll_read_inode2_cookie *lic = opaque;
+ struct mds_body *body = lic->lic_body;
if (inode->i_generation != lic->lic_body->generation)
return 0;
+ /* Apply the attributes in 'opaque' to this inode */
+ ll_update_inode(inode, body);
+
return 1;
}
RETURN(rc);
}
-static void ll_read_inode2(struct inode *inode, void *opaque)
+void ll_update_inode(struct inode *inode, struct mds_body *body)
{
- struct ll_read_inode2_cookie *lic = opaque;
- struct mds_body *body = lic->lic_body;
- struct ll_inode_info *lli = ll_i2info(inode);
- ENTRY;
-
- sema_init(&lli->lli_open_sem, 1);
-
- /* core attributes first */
if (body->valid & OBD_MD_FLID)
inode->i_ino = body->ino;
if (body->valid & OBD_MD_FLATIME)
inode->i_rdev = body->extra;
if (body->valid & OBD_MD_FLSIZE)
inode->i_size = body->size;
+}
+
+static void ll_read_inode2(struct inode *inode, void *opaque)
+{
+ struct ll_read_inode2_cookie *lic = opaque;
+ struct mds_body *body = lic->lic_body;
+ struct ll_inode_info *lli = ll_i2info(inode);
+ ENTRY;
+
+ sema_init(&lli->lli_open_sem, 1);
+
+ /* core attributes first */
+ ll_update_inode(inode, body);
//if (body->valid & OBD_MD_FLEASIZE)
if (lic && lic->lic_lmm) {
init_special_inode(inode, inode->i_mode, inode->i_rdev);
EXIT;
}
-
- return;
}
/* exported operations */