initialized(false), mounted(false), unmounting(false),
local_osd(-1), local_osd_epoch(0),
unsafe_sync_write(0),
- file_stripe_unit(0),
- file_stripe_count(0),
- object_size(0),
- file_replication(0),
client_lock("Client::client_lock")
{
monclient->set_messenger(m);
int Client::open(const char *relpath, int flags, mode_t mode)
{
/* Use default file striping parameters */
- return open(relpath, flags, mode, file_stripe_unit, file_stripe_count,
- object_size, NULL);
+ return open(relpath, flags, mode, 0, 0, 0, NULL);
}
int Client::lookup_hash(inodeno_t ino, inodeno_t dirino, const char *name)
req->head.args.open.stripe_unit = stripe_unit;
req->head.args.open.stripe_count = stripe_count;
req->head.args.open.object_size = object_size;
- req->head.args.open.file_replication = file_replication;
req->dentry_drop = CEPH_CAP_FILE_SHARED;
req->dentry_unless = CEPH_CAP_FILE_EXCL;
trim_cache();
ldout(cct, 3) << "create(" << path << ", 0" << oct << mode << dec
- << " layout " << file_stripe_unit
- << ' ' << file_stripe_count
- << ' ' << object_size
- << ' ' << file_replication
- <<") = " << res << dendl;
+ << " layout " << stripe_unit
+ << ' ' << stripe_count
+ << ' ' << object_size
+ <<") = " << res << dendl;
return res;
fail:
// =========================================
// layout
-// default layout
-
-void Client::set_default_file_stripe_unit(int stripe_unit)
-{
- if (stripe_unit > 0)
- file_stripe_unit = stripe_unit;
-}
-
-void Client::set_default_file_stripe_count(int count)
-{
- if (count > 0)
- file_stripe_count = count;
-}
-
-void Client::set_default_object_size(int size)
-{
- if (size > 0)
- object_size = size;
-}
-
-void Client::set_default_file_replication(int replication)
-{
- if (replication >= 0)
- file_replication = replication;
-}
-
-
// expose file layouts
int Client::describe_layout(int fd, ceph_file_layout *lp)
int unsafe_sync_write;
- int file_stripe_unit;
- int file_stripe_count;
- int object_size;
- int file_replication;
public:
entity_name_t get_myname() { return messenger->get_myname(); }
void sync_write_commit(Inode *in);
int get_local_osd();
int get_pool_replication(int64_t pool);
- void set_default_file_stripe_unit(int stripe_unit);
- void set_default_file_stripe_count(int count);
- void set_default_object_size(int size);
- void set_default_file_replication(int replication);
-
int enumerate_layout(int fd, vector<ObjectExtent>& result,
loff_t length, loff_t offset);
/** @} filelayout */
/**
- * @defgroup libcephfs_h_default_filelayout Control the Default File Layout.
- * Functions for setting and getting the default file layout for new files.
- *
- * @{
- */
-
-/**
- * Set the default stripe unit of files created in this mount.
- *
- * @param cmount the ceph mount handle to use.
- * @param stripe the stripe size to use
- * @returns 0 on success or a negative error code on failure.
+ * No longer available. Do not use.
+ * These functions will return -EOPNOTSUPP.
*/
int ceph_set_default_file_stripe_unit(struct ceph_mount_info *cmount, int stripe);
-
-/**
- * Set the default stripe count of files created in this mount.
- *
- * @param cmount the ceph mount handle to use.
- * @param count the stripe count to use
- * @returns 0 on success or a negative error code on failure.
- */
int ceph_set_default_file_stripe_count(struct ceph_mount_info *cmount, int count);
-
-/**
- * Set the default object size to use for striping.
- *
- * @param cmount the ceph mount handle to use.
- * @param size the default size for objects
- * @returns 0 on success or a negative error code on failure
- */
int ceph_set_default_object_size(struct ceph_mount_info *cmount, int size);
-
-/**
- * No longer available. Do not use.
- * Set the default preferred placement group. This option will return
- * -EOPNOTSUPP as it is no longer supported.
- */
int ceph_set_default_preferred_pg(struct ceph_mount_info *cmount, int osd);
-
-/**
- * Set the default file replication factor.
- *
- * @param cmount the ceph mount handle to use.
- * @param replication the default replication factor for files in this filesystem.
- * @returns 0 on success or negative error code on failure.
- */
int ceph_set_default_file_replication(struct ceph_mount_info *cmount, int replication);
/**
extern "C" int ceph_set_default_file_stripe_unit(struct ceph_mount_info *cmount,
int stripe)
{
- if (!cmount->is_mounted())
- return -ENOTCONN;
- cmount->get_client()->set_default_file_stripe_unit(stripe);
- return 0;
+ // this option no longer exists
+ return -EOPNOTSUPP;
}
extern "C" int ceph_set_default_file_stripe_count(struct ceph_mount_info *cmount,
int count)
{
- if (!cmount->is_mounted())
- return -ENOTCONN;
- cmount->get_client()->set_default_file_stripe_unit(count);
- return 0;
+ // this option no longer exists
+ return -EOPNOTSUPP;
}
extern "C" int ceph_set_default_object_size(struct ceph_mount_info *cmount, int size)
{
- if (!cmount->is_mounted())
- return -ENOTCONN;
- cmount->get_client()->set_default_object_size(size);
- return 0;
+ // this option no longer exists
+ return -EOPNOTSUPP;
}
extern "C" int ceph_set_default_file_replication(struct ceph_mount_info *cmount,
int replication)
{
- if (!cmount->is_mounted())
- return -ENOTCONN;
- cmount->get_client()->set_default_file_replication(replication);
- return 0;
+ // this option no longer exists
+ return -EOPNOTSUPP;
}
extern "C" int ceph_set_default_preferred_pg(struct ceph_mount_info *cmount, int osd)