diff options
author | M. Mohan Kumar <mohan@in.ibm.com> | 2010-06-22 12:29:41 +0530 |
---|---|---|
committer | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2010-09-08 22:56:41 +0530 |
commit | c7b4b0b302709928b84582881a7b4fb6c1e39e2b (patch) | |
tree | 8c1e706df06ab066b70f4fc9297bbca1305fd25f /hw/virtio-9p.h | |
parent | b67592ea567dd8d19c4274eb35580e5922783c89 (diff) |
rename - change name of file or directory
size[4] Trename tag[2] fid[4] newdirfid[4] name[s]
size[4] Rrename tag[2]
Implement the 2000.L rename operation. A new function
v9fs_complete_rename is introduced that acts as a common entry point
for 2000.L rename operation and 2000.U rename opearation (via wstat).
As part of this change the field 'nname' (used only for rename) is
removed from the structure V9fsWstatState. Instead a new structure
V9fsRenameState is used for rename operations both by 2000.U and 2000.L
code paths. Both 2000.U and 2000.L rename code paths construct the
V9fsRenameState structure and passes that to v9fs_complete_rename
function.
Changes from previous version:
Use qemu_mallocz to initialize
Use strcpy,strcat functions instead of memcpy
Changed the variable name to newdirfid
Introduced post rename function
Error checking
Removed nname field from V9fsWstatState
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Diffstat (limited to 'hw/virtio-9p.h')
-rw-r--r-- | hw/virtio-9p.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/hw/virtio-9p.h b/hw/virtio-9p.h index 91cc0aed0f..4d179b7fee 100644 --- a/hw/virtio-9p.h +++ b/hw/virtio-9p.h @@ -21,6 +21,8 @@ enum { P9_RSYMLINK, P9_TMKNOD = 18, P9_RMKNOD, + P9_TRENAME = 20, + P9_RRENAME, P9_TGETATTR = 24, P9_RGETATTR, P9_TSETATTR = 26, @@ -310,7 +312,6 @@ typedef struct V9fsWstatState V9fsStat v9stat; V9fsFidState *fidp; struct stat stbuf; - V9fsString nname; } V9fsWstatState; typedef struct V9fsSymlinkState @@ -385,6 +386,14 @@ typedef struct V9fsMkState { V9fsString fullname; } V9fsMkState; +typedef struct V9fsRenameState { + V9fsPDU *pdu; + V9fsFidState *fidp; + size_t offset; + int32_t newdirfid; + V9fsString name; +} V9fsRenameState; + extern size_t pdu_packunpack(void *addr, struct iovec *sg, int sg_count, size_t offset, size_t size, int pack); |