{
static wccstat3 result;
- result.status = NFS3ERR_NOTSUPP;
+ result.wccstat3_u.wcc.before.present = FALSE;
+ result.wccstat3_u.wcc.after.present = FALSE;
+
+ BlueSkyInode *dir = lookup_fh(&argp->dir);
+ if (dir == NULL) {
+ result.status = NFS3ERR_STALE;
+ return &result;
+ }
+
+ encode_pre_wcc(&result.wccstat3_u.wcc, dir);
+
+ if (!validate_filename(argp->name)
+ || strcmp(argp->name, ".") == 0
+ || strcmp(argp->name, "..") == 0)
+ {
+ result.status = NFS3ERR_NOENT;
+ return &result;
+ }
+
+ bluesky_directory_remove(dir, argp->name);
+
+ result.status = NFS3_OK;
+ result.wccstat3_u.wcc.after.present = TRUE;
+ encode_fattr3(&result.wccstat3_u.wcc.after.post_op_attr_u.attributes,
+ dir);
return &result;
}