From e06a765efbe3239d4b6148727a29342ab234180e Mon Sep 17 00:00:00 2001 From: Harsh Prateek Bora Date: Wed, 12 Oct 2011 19:11:25 +0530 Subject: hw/9pfs: Add st_gen support in getattr reply This patch use file system specific ioctl for getting i_generation value. Not all file system support the ioctl. So we add an export specific extended operation and assign right callback for the file system that support i_generation ioctl ["M. Mohan Kumar" we can do ioctl only for regular files and directories on the server] Signed-off-by: Harsh Prateek Bora Signed-off-by: Aneesh Kumar K.V --- hw/9pfs/virtio-9p.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'hw/9pfs/virtio-9p.c') diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c index dcbcdb0..2ad8f84 100644 --- a/hw/9pfs/virtio-9p.c +++ b/hw/9pfs/virtio-9p.c @@ -1402,6 +1402,15 @@ static void v9fs_getattr(void *opaque) goto out; } stat_to_v9stat_dotl(s, &stbuf, &v9stat_dotl); + + /* fill st_gen if requested and supported by underlying fs */ + if (request_mask & P9_STATS_GEN) { + retval = v9fs_co_st_gen(pdu, &fidp->path, stbuf.st_mode, &v9stat_dotl); + if (retval < 0) { + goto out; + } + v9stat_dotl.st_result_mask |= P9_STATS_GEN; + } retval = offset; retval += pdu_marshal(pdu, offset, "A", &v9stat_dotl); out: -- cgit v1.1