X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fobdclass%2Fobdo.c;h=e9c0b6c2e6c1eb532dd6d768a5946e343efeb378;hb=8c95bfb0140ca5aadd3fe73a4f69d6b2373cc066;hp=9da24053afb34f85cda64215288dd9eb3568aaa0;hpb=f95393b0d0a59cf3dc2f29cffc35dcc4cc9d7728;p=fs%2Flustre-release.git diff --git a/lustre/obdclass/obdo.c b/lustre/obdclass/obdo.c index 9da2405..e9c0b6c 100644 --- a/lustre/obdclass/obdo.c +++ b/lustre/obdclass/obdo.c @@ -1,6 +1,4 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - * +/* * GPL HEADER START * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,6 +26,8 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. + * + * Copyright (c) 2012, Whamcloud, Inc. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -41,9 +41,6 @@ */ #define DEBUG_SUBSYSTEM S_CLASS -#ifndef EXPORT_SYMTAB -# define EXPORT_SYMTAB -#endif #ifndef __KERNEL__ #include "../liblustre/llite_lib.h" @@ -52,18 +49,18 @@ #include #endif -static void obdo_set_parent_fid(struct obdo *dst, struct lu_fid *parent) +void obdo_set_parent_fid(struct obdo *dst, const struct lu_fid *parent) { dst->o_parent_oid = fid_oid(parent); dst->o_parent_seq = fid_seq(parent); dst->o_parent_ver = fid_ver(parent); dst->o_valid |= OBD_MD_FLGENER | OBD_MD_FLFID; } +EXPORT_SYMBOL(obdo_set_parent_fid); /* WARNING: the file systems must take care not to tinker with attributes they don't manage (such as blocks). */ -void obdo_from_inode(struct obdo *dst, struct inode *src, struct lu_fid *parent, - obd_flag valid) +void obdo_from_inode(struct obdo *dst, struct inode *src, obd_flag valid) { obd_flag newvalid = 0; @@ -85,7 +82,7 @@ void obdo_from_inode(struct obdo *dst, struct inode *src, struct lu_fid *parent, newvalid |= OBD_MD_FLCTIME; } if (valid & OBD_MD_FLSIZE) { - dst->o_size = src->i_size; + dst->o_size = i_size_read(src); newvalid |= OBD_MD_FLSIZE; } if (valid & OBD_MD_FLBLOCKS) { /* allocation of space (x512 bytes) */ @@ -118,8 +115,6 @@ void obdo_from_inode(struct obdo *dst, struct inode *src, struct lu_fid *parent, dst->o_flags = ll_inode_flags(src); newvalid |= OBD_MD_FLFLAGS; } - if (parent) - obdo_set_parent_fid(dst, parent); dst->o_valid |= newvalid; } EXPORT_SYMBOL(obdo_from_inode);