Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
LU-911 osd: support for legacy OST objects in ldiskfs osd
[fs/lustre-release.git]
/
lustre
/
osd-ldiskfs
/
osd_oi.c
diff --git
a/lustre/osd-ldiskfs/osd_oi.c
b/lustre/osd-ldiskfs/osd_oi.c
index
c1ce0a6
..
0918c75
100644
(file)
--- a/
lustre/osd-ldiskfs/osd_oi.c
+++ b/
lustre/osd-ldiskfs/osd_oi.c
@@
-444,17
+444,28
@@
int osd_oi_lookup(struct osd_thread_info *info, struct osd_device *osd,
{
struct lu_fid *oi_fid = &info->oti_fid;
const struct dt_key *key;
- int rc
= 0;
+ int rc = 0;
- if (osd_fid_is_igif(fid)) {
+ if (fid_is_idif(fid) || fid_seq(fid) == FID_SEQ_LLOG) {
+ /* old OSD obj id */
+ rc = osd_compat_objid_lookup(info, osd, fid, id);
+ } else if (fid_is_igif(fid)) {
lu_igif_to_id(fid, id);
rc = 0;
+ } else if (fid_is_fs_root(fid)) {
+ struct inode *inode = osd_sb(osd)->s_root->d_inode;
+
+ id->oii_ino = inode->i_ino;
+ id->oii_gen = inode->i_generation;
} else {
- if (!fid_is_norm(fid))
- return -ENOENT;
+ if (unlikely(fid_seq(fid) == FID_SEQ_LOCAL_FILE)) {
+ rc = osd_compat_spec_lookup(info, osd, fid, id);
+ if (rc == 0 || rc != -ERESTART)
+ goto out;
+ }
fid_cpu_to_be(oi_fid, fid);
- key = (struct dt_key *)
oi_fid;
+ key = (struct dt_key *)oi_fid;
rc = osd_oi_iam_lookup(info, osd_fid2oi(osd, fid),
(struct dt_rec *)id, key);
@@
-467,6
+478,8
@@
int osd_oi_lookup(struct osd_thread_info *info, struct osd_device *osd,
rc = -ENOENT;
}
}
+
+out:
return rc;
}
@@
-524,9
+537,16
@@
int osd_oi_insert(struct osd_thread_info *info, struct osd_device *osd,
struct osd_inode_id *id;
const struct dt_key *key;
- if (
!fid_is_norm
(fid))
+ if (
fid_is_igif
(fid))
return 0;
+ if (fid_is_idif(fid) || fid_seq(fid) == FID_SEQ_LLOG)
+ return osd_compat_objid_insert(info, osd, fid, id0, th);
+
+ /* notice we don't return immediately, but continue to get into OI */
+ if (unlikely(fid_seq(fid) == FID_SEQ_LOCAL_FILE))
+ osd_compat_spec_insert(info, osd, fid, id0, th);
+
fid_cpu_to_be(oi_fid, fid);
key = (struct dt_key *)oi_fid;
@@
-574,6
+594,11
@@
int osd_oi_delete(struct osd_thread_info *info,
if (!fid_is_norm(fid))
return 0;
+ LASSERT(fid_seq(fid) != FID_SEQ_LOCAL_FILE);
+
+ if (fid_is_idif(fid) || fid_seq(fid) == FID_SEQ_LLOG)
+ return osd_compat_objid_delete(info, osd, fid, th);
+
fid_cpu_to_be(oi_fid, fid);
key = (struct dt_key *)oi_fid;